Skip to content

docs: discourage usage of HuggingFaceAPIGenerator with the HF Inference API #9590

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

Merged
merged 4 commits into from
Jul 4, 2025

Conversation

anakin87
Copy link
Member

@anakin87 anakin87 commented Jul 4, 2025

Related Issues

The idea of using chat_completion method in the HuggingFaceAPIGenerator has been abandoned because:

  • it would create duplication with the HuggingFaceAPIChatGenerator
  • it would make the component usage less transparent and intuitive
  • this component still works well with HF Inference Endpoints and TGI - using text_generation

Proposed Changes:

  • I want to convey this message: "To generate text with the HF Inference API, use the HuggingFaceAPIChatGenerator"
    • modified docstrings
    • added a warning
    • explained what happened in the release notes

Notes for the reviewer

For now, I have decided not to deprecate the usage of SERVERLESS_INFERENCE_API in this component because, as there is no official communication, I am not sure if they will not re-enable this option in the future.

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added unit tests and updated the docstrings
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

@github-actions github-actions bot added the type:documentation Improvements on the docs label Jul 4, 2025
@coveralls
Copy link
Collaborator

coveralls commented Jul 4, 2025

Pull Request Test Coverage Report for Build 16075800688

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.001%) to 90.433%

Files with Coverage Reduction New Missed Lines %
components/generators/hugging_face_api.py 3 96.51%
Totals Coverage Status
Change from base Build 16068517356: 0.001%
Covered Lines: 11684
Relevant Lines: 12920

💛 - Coveralls

@anakin87 anakin87 marked this pull request as ready for review July 4, 2025 10:12
@anakin87 anakin87 requested review from a team as code owners July 4, 2025 10:12
@anakin87 anakin87 requested review from dfokina and sjrl and removed request for a team July 4, 2025 10:12
Copy link
Contributor

@dfokina dfokina left a comment

Choose a reason for hiding this comment

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

Some language suggestions

Copy link
Contributor

@sjrl sjrl left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@anakin87 anakin87 enabled auto-merge (squash) July 4, 2025 14:19
@anakin87 anakin87 merged commit 2693f39 into main Jul 4, 2025
21 checks passed
@anakin87 anakin87 deleted the discourage-hfapigenerator-hfinferenceapi branch July 4, 2025 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HuggingFaceAPIGenerator is not working
4 participants