You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In other inference APIs, response_format={"type": "json_object"} restricts the model output to be a valid JSON object without enforcing a schema.
Right now this is not supported:
Failed to deserialize the JSON body into the target type: response_format: missing field `value` at line 1 column 168
I ended up with this error while using lotus-ai which uses the litellm library with response_format={ "type": "json_object" }
To reproduce:
fromhuggingface_hubimportInferenceClientc=InferenceClient("meta-llama/Llama-3.3-70B-Instruct")
c.chat_completion([{"role": "user", "content": "Give me a dummy json of a person"}], response_format={"type": "json_object"})
Hi @lhoestq I just took a look at how this may be implemented in TGI and it seems that outlines does not support arbitrary JSON so we would need to add different grammar backend that supports this feature.
I believe XGrammar supports this functionality, and an issues has been opened recently here: #2900. Its unclear to me at the moment what would need to change to support XGrammar but I will dive a bit deeper and share updates here
In other inference APIs,
response_format={"type": "json_object"}
restricts the model output to be a valid JSON object without enforcing a schema.Right now this is not supported:
I ended up with this error while using
lotus-ai
which uses thelitellm
library withresponse_format={ "type": "json_object" }
To reproduce:
Original issue: huggingface/huggingface_hub#2744
The text was updated successfully, but these errors were encountered: