1111
1212import datetime
1313from utils import *
14+ from typing import Literal
1415
1516server : ServerProcess
1617
@@ -23,24 +24,24 @@ def create_server():
2324
2425
2526@pytest .mark .parametrize ("tools" , [None , [], [TEST_TOOL ]])
26- @pytest .mark .parametrize ("template_name,reasoning_budget ,expected_end" , [
27- ("deepseek-ai-DeepSeek-R1-Distill-Qwen-32B" , None , "<think>\n " ),
28- ("deepseek-ai-DeepSeek-R1-Distill-Qwen-32B" , - 1 , "<think>\n " ),
29- ("deepseek-ai-DeepSeek-R1-Distill-Qwen-32B" , 0 , "<think>\n </think>" ),
27+ @pytest .mark .parametrize ("template_name,reasoning ,expected_end" , [
28+ ("deepseek-ai-DeepSeek-R1-Distill-Qwen-32B" , "on" , "<think>\n " ),
29+ ("deepseek-ai-DeepSeek-R1-Distill-Qwen-32B" ,"auto" , "<think>\n " ),
30+ ("deepseek-ai-DeepSeek-R1-Distill-Qwen-32B" , "off" , "<think>\n </think>" ),
3031
31- ("Qwen-Qwen3-0.6B" , - 1 , "<|im_start|>assistant\n " ),
32- ("Qwen-Qwen3-0.6B" , 0 , "<|im_start|>assistant\n <think>\n \n </think>\n \n " ),
32+ ("Qwen-Qwen3-0.6B" ,"auto" , "<|im_start|>assistant\n " ),
33+ ("Qwen-Qwen3-0.6B" , "off" , "<|im_start|>assistant\n <think>\n \n </think>\n \n " ),
3334
34- ("Qwen-QwQ-32B" , - 1 , "<|im_start|>assistant\n <think>\n " ),
35- ("Qwen-QwQ-32B" , 0 , "<|im_start|>assistant\n <think>\n </think>" ),
35+ ("Qwen-QwQ-32B" ,"auto" , "<|im_start|>assistant\n <think>\n " ),
36+ ("Qwen-QwQ-32B" , "off" , "<|im_start|>assistant\n <think>\n </think>" ),
3637
37- ("CohereForAI-c4ai-command-r7b-12-2024-tool_use" , - 1 , "<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" ),
38- ("CohereForAI-c4ai-command-r7b-12-2024-tool_use" , 0 , "<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|><|END_THINKING|>" ),
38+ ("CohereForAI-c4ai-command-r7b-12-2024-tool_use" ,"auto" , "<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" ),
39+ ("CohereForAI-c4ai-command-r7b-12-2024-tool_use" , "off" , "<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|><|END_THINKING|>" ),
3940])
40- def test_reasoning_budget (template_name : str , reasoning_budget : int | None , expected_end : str , tools : list [dict ]):
41+ def test_reasoning (template_name : str , reasoning : Literal [ 'on' , 'off' , 'auto' ] | None , expected_end : str , tools : list [dict ]):
4142 global server
4243 server .jinja = True
43- server .reasoning_budget = reasoning_budget
44+ server .reasoning = reasoning
4445 server .chat_template_file = f'../../../models/templates/{ template_name } .jinja'
4546 server .start ()
4647
0 commit comments