本地启动这个app.py出错

#6
by Moses25 - opened

dashscope.api_key = "EMPTY"
messages=[{"role":'user',"content":"你好"}]
gen = Generation.call(
model = "/root/worksapce/Qwen1.5-72B-Chat",
messages=messages,
result_format='message',
stream=True
)

from http import HTTPStatus
for response in gen:

# if response.status_code == HTTPStatus.OK:
role = response.output.choices[0].message.role
response = response.output.choices[0].message.content
    # system, history = messages_to_history(messages + [{'role': role, 'content': response}])
print(response)

error
AttributeError: 'NoneType' object has no attribute 'choices'

这个错误是什么原因引起的?是dashscope加载模型的路径不对么?

Qwen org

DashScope is a cloud inference API service by Alibaba Cloud. It is not possible to use local models.

Moses25 changed discussion status to closed

Sign up or log in to comment