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

feat: HuggingFaceAPIChatGenerator #7480

Merged
merged 30 commits into from
Apr 5, 2024
Merged

feat: HuggingFaceAPIChatGenerator #7480

merged 30 commits into from
Apr 5, 2024

Conversation

anakin87
Copy link
Member

@anakin87 anakin87 commented Apr 4, 2024

Related Issues

Proposed Changes:

As discussed in #7279 (comment),

  • introduce a new better HuggingFaceAPIChatGenerator
  • deprecate HuggingFaceTGIChatGenerator

How did you test it?

CI, new tests, extensive manual tests: with HF Inference API, local TGI container and paid HF Inference Endpoint

Notes for the reviewer

Our implementation is based on huggingface_hub.
Since huggingface_hub recently introduced a Chat-completion API, I used this instead of the text_generation:

  • the chat template is rendered server-side when models are powered by TGI (most of the cases)
  • otherwise, the templating happens client-side (requires minijinja) -> we can get rid of transformers in this component
  • they aim at rendering all templates server-side in the future.

Checklist

@github-actions github-actions bot added topic:tests type:documentation Improvements on the docs labels Apr 4, 2024
@anakin87 anakin87 marked this pull request as ready for review April 4, 2024 17:00
@anakin87 anakin87 requested review from a team as code owners April 4, 2024 17:00
@anakin87 anakin87 requested review from dfokina and vblagoje and removed request for a team April 4, 2024 17:00
Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

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

Found some minor issues, great work @anakin87 🚀

Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

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

Found some minor issues, great work @anakin87 🚀

@anakin87 anakin87 requested a review from vblagoje April 5, 2024 09:07
@anakin87 anakin87 requested a review from vblagoje April 5, 2024 09:52
Base automatically changed from hfapigenerator to main April 5, 2024 16:48
@anakin87 anakin87 merged commit 0dbb98c into main Apr 5, 2024
24 checks passed
@anakin87 anakin87 deleted the hfapichatgenerator branch April 5, 2024 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:tests type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants