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

langchain_community.chat_models.hunyuan.ChatHunyuan do not work #22107

Open
5 tasks done
uniqueSkeeter opened this issue May 24, 2024 · 4 comments
Open
5 tasks done

langchain_community.chat_models.hunyuan.ChatHunyuan do not work #22107

uniqueSkeeter opened this issue May 24, 2024 · 4 comments
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@uniqueSkeeter
Copy link

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

tencent_llm_resp = TENCENT_LLM.invoke("你好,你是谁")
print("TENCENT_LLM example", tencent_llm_resp)

Error Message and Stack Trace (if applicable)

C:\Users\w00012491\PycharmProjects\pythonProject\pythonProject\QianFanRobot.venv\Scripts\python.exe C:\Users\w00012491\PycharmProjects\pythonProject\pythonProject\QianFanRobot\IASA\tests\test_models.py
Traceback (most recent call last):
File "C:\Users\w00012491\PycharmProjects\pythonProject\pythonProject\QianFanRobot.venv\Lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\w00012491\AppData\Local\Programs\Python\Python312\Lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\w00012491\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\w00012491\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\w00012491\PycharmProjects\pythonProject\pythonProject\QianFanRobot\IASA\tests\test_models.py", line 35, in
tencent_llm_resp = TENCENT_LLM.invoke("你好,你是谁")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\w00012491\PycharmProjects\pythonProject\pythonProject\QianFanRobot.venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 170, in invoke
self.generate_prompt(
File "C:\Users\w00012491\PycharmProjects\pythonProject\pythonProject\QianFanRobot.venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 599, in generate_prompt
return self.generate(prompt_messages, stop=stop, callbacks=callbacks, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\w00012491\PycharmProjects\pythonProject\pythonProject\QianFanRobot.venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 456, in generate
raise e
File "C:\Users\w00012491\PycharmProjects\pythonProject\pythonProject\QianFanRobot.venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 446, in generate
self._generate_with_cache(
File "C:\Users\w00012491\PycharmProjects\pythonProject\pythonProject\QianFanRobot.venv\Lib\site-packages\langchain_core\language_models\chat_models.py", line 671, in _generate_with_cache
result = self._generate(
^^^^^^^^^^^^^^^
File "C:\Users\w00012491\PycharmProjects\pythonProject\pythonProject\QianFanRobot.venv\Lib\site-packages\langchain_community\chat_models\hunyuan.py", line 251, in _generate
response = res.json()
^^^^^^^^^^
File "C:\Users\w00012491\PycharmProjects\pythonProject\pythonProject\QianFanRobot.venv\Lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Description

hi guys, langchain_community.chat_models.hunyuan.ChatHunyuan do not work. anyone know why?
截图

System Info

截图3

@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label May 24, 2024
@shelltea
Copy link

Encountering the same problem, is there any solution?

@shelltea
Copy link

I found a temporary solution, using hunyuan.py

Replace the current version with this file.

@uniqueSkeeter
Copy link
Author

@shelltea How did you solve it?

@shelltea
Copy link

@uniqueSkeeter

  1. Download this file
  2. from hunyuan import ChatHunyuan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants