QwenLM / Qwen

The official repo of Qwen (通义千问) chat & pretrained large language model proposed by Alibaba Cloud.
Apache License 2.0
13.59k stars 1.11k forks source link

[BUG] <title>fastchat + vLLM +OpenAI API 调用qwen模型,数据不需要预先处理吗 #1244

Closed wangyao123456a closed 4 months ago

wangyao123456a commented 4 months ago

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

当前行为 | Current Behavior

官方给出的调用方式为: openai.ChatCompletion.create( model="Qwen-7b-chat", messages=[ {"role": "user", "content": "你好"} ], ) 但是qwen 模型接收的输入格式不应该是这样吗? <|im_start|>user\n你好<|im_end|>\n<|im_start|> 请问vllm+openai 自己实现了预处理还是需要自己处理成这样呢? openai.ChatCompletion.create( model="Qwen-7b-chat", messages=[ {"role": "user", "content": "<|im_start|>user\n你好<|im_end|>\n<|im_start|>"} ], )

期望行为 | Expected Behavior

1

复现方法 | Steps To Reproduce

1

运行环境 | Environment

- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA (`python -c 'import torch; print(torch.version.cuda)'`):

备注 | Anything else?

1

jklj077 commented 4 months ago

Please follow the examples or look into the OpenAI API documentation.

For Qwen1.0, it is FastChat that performs the messages to input sequences conversion. For Qwen1.5, it is vllm that uses the tokenizers in transformers to perform the conversion.