community[patch]: fix huggingface pydantic 2 init (#26286)

This commit is contained in:
ccurme
2024-09-10 18:15:39 -04:00
committed by GitHub
parent 287911adbc
commit e2c8690e7f
5 changed files with 10 additions and 10 deletions

View File

@@ -120,8 +120,8 @@ class HuggingFaceEndpoint(LLM):
model_kwargs: Dict[str, Any] = Field(default_factory=dict)
"""Holds any model parameters valid for `call` not explicitly specified"""
model: str
client: Any
async_client: Any
client: Any = None
async_client: Any = None
task: Optional[str] = None
"""Task to call the model with.
Should be a task that returns `generated_text` or `summary_text`."""

View File

@@ -43,7 +43,7 @@ class HuggingFaceHub(LLM):
hf = HuggingFaceHub(repo_id="gpt2", huggingfacehub_api_token="my-api-key")
"""
client: Any #: :meta private:
client: Any = None #: :meta private:
repo_id: Optional[str] = None
"""Model name to use.
If not provided, the default model for the chosen task will be used."""