Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

community[patch]: Fix HuggingFace LLM to not repeat the prompt as part of the result #17363

Closed
wants to merge 8 commits into from
2 changes: 1 addition & 1 deletion libs/community/langchain_community/llms/huggingface_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
response = hf("Tell me a joke.")
"""
_model_kwargs = self.model_kwargs or {}
parameters = {**_model_kwargs, **kwargs}
parameters = {"return_full_text": False, **_model_kwargs, **kwargs, "return_full_text": False}

Check failure on line 130 in libs/community/langchain_community/llms/huggingface_hub.py

View workflow job for this annotation

GitHub Actions / cd libs/community / - / make lint #3.8

Ruff (F601)

langchain_community/llms/huggingface_hub.py:130:77: F601 Dictionary key literal `"return_full_text"` repeated

Check failure on line 130 in libs/community/langchain_community/llms/huggingface_hub.py

View workflow job for this annotation

GitHub Actions / cd libs/community / - / make lint #3.8

Ruff (E501)

langchain_community/llms/huggingface_hub.py:130:89: E501 Line too long (102 > 88)

Check failure on line 130 in libs/community/langchain_community/llms/huggingface_hub.py

View workflow job for this annotation

GitHub Actions / cd libs/community / - / make lint #3.11

Ruff (F601)

langchain_community/llms/huggingface_hub.py:130:77: F601 Dictionary key literal `"return_full_text"` repeated

Check failure on line 130 in libs/community/langchain_community/llms/huggingface_hub.py

View workflow job for this annotation

GitHub Actions / cd libs/community / - / make lint #3.11

Ruff (E501)

langchain_community/llms/huggingface_hub.py:130:89: E501 Line too long (102 > 88)
eyurtsev marked this conversation as resolved.
Show resolved Hide resolved

response = self.client.post(
json={"inputs": prompt, "parameters": parameters}, task=self.task
Expand Down
Loading