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: HuggingFaceLocalGenerator - first implementation #6022

Merged
merged 16 commits into from
Oct 13, 2023

Conversation

anakin87
Copy link
Member

@anakin87 anakin87 commented Oct 10, 2023

Related Issues

Proposed Changes:

  • HuggingFaceLocalGenerator is a 2.x component that generates text, by locally running a Hugging Face pipeline
    (same purpose of Hugging Face invocation layer for PromptNode)

  • Simple usage: you can just specify model_name_or_path

  • text generation can be influenced using generation_kwargs

  • Customizable: experienced users can have full control of the Hugging Face pipeline using pipeline_kwargs

  • 📓 Notebook with usage examples (potentially useful for docs and devrel purposes)

How did you test it?

CI, new unit tests, manual tests

Notes for the reviewer

This is a first implementation.
Some features (max length handling, stopwords, streaming) are missing and are tracked in #5953.

Checklist

@github-actions github-actions bot added topic:tests type:documentation Improvements on the docs labels Oct 10, 2023
@anakin87 anakin87 marked this pull request as ready for review October 10, 2023 17:00
@anakin87 anakin87 requested review from a team as code owners October 10, 2023 17:00
@anakin87 anakin87 requested review from dfokina and vblagoje and removed request for a team October 10, 2023 17:00
@anakin87 anakin87 added the 2.x Related to Haystack v2.0 label Oct 11, 2023
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.

Looks awesome, left some minor comments

@anakin87
Copy link
Member Author

@dfokina can you take a look at the docstrings?

@anakin87 anakin87 changed the title feat: HuggingFaceLocalGenerator feat: HuggingFaceLocalGenerator - first implementation Oct 13, 2023
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.

Pushed a small language update, looks good :)

@dfokina
Copy link
Contributor

dfokina commented Oct 13, 2023

Sorry for extra spaces in docstrings @anakin87 😬

@anakin87 anakin87 merged commit fbd22bc into main Oct 13, 2023
20 checks passed
@anakin87 anakin87 deleted the hf-local-generator branch October 13, 2023 09:23
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:tests type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HuggingFaceLocalGenerator - minimal implementation
3 participants