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 generation endpoint response_format does not match OpenAI spec #2299

Closed
cheahjs opened this issue May 12, 2024 · 3 comments
Closed

image generation endpoint response_format does not match OpenAI spec #2299

cheahjs opened this issue May 12, 2024 · 3 comments
Labels
confirmed enhancement New feature or request up for grabs Tickets that no-one is currently working on

Comments

@cheahjs
Copy link

cheahjs commented May 12, 2024

LocalAI version:
LocalAI version: v2.15.0 (f69de3b)

Environment, CPU architecture, OS, and Version:

root@23ec4a478b09:/build# uname -a
Linux 23ec4a478b09 6.6.22-linuxkit #1 SMP Fri Mar 29 12:21:27 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Describe the bug
LocalAI does not accept a string for response_format when calling image generation. As per OpenAI's spec, this is a string that is either url or b64_json.

To Reproduce

$ curl http://localhost:8080/v1/images/generations  -H "Content-Type: application/json"  -d '{ "prompt": "|", "step": 25, "size": "512x512", "response_format": "b64_json" }'
{"error":{"code":500,"message":"failed reading parameters from request:failed parsing request body: json: cannot unmarshal string into Go struct field OpenAIRequest.response_format of type schema.ChatCompletionResponseFormat","type":""}}

Expected behavior
LocalAI accepts response_format as a string per OpenAI specs.

Logs

Additional context

@cheahjs cheahjs added bug Something isn't working unconfirmed labels May 12, 2024
@mudler
Copy link
Owner

mudler commented May 13, 2024

I can confirm this, it is currently not supported but looking for implementation

@mudler mudler added up for grabs Tickets that no-one is currently working on enhancement New feature or request and removed bug Something isn't working labels May 13, 2024
@prajwalnayak7
Copy link
Contributor

Implementation #2347

@mudler
Copy link
Owner

mudler commented May 29, 2024

fixed now in master, thanks @prajwalnayak7 !

@mudler mudler closed this as completed May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed enhancement New feature or request up for grabs Tickets that no-one is currently working on
Projects
None yet
Development

No branches or pull requests

3 participants