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

Image Variation Getting Status 504 with Certain Images #739

Open
william-murphy opened this issue May 10, 2024 · 0 comments
Open

Image Variation Getting Status 504 with Certain Images #739

william-murphy opened this issue May 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@william-murphy
Copy link

Describe the bug
When generating an image with the image variation function, certain images seem to cause a 504 response and strange/unhelpful error message every time they are run.

To Reproduce
Use the image found at https://images.pexels.com/photos/2385654/pexels-photo-2385654.jpeg?auto=compress&cs=tinysrgb&fit=crop&dpr=1&w=1024&h=1024

file, err := os.Open(filePath) // where filePath is the path to the image above downloaded locally
if err != nil {
  return nil, fmt.Errorf("error opening real image file:%w", err)
}
defer file.Close()

response, err := client.CreateVariImage(
  context.Background(),
  openai.ImageVariRequest{
    Image:        file,
    N:                number,
    Size:           openai.CreateImageSize1024x1024,
    ResponseFormat: openai.CreateImageResponseFormatB64JSON,
  },
)
if err != nil {
  return nil, err
}

Expected behavior
The request will either work, or it will not work and return a helpful error message.

Screenshots/Logs
error, status code: 504, message: invalid character '<' looking for beginning of value

Environment (please complete the following information):

  • go-openai version: v1.23.1
  • Go version: go version go1.22.2 darwin/amd64
  • OpenAI API version: Dalle2 ?
  • OS: MacOS Sonoma 14.4.1 (23E224)
@william-murphy william-murphy added the bug Something isn't working label May 10, 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

1 participant