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
The task parameter is left undefined.
The error I get is empty after 'Bad request:'
File "/Users/aymeric/Documents/Code/endpoint-snooper/.venv/lib/python3.12/site-packages/huggingface_hub/hf_api.py", line 7484, in create_inference_endpoint
hf_raise_for_status(response)
File "/Users/aymeric/Documents/Code/endpoint-snooper/.venv/lib/python3.12/site-packages/huggingface_hub/utils/_errors.py", line 358, in hf_raise_for_status
raise BadRequestError(message, response=response) from e
huggingface_hub.utils._errors.BadRequestError: (Request ID: WWttaQ)
Bad request:
But it should contain some useful information: if we add a print(response.text) just before running hf_raise_for_status(response) in create_inference_endpoint we get precious info : Failed to parse the request body as JSON: model.task: expected value at line 1 column 257 that allows to correct the issue.
So the error seems improperly handled (error 400) in hf_raise_for_status, causing it to lose the content of the error.
Hi @aymeric-roucher, thanks for reporting this! As a matter of fact, it has been a annoying issue since quite some time but we've fixed it since 2 weeks ago in #2474. It will be shipped in next release.
Describe the bug
When running this snippet:
The
task
parameter is left undefined.The error I get is empty after 'Bad request:'
But it should contain some useful information: if we add a
print(response.text)
just before runninghf_raise_for_status(response)
increate_inference_endpoint
we get precious info :Failed to parse the request body as JSON: model.task: expected value at line 1 column 257
that allows to correct the issue.So the error seems improperly handled (error 400) in
hf_raise_for_status
, causing it to lose the content of the error.Reproduction
No response
Logs
No response
System info
The text was updated successfully, but these errors were encountered: