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
If you create a Client with a server URI ending in a slash, the generation endpoint works fine but the chat endpoint fails silently (for the Python client, it's a JSONDecodeError because the server returns a 404 with an empty body, and empty-string isn't valid JSON; that's a separate bug though).
(I'm also confused about the intended relationship between the Python client library in this repo and the InferenceClient one in huggingface_hub. The docs refer to both, in different places.)
Information
Docker
The CLI directly
Tasks
An officially supported command
My own modifications
Reproduction
fromtext_generationimportClientclient=Client('http://localhost:3000/')
client.chat(messages=[
{
"role": "system",
"content": "You answer in bulleted lists."
},
{
"role": "user",
"content": "Why is the sky blue?"
}
], max_tokens=100)
Expected behavior
Same as if the trailing / in the Client URI is missing.
This could be as simple as self.base_url = base_url.rstrip('/') on:
System Info
If you create a
Client
with a server URI ending in a slash, the generation endpoint works fine but the chat endpoint fails silently (for the Python client, it's a JSONDecodeError because the server returns a 404 with an empty body, and empty-string isn't valid JSON; that's a separate bug though).(I'm also confused about the intended relationship between the Python client library in this repo and the InferenceClient one in huggingface_hub. The docs refer to both, in different places.)
Information
Tasks
Reproduction
Expected behavior
Same as if the trailing
/
in theClient
URI is missing.This could be as simple as
self.base_url = base_url.rstrip('/')
on:text-generation-inference/clients/python/text_generation/client.py
Line 62 in e9f03f8
The text was updated successfully, but these errors were encountered: