Closed wolfherder closed 7 months ago
chat_comp = qianfan.ChatCompletion(model="ERNIE-Bot")
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: partially initialized module 'qianfan' has no attribute 'ChatCompletion' (most likely due to a circular import)
pip install qianfan
pip install qianfan==0.3.5
pip install qianfan==0.3.6
None of them work properly
看看是不是这个代码文件的文件名是qianfan.py
,或者同个文件夹里有这个文件,和 qianfan
包名冲突了所以失败了
是的,谢谢
import os import qianfan
os.environ["QIANFAN_ACCESS_KEY"]="--" os.environ["QIANFAN_SECRET_KEY"]="--"
chat_comp = qianfan.ChatCompletion() resp = chat_comp.do(endpoint="your_custom_endpoint", messages=[{ "role": "user", "content": "你好" }])
partially initialized module 'qianfan' has no attribute 'ChatCompletion' (most likely due to a circular import)
Suggestion:
No response