Add Content-Type: application/json
in curl examples
#951
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to slack thread (internal) cc @osanseviero @Narsil @julien-c
Models served on Inference API with TGI (e.g meta-llama/Llama-2-70B-chat-hf) requires
'Content-Type: application/json'
to be set as header otherwise the server throws an error (Expected request with Content-Type: application/json). Let's add it to the cURL snippets to be consistent even if models served withtransformers
don't need it.Another possibility would be to disable the check on TGI side.
EDIT: it's also possible to add the header only to the text-generation snippets. Seems a bit inconsistent to me but I can update the PR if needed.