community[patch]: chat model mypy fixes (#17061)

Related to #17048
This commit is contained in:
Bagatur
2024-02-05 13:42:59 -08:00
committed by GitHub
parent d93de71d08
commit 66e45e8ab7
17 changed files with 101 additions and 89 deletions

View File

@@ -44,7 +44,7 @@ class ChatHuggingFace(BaseChatModel):
llm: Union[HuggingFaceTextGenInference, HuggingFaceEndpoint, HuggingFaceHub]
system_message: SystemMessage = SystemMessage(content=DEFAULT_SYSTEM_PROMPT)
tokenizer: Any = None
model_id: str = None # type: ignore
model_id: Optional[str] = None
def __init__(self, **kwargs: Any):
super().__init__(**kwargs)
@@ -144,7 +144,7 @@ class ChatHuggingFace(BaseChatModel):
elif isinstance(self.llm, HuggingFaceHub):
# no need to look up model_id for HuggingFaceHub LLM
self.model_id = self.llm.repo_id # type: ignore[assignment]
self.model_id = self.llm.repo_id
return
else: