fix(huggingface): Helper logic for init_chat_model with HuggingFace backend (#34259)

This commit is contained in:
Paul
2025-12-12 20:35:16 +05:30
committed by GitHub
parent 5720dea41b
commit bf6a5eb122
3 changed files with 53 additions and 5 deletions

View File

@@ -405,7 +405,7 @@ def _init_chat_model_helper(
_check_pkg("langchain_huggingface")
from langchain_huggingface import ChatHuggingFace
return ChatHuggingFace(model_id=model, **kwargs)
return ChatHuggingFace.from_model_id(model_id=model, **kwargs)
if model_provider == "groq":
_check_pkg("langchain_groq")
from langchain_groq import ChatGroq