-
Notifications
You must be signed in to change notification settings - Fork 15.7k
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
Add Hugging Face chat wrapper #14040
Add Hugging Face chat wrapper #14040
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
fix formatting
@hwchase17 When running the unit tests locally, there are 22 tests that are failing, all of which are inside these two files:
However, when I run pytest on each of those files individually with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the unit test error/failure you're seeing?
libs/langchain/langchain/chat_models/huggingface_chat_wrapper.py
Outdated
Show resolved
Hide resolved
@baskaryan The unit tests were failing due to that global import of an optional dependency. Fixed that so everything is passing locally now. Let me know if there's anything else I need to add here (like integration tests)? Thanks! |
@baskaryan Looks like
When you get the chance, could you help advise on what might be wrong? Thanks! |
- **Description:** Added a tool called RedditSearchRun and an accompanying API wrapper, which searches Reddit for posts with support for time filtering, post sorting, query string and subreddit filtering. - **Issue:** langchain-ai#13891 - **Dependencies:** `praw` module is used to search Reddit - **Tag maintainer:** @baskaryan , and any of the other maintainers if needed - **Twitter handle:** None. Hello, This is our first PR and we hope that our changes will be helpful to the community. We have run `make format`, `make lint` and `make test` locally before submitting the PR. To our knowledge, our changes do not introduce any new errors. Our PR integrates the `praw` package which is already used by RedditPostsLoader in LangChain. Nonetheless, we have added integration tests and edited unit tests to test our changes. An example notebook is also provided. These changes were put together by me, @Anika2000, @CharlesXu123, and @Jeremy-Cheng-stack Thank you in advance to the maintainers for their time. --------- Co-authored-by: What-Is-A-Username <49571870+What-Is-A-Username@users.noreply.github.com> Co-authored-by: Anika2000 <anika.sultana@mail.utoronto.ca> Co-authored-by: Jeremy Cheng <81793294+Jeremy-Cheng-stack@users.noreply.github.com> Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
This reverts commit 38813d7. This is a temporary fix, as I don't see a clear way on how to use multiple keys with `Qdrant.from_texts`. Context: langchain-ai#14378
The namespaces like `langchain.agents.format_scratchpad` clogging the API Reference sidebar. This change removes those 3-level namespaces from sidebar (this issue was discussed with @efriis ) --------- Co-authored-by: Erick Friis <erick@langchain.dev>
Many jupyter notebooks didn't pass linting. List of these files are presented in the [tool.ruff.lint.per-file-ignores] section of the pyproject.toml . Addressed these bugs: - fixed bugs; added missed imports; updated pyproject.toml Only the `document_loaders/tensorflow_datasets.ipyn`, `cookbook/gymnasium_agent_simulation.ipynb` are not completely fixed. I'm not sure about imports. --------- Co-authored-by: Erick Friis <erick@langchain.dev>
Updated provider page by adding LLM and ChatLLM references; removed a content that is duplicate text from the LLM referenced page. Updated the collback page
…n into add-hf-chat-wrapper
Thanks for your help on this @A-Roucher! @baskaryan This PR is now passing all tests and linting checks. Please let us know if anything else is needed to get this merged! |
No problem @andrewrreed, looking forward to start using this integration! |
This reverts commit a8f39af.
Builds on #14040 with community refactor merged and notebook updated. Note that with this refactor, models will be imported from `langchain_community.chat_models.huggingface` rather than the main `langchain` repo. --------- Signed-off-by: harupy <17039389+harupy@users.noreply.github.com> Signed-off-by: ugm2 <unaigaraymaestre@gmail.com> Signed-off-by: Yuchen Liang <yuchenl3@andrew.cmu.edu> Co-authored-by: Andrew Reed <andrew.reed.r@gmail.com> Co-authored-by: Andrew Reed <areed1242@gmail.com> Co-authored-by: A-Roucher <aymeric.roucher@gmail.com> Co-authored-by: Aymeric Roucher <69208727+A-Roucher@users.noreply.github.com>
landed in #14736 |
Issue
There previously has been no easy way to make use of models hosted on Hugging Face (via Inference API or Inference Endpoints) in combination with LangChains ChatModel abstraction.
Description
This PR introduces a new chat_model integration that creates a wrapper around the
BaseChatModel
class that interfaces between LangChain's and the hosted LLM by leveraging Hugging Face's Chat Templates.To do
BaseChatModel
to interface with HF LLM integrationsdocs/integrations/chat
that demonstrates its useTag maintainer
@hwchase17
Twitter handle
@andrewrreed