community[minor]: add hf chat wrapper (#14736)

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>
This commit is contained in:
Jacob Lee
2023-12-21 09:28:30 -08:00
committed by GitHub
parent b99274c9d8
commit 1b01ee0e3c
5 changed files with 636 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
"""Test HuggingFace Chat wrapper."""
from importlib import import_module
def test_import_class() -> None:
"""Test that the class can be imported."""
module_name = "langchain_community.chat_models.huggingface"
class_name = "ChatHuggingFace"
module = import_module(module_name)
assert hasattr(module, class_name)

View File

@@ -11,6 +11,7 @@ EXPECTED_ALL = [
"ChatCohere",
"ChatDatabricks",
"ChatGooglePalm",
"ChatHuggingFace",
"ChatMlflow",
"ChatMLflowAIGateway",
"ChatOllama",