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

chore: Update huggingface_hub classes used after library upgrade #7631

Merged
merged 6 commits into from
May 3, 2024

Conversation

vblagoje
Copy link
Member

@vblagoje vblagoje commented May 2, 2024

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 their huggingface_hub dependency.

@github-actions github-actions bot added topic:tests 2.x Related to Haystack v2.0 labels May 2, 2024
@vblagoje vblagoje added the ignore-for-release-notes PRs with this flag won't be included in the release notes. label May 2, 2024
@vblagoje vblagoje marked this pull request as ready for review May 2, 2024 14:11
@vblagoje vblagoje requested review from a team as code owners May 2, 2024 14:11
@vblagoje vblagoje requested review from dfokina and silvanocerza and removed request for a team May 2, 2024 14:11
@vblagoje
Copy link
Member Author

vblagoje commented May 2, 2024

One sec @silvanocerza not sure how this reno note ended up here

@silvanocerza
Copy link
Contributor

@vblagoje no worries, it's some autoformatting add a new line at the end of the file. Feel free to leave it there.

@vblagoje
Copy link
Member Author

vblagoje commented May 2, 2024

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,
Copy link
Member Author

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

@github-actions github-actions bot added the type:documentation Improvements on the docs label May 2, 2024
@vblagoje
Copy link
Member Author

vblagoje commented May 2, 2024

@silvanocerza I tested HuggingFaceTGIGenerator, HuggingFaceAPIGenerator, HuggingFaceTGIChatGenerator, HuggingFaceAPIChatGenerator in both streaming and non-streaming variants - they all work now.

@vblagoje
Copy link
Member Author

vblagoje commented May 2, 2024

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.

@vblagoje vblagoje removed the ignore-for-release-notes PRs with this flag won't be included in the release notes. label May 2, 2024
Copy link
Contributor

@silvanocerza silvanocerza left a comment

Choose a reason for hiding this comment

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

Seems good. 👍

@silvanocerza silvanocerza merged commit 5f81337 into main May 3, 2024
26 checks passed
@silvanocerza silvanocerza deleted the tgi_fix branch May 3, 2024 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to Haystack v2.0 topic:build/distribution topic:tests type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants