From 3c4b24b69a5db2bf895a520a52b75f49fbd03ae0 Mon Sep 17 00:00:00 2001 From: Mohammad Mohtashim <45242107+keenborder786@users.noreply.github.com> Date: Tue, 6 Feb 2024 04:34:42 +0500 Subject: [PATCH] community[patch]: Fix the _call of HuggingFaceHub (#16891) Fixed the following identified issue: #16849 @baskaryan --- libs/community/langchain_community/llms/huggingface_hub.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/community/langchain_community/llms/huggingface_hub.py b/libs/community/langchain_community/llms/huggingface_hub.py index f432727773..2d91231775 100644 --- a/libs/community/langchain_community/llms/huggingface_hub.py +++ b/libs/community/langchain_community/llms/huggingface_hub.py @@ -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: