mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-24 15:43:54 +00:00
community[patch]: Fix the _call of HuggingFaceHub (#16891)
Fixed the following identified issue: #16849 @baskaryan
This commit is contained in:
parent
304f3f5fc1
commit
3c4b24b69a
@ -127,10 +127,10 @@ class HuggingFaceHub(LLM):
|
|||||||
response = hf("Tell me a joke.")
|
response = hf("Tell me a joke.")
|
||||||
"""
|
"""
|
||||||
_model_kwargs = self.model_kwargs or {}
|
_model_kwargs = self.model_kwargs or {}
|
||||||
params = {**_model_kwargs, **kwargs}
|
parameters = {**_model_kwargs, **kwargs}
|
||||||
|
|
||||||
response = self.client.post(
|
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())
|
response = json.loads(response.decode())
|
||||||
if "error" in response:
|
if "error" in response:
|
||||||
|
Loading…
Reference in New Issue
Block a user