community[patch]: Fix the _call of HuggingFaceHub (#16891)

Fixed the following identified issue: #16849

@baskaryan
This commit is contained in:
Mohammad Mohtashim 2024-02-06 04:34:42 +05:00 committed by GitHub
parent 304f3f5fc1
commit 3c4b24b69a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -127,10 +127,10 @@ class HuggingFaceHub(LLM):
response = hf("Tell me a joke.")
"""
_model_kwargs = self.model_kwargs or {}
params = {**_model_kwargs, **kwargs}
parameters = {**_model_kwargs, **kwargs}
response = self.client.post(
json={"inputs": prompt, "params": params}, task=self.task
json={"inputs": prompt, "parameters": parameters}, task=self.task
)
response = json.loads(response.decode())
if "error" in response: