Skywork-R1V icon indicating copy to clipboard operation
Skywork-R1V copied to clipboard

VLLM V0.9.2 uses Docker to deploy Skywork/Skywork-R1V3-38B, no<think>in the answer

Open yyworld7 opened this issue 1 year ago • 4 comments

VLLM V0.9.2 uses Docker to deploy Skywork/Skywork-R1V3-38B, noin the answer

yyworld7 avatar Jul 09 '25 14:07 yyworld7

It would be great if you could share reproduction steps or any examples where this issue occurs.

If I understand correctly, the token should appear in the prompt like this:

<|im_start|>system
{system_prompt}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
<think>

This means only should appear in the model’s responses to separate reasoning from the final summary. Is that correct?

fakerbaby avatar Jul 09 '25 16:07 fakerbaby

@fakerbaby Thank you very much for your reply. The following is the supplementary information。 vllm 0.9.2: docker run --rm --runtime=nvidia --gpus '"device=0,1,2,3,4,5,6,7"'
-e CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
-p 8000:8000
-e MODEL=/app/model
-v ~/Downloads/model/Skywork-R1V3-38B:/app/model
-v ~/.cache/huggingface:/root/.cache/huggingface
-v ~/Downloads/model:/app/examples
--ipc=host vllm/vllm-openai:latest
--host 0.0.0.0
--model /app/model
--dtype float16
--trust-remote-code
--served-model-name "Skywork-R1V3-38B"
--tensor-parallel-size 8
--max-num-seqs 4
--gpu-memory-utilization 0.95
--enable-auto-tool-choice
--tool-call-parser hermes
--max-model-len 32768
--limit-mm-per-prompt "image=15"
--disable-log-requests

answer:

************************************************************</think>``***************************

bug: In the answer, there is no"think"before it. Expected answer: <think>************************************************************</think>``***************************

It may be necessary to modify column 271 in tokenizer_config.json: "chat_template": "{%- if tools %}\n {{- '<|im_start|>system\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'FIRST, think through the problem step-by-step. Explain each step clearly, including any relevant concepts or formulas. Reflect on why each step is necessary and check for potential errors. Consider alternative approaches and justify the chosen method. Enclose this entire reasoning process within tags. THEN, provide the final answer enclosed in \boxed{}.' }}\n {%- endif %}\n {{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within XML tags:\n" }}\n {%- for tool in tools %}\n {{- "\n" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- "\n\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": , \"arguments\": }\n</tool_call><|im_end|>\n" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}\n {%- else %}\n {{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}\n {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}\n {%- elif message.role == "assistant" %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content %}\n {{- '\n' + message.content }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\n<tool_call>\n{"name": "' }}\n {{- tool_call.name }}\n {{- '", "arguments": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\n' }}\n {%- elif message.role == "tool" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\n<tool_response>\n' }}\n {{- message.content }}\n {{- '\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}\n {{- '<|im_end|>\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\n\n' }}\n{%- endif %}\n",

yyworld7 avatar Jul 10 '25 01:07 yyworld7

I see, our current implementation doesn't include the token in the front of the response. This is expected behavior, as we follow the QWQ chat-template. We've found that this setup effectively guides thinking content and provides flexibility for switching between slow-thinking and no-thinking modes.

If needed, you could manually add the token in your script when querying the model in streaming mode.

fakerbaby avatar Jul 10 '25 02:07 fakerbaby

hello VLLM V0.9.2 uses k8s to deploy Skywork/Skywork-R1V3-38B, get error

File "/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/openai/api_server.py", line 1431, in run_server await run_server_worker(listen_address, sock, args, **uvicorn_kwargs) File "/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/openai/api_server.py", line 1451, in run_server_worker async with build_async_engine_client(args, client_config) as engine_client: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/contextlib.py", line 210, in aenter return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/openai/api_server.py", line 158, in build_async_engine_client async with build_async_engine_client_from_engine_args( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/contextlib.py", line 210, in aenter return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/openai/api_server.py", line 180, in build_async_engine_client_from_engine_args vllm_config = engine_args.create_engine_config(usage_context=usage_context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/vllm/engine/arg_utils.py", line 1067, in create_engine_config model_config = self.create_model_config() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/vllm/engine/arg_utils.py", line 956, in create_model_config return ModelConfig( ^^^^^^^^^^^^ File "/usr/local/lib/python3.12/dist-packages/pydantic/_internal/_dataclasses.py", line 123, in init s.pydantic_validator.validate_python(ArgsKwargs(args, kwargs), self_instance=s) pydantic_core._pydantic_core.ValidationError: 1 validation error for ModelConfig Value error, limit_mm_per_prompt is only supported for multimodal models. [type=value_error, input_value=ArgsKwargs((), {'model': ...attention_dtype': None}), input_type=ArgsKwargs] For further information visit https://errors.pydantic.dev/2.11/v/value_error

command "vllm","serve","/models/Skywork-R1V3-38B-Q8_0.gguf", "--port", "9000", "--served-model-name", "Skywork-R1V3-38B-Q8", "--tensor-parallel-size", "1", "--max-model-len", "8912", "--max-num-seqs", "8", "--enable-chunked-prefill", "--limit_mm_per_prompt", "image=3", "--enable-prefix-caching",
"--dtype","auto", "--quantization", "gguf", "--gpu-memory-utilization", "0.90"

gguf file from: https://www.modelscope.cn/models/lmstudio-community/Skywork-R1V3-38B-GGUF/resolve/master/Skywork-R1V3-38B-Q6_K.gguf

larioy avatar Jul 10 '25 07:07 larioy