ms-swift
ms-swift copied to clipboard
使用vllm_engine推理时,能不能用openai格式数据?
swift 的 vllm_engine 推理,query 数据 长这样:
{'query': query}
openai api格式数据 (有system):
{
"role": "system",
"content": "You are a mathematical assistant. Please answer the following mathematical question."
},
{
"role": "user",
"content": "Two fair 6-sided dice are rolled. What is the probability the sum rolled is 9?\nPlease think step by step, and put your final answer within \\boxed{}."
}
我的问题是:
- 如何在swift vllm engine 的对话里加上 system role?
- 能否直接使用openai api格式数据在swift vllm engine上推理?
请等待ms-swift==3.0
已支持,https://github.com/modelscope/ms-swift/blob/main/examples/infer/demo.py