-
Notifications
You must be signed in to change notification settings - Fork 2k
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
chore: Update huggingface_hub classes used after library upgrade #7631
Conversation
One sec @silvanocerza not sure how this reno note ended up here |
@vblagoje no worries, it's some autoformatting add a new line at the end of the file. Feel free to leave it there. |
Ok @silvanocerza let's see if CI is green now |
@@ -208,8 +208,8 @@ def _run_non_streaming(self, prompt: str, generation_kwargs: Dict[str, Any]): | |||
meta = [ | |||
{ | |||
"model": self._client.model, | |||
"finish_reason": tgr.details.finish_reason, | |||
"usage": {"completion_tokens": len(tgr.details.tokens)}, | |||
"finish_reason": tgr.details.finish_reason if tgr.details else None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@silvanocerza this was failing in local tests because details is now optional field. I added this guard here, in chat version and TGI equivalents. Double check that guarding logic please
@silvanocerza I tested HuggingFaceTGIGenerator, HuggingFaceAPIGenerator, HuggingFaceTGIChatGenerator, HuggingFaceAPIChatGenerator in both streaming and non-streaming variants - they all work now. |
This PR required reno note, we don't want users to somehow end up using the old version of huggingface_hub which will cause issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good. 👍
Upgraded the required version of
huggingface_hub
to>=0.23.0
across various modules to ensure compatibility and leverage the latest features. This update includes modifications to error handling for token generation details and introduces adjustments in the chat and text generation interfaces to enhance functionality and developer experience. Users are advised to upgrade theirhuggingface_hub
dependency.