描述:
deep seek-r1是不支持funciton calling调用,如果想让离线版本支持function calling,那怎么弄呢。

现象:
vllm:0.9.1
2张A6000卡
通过vllm0.9.1发布DeepSeek-R1-Distill-Qwen-32B大语言模型。
vllm serve "/mnt/data/models/DeepSeek-R1-Distill-Qwen-32B" \
--host "0.0.0.0" \
--port 9400 \
--gpu-memory-utilization 0.9 \
--max-model-len 8192 \
--served-model-name "qwen32b" \
--tensor-parallel-size 2
再通过下面代码调用,发现没有返回function call
from openai import OpenAI
import json
import re
base_url = "http://127.0.0.1:9400/v1"
client = OpenAI(api_key="EMPTY", base_url=base_url)
def get_weather(location: str, unit: str):
return f"{location}的气温是27 {unit},晴天。"
tools = [{
"type": "function",
"function": {
"name": "get_weather",
"description": "获取给定位置的当前天气",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "城市和州,例如“北京市海淀区”"},
"unit": {"type": "string", "enum": ["摄氏度", "华氏度"]}
},
"required": ["location", "unit"]
}
}
}]
response = client.chat.completions.create(
model=client.models.list().data[0].id,
messages=[
{"role": "user

最低0.47元/天 解锁文章
9227

被折叠的 条评论
为什么被折叠?



