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

Add Content-Type: application/json in curl examples #951

Merged
merged 3 commits into from
Sep 15, 2023

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Sep 13, 2023

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 with transformers 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.

Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally think it's fine to add it everywhere, but would stick it just after the actual payload

(more logical place imo)

@Wauplin
Copy link
Contributor Author

Wauplin commented Sep 14, 2023

would stick it just after the actual payload

Right, I just made the change.

Copy link
Contributor

@osanseviero osanseviero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot!

@Wauplin
Copy link
Contributor Author

Wauplin commented Sep 15, 2023

Thanks for the review, I'm merging this :)

@Wauplin Wauplin merged commit 0246b40 into main Sep 15, 2023
2 checks passed
@Wauplin Wauplin deleted the add-content-type-to-curl-snippet branch September 15, 2023 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants