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

[BUG] Unable to call alibaba Qwen models with Open AI provider #1378

Open
wankunde opened this issue May 22, 2024 · 1 comment
Open

[BUG] Unable to call alibaba Qwen models with Open AI provider #1378

wankunde opened this issue May 22, 2024 · 1 comment

Comments

@wankunde
Copy link

Bug Description

Hi, I can call alibaba Qwen model with Open AI python library and curl command.
But I can not call the Qwen model in chatbox.
I don't known how to check the error logs?

Steps to Reproduce

  1. I can call the Qwen model with Open AI python library.
from openai import OpenAI
import os

def get_response():
    client = OpenAI(
        api_key=os.getenv("DASHSCOPE_API_KEY"), # 如果您没有配置环境变量,请在此处用您的API Key进行替换
        base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",  # 填写DashScope SDK的base_url
    )
    completion = client.chat.completions.create(
        model="qwen-plus",
        messages=[{'role': 'system', 'content': 'You are a helpful assistant.'},
                  {'role': 'user', 'content': '你是谁?'}],
        stream=True
        )
    for chunk in completion:
        print(chunk.model_dump_json())

if __name__ == '__main__':
    get_response()
  1. I can call the Qwen model with curl command.
curl https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer xxxxxx' \
  -d '{
  "model": "qwen-turbo",
  "messages": [{"role": "user", "content": "你是谁?"}],
  "temperature": 0.7
}'
  1. I can not call Qwen model in chatbox

Expected Results

Support calling Qwen model with Open AI provider

Actual Results

Query failed:
image

Screenshots

Provider configuration:
image

Desktop (please complete the following information):

  • Operating System: macOS
  • Application Version: 版本1.3.10 (1.3.10)

Additional Context

Nothing

@BlackPool888
Copy link

11版本可以使用
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants