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

chat_completion gives no error for wrong input tupe #2225

Closed
aymeric-roucher opened this issue Apr 15, 2024 · 2 comments · Fixed by #2257
Closed

chat_completion gives no error for wrong input tupe #2225

aymeric-roucher opened this issue Apr 15, 2024 · 2 comments · Fixed by #2257
Labels
bug Something isn't working

Comments

@aymeric-roucher
Copy link

Describe the bug

InferenceClient.chat_completion, called with only a string as input (as one would do with text_generation), returns no errors: it simply ignores the input to build its answer.

Reproduction

from huggingface_hub import InferenceClient
url = "HuggingFaceH4/zephyr-orpo-141b-A35b-v0.1"
llm_client = InferenceClient(model=url, timeout=180)

print(llm_client.chat_completion("please output 'Observation'", stop=["Observation", "Final Answer"], max_tokens=200).choices[0].message)
print(llm_client.chat_completion("Hello there", stop=["Observation", "Final Answer"], max_tokens=200).choices[0].message)

Logs

ChatCompletionOutputChoiceMessage(content='What is the result of 20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', role='assistant')
ChatCompletionOutputChoiceMessage(content='What is the result of 20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', role='assistant')

System info

- huggingface_hub version: 0.22.2
- Platform: macOS-14.1-arm64-arm-64bit
- Python version: 3.11.6
- Running in iPython ?: Yes
- iPython shell: ZMQInteractiveShell
- Running in notebook ?: Yes
- Running in Google Colab ?: No
- Token path ?: /Users/aymeric/.cache/huggingface/token
- Has saved token ?: True
- Who am I ?: m-ric
- Configured git credential helpers: osxkeychain
- FastAI: N/A
- Tensorflow: N/A
- Torch: 2.1.1
- Jinja2: 3.1.2
- Graphviz: N/A
- keras: N/A
- Pydot: N/A
- Pillow: 10.2.0
- hf_transfer: N/A
- gradio: 4.22.0
- tensorboard: N/A
- numpy: 1.26.3
- pydantic: 2.5.0
- aiohttp: 3.9.3
- ENDPOINT: https://huggingface.co
- HF_HUB_CACHE: /Users/aymeric/.cache/huggingface/hub
- HF_ASSETS_CACHE: /Users/aymeric/.cache/huggingface/assets
- HF_TOKEN_PATH: /Users/aymeric/.cache/huggingface/token
- HF_HUB_OFFLINE: False
- HF_HUB_DISABLE_TELEMETRY: False
- HF_HUB_DISABLE_PROGRESS_BARS: None
- HF_HUB_DISABLE_SYMLINKS_WARNING: False
- HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False
- HF_HUB_DISABLE_IMPLICIT_TOKEN: False
- HF_HUB_ENABLE_HF_TRANSFER: False
- HF_HUB_ETAG_TIMEOUT: 10
- HF_HUB_DOWNLOAD_TIMEOUT: 10
@aymeric-roucher aymeric-roucher added the bug Something isn't working label Apr 15, 2024
@aymeric-roucher
Copy link
Author

@Wauplin here's the issue!

@Wauplin
Copy link
Contributor

Wauplin commented Apr 15, 2024

Thanks for opening! Definitely a bug yes, you should receive a 422 unprocessable entity. I'll look into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants