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

Fixed the following identified issue: #16849

@baskaryan
pull/17075/head
Mohammad Mohtashim 8 months ago committed by GitHub
parent 304f3f5fc1
commit 3c4b24b69a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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:

Loading…
Cancel
Save