Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid character 'H' looking for beginning of value #635

Closed
CNTWDev opened this issue Jan 14, 2024 · 6 comments
Closed

invalid character 'H' looking for beginning of value #635

CNTWDev opened this issue Jan 14, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@CNTWDev
Copy link

CNTWDev commented Jan 14, 2024

Describe the bug
call api CreateTranslation
get error code: invalid character 'H' looking for beginning of value

To Reproduce
Steps to reproduce the behavior, including any relevant code snippets.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots/Logs
If applicable, add screenshots to help explain your problem. For non-graphical issues, please provide any relevant logs or stack traces.

Environment (please complete the following information):

  • go-openai version: 1.17.11
  • Go version: [e.g. 1.19]
  • OpenAI API version: [e.g. v1]
  • OS: Linux iZgw839frdaicos127vowbZ 3.10.0-1160.59.1.el7.x86_64 Add logprob support #1 SMP Wed Feb 23 16:47:03 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Additional context
Add any other context about the problem here.

@CNTWDev CNTWDev added the bug Something isn't working label Jan 14, 2024
@CNTWDev
Copy link
Author

CNTWDev commented Jan 14, 2024

@sashabaranov please help,thx

@CNTWDev
Copy link
Author

CNTWDev commented Jan 15, 2024

@sashabaranov please

@sashabaranov
Copy link
Owner

@CNTWDev could you please provide a minimal code example to reproduce this?

@CNTWDev
Copy link
Author

CNTWDev commented Jan 15, 2024

func asr(c *gin.Context, filePath string) (string, error) { // check if the file exist if len(filePath) == 0 { return "", nil } checkGPTClient() req := openai.AudioRequest{ Model: openai.Whisper1, FilePath: filePath, Format: openai.AudioResponseFormatText, Temperature: math.SmallestNonzeroFloat32, } resp, err := gptClient.CreateTranslation(context.Background(), req) if err != nil { logger.ZapLog.Error("[asr]", zap.Error(err)) fmt.Printf("Transcription error: %v\n", err) return "", err } return resp.Text, nil }
image

@CNTWDev
Copy link
Author

CNTWDev commented Jan 15, 2024

@sashabaranov thx, my friend

@CNTWDev
Copy link
Author

CNTWDev commented Jan 16, 2024

I used the wrong format.
Sorry about it.
Closed

@CNTWDev CNTWDev closed this as completed Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants