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

community[minor] HuggingFaceTransformersEmbeddings enhancements #6059

Merged
merged 5 commits into from
Jul 16, 2024

Conversation

toboid
Copy link
Contributor

@toboid toboid commented Jul 13, 2024

HuggingFaceTransformersEmbeddings uses a feature-extraction pipeline from @xenova/transformers.
This change adds support for providing arguments (pretrainedOptions) to the creation of the pipeline and when executing the pipeline (pipelineOptions). Also bumps @xenova/transformers to the latest.

  • Upgrade @xenova/transformers peer dep from ^2.5.4 -> ^2.17.2
  • Add optional pretrainedOptions to constructor args object HuggingFaceTransformersEmbeddingsParams. This is passed to @xenova/transformers when creating a pipeline.
  • Add optional pipelineOptions to constructor args object HuggingFaceTransformersEmbeddingsParams. This is passed to the pipeline when executing it. There prev. arguments which where hardcoded remain the default for backwards compatibility.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 13, 2024
Copy link

vercel bot commented Jul 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 15, 2024 9:40pm
langchainjs-docs ✅ Ready (Inspect) Visit Preview Jul 15, 2024 9:40pm

@dosubot dosubot bot added the auto:improvement Medium size change to existing code to handle new use-cases label Jul 13, 2024
@toboid toboid changed the title HuggingFaceTransformersEmbeddings enhancements community[minor] HuggingFaceTransformersEmbeddings enhancements Jul 13, 2024
Copy link
Collaborator

@bracesproul bracesproul left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for pushing this up, looks like a good improvement to add.

Additionally, it would be great if you could add a small section in the docs showing off the new options/an example showing why people might want to use them, but not required.

Granted CI passes, I'll land this EOD today.

@dosubot dosubot bot added the lgtm PRs that are ready to be merged as-is label Jul 15, 2024
@jacoblee93
Copy link
Collaborator

Thank you!

@toboid
Copy link
Contributor Author

toboid commented Jul 16, 2024

Nice! Thanks for pushing this up, looks like a good improvement to add.

Additionally, it would be great if you could add a small section in the docs showing off the new options/an example showing why people might want to use them, but not required.

Granted CI passes, I'll land this EOD today.

Thanks for landing. Yes sure, i'll submit a follow-up with docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:improvement Medium size change to existing code to handle new use-cases lgtm PRs that are ready to be merged as-is size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants