@@ -224,20 +224,20 @@ def test_chat_completion_with_timings_per_token():
224224
225225
226226@pytest .mark .parametrize ("template_name,n_predict,tool,expected_arguments" , [
227- ("meetkai-functionary-medium-v3.1" , 32 , TEST_TOOL , {} ),
228- ("meetkai-functionary-medium-v3.1" , 32 , PYTHON_TOOL , {"code" : " and played all day. \" exclasted her pare" } ),
229- ("meetkai-functionary-medium-v3.2" , 128 , TEST_TOOL , {} ),
230- ("meetkai-functionary-medium-v3.2" , 128 , PYTHON_TOOL , {"code" : "Sure, I cannything," } ),
231- ("NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use" , 128 , TEST_TOOL , {} ),
232- ("NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use" , 128 , PYTHON_TOOL , {"code" : " out the owl cried. Jack said " } ),
233- ("NousResearch-Hermes-3-Llama-3.1-8B-tool_use" , 128 , TEST_TOOL , {} ),
234- ("NousResearch-Hermes-3-Llama-3.1-8B-tool_use" , 128 , PYTHON_TOOL , {"code" : " out the owl cried. Jack said " } ),
235- ("meta-llama-Meta-Llama-3.1-8B-Instruct" , 128 , TEST_TOOL , {} ),
236- ("meta-llama-Meta-Llama-3.1-8B-Instruct" , 128 , PYTHON_TOOL , {"code" : "Let 's feel out cooking fun together," } ),
237- ("meta-llama-Llama-3.2-3B-Instruct" , 128 , TEST_TOOL , {} ),
238- ("meta-llama-Llama-3.2-3B-Instruct" , 128 , PYTHON_TOOL , {"code" : "Well you fight. Peopballs donto cheep and come again." } ),
239- ("mistralai-Mistral-Nemo-Instruct-2407" , 128 , TEST_TOOL , {} ),
240- ("mistralai-Mistral-Nemo-Instruct-2407" , 128 , PYTHON_TOOL , {"code" : "I can cannot count." } ),
227+ ("meetkai-functionary-medium-v3.1" , 32 , TEST_TOOL , {} ),
228+ ("meetkai-functionary-medium-v3.1" , 32 , PYTHON_TOOL , {"code" : ". She was so excited to go to the park and c" } ),
229+ ("meetkai-functionary-medium-v3.2" , 128 , TEST_TOOL , {} ),
230+ ("meetkai-functionary-medium-v3.2" , 128 , PYTHON_TOOL , {"code" : "It's a spector." } ),
231+ ("NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use" , 128 , TEST_TOOL , {} ),
232+ ("NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use" , 128 , PYTHON_TOOL , {"code" : "Yes, you can. " } ),
233+ ("NousResearch-Hermes-3-Llama-3.1-8B-tool_use" , 128 , TEST_TOOL , {} ),
234+ ("NousResearch-Hermes-3-Llama-3.1-8B-tool_use" , 128 , PYTHON_TOOL , {"code" : "Yes, you can. " } ),
235+ ("meta-llama-Meta-Llama-3.1-8B-Instruct" , 128 , TEST_TOOL , {} ),
236+ ("meta-llama-Meta-Llama-3.1-8B-Instruct" , 128 , PYTHON_TOOL , {"code" : "It 's a spector." } ),
237+ ("meta-llama-Llama-3.2-3B-Instruct" , 128 , TEST_TOOL , {} ),
238+ ("meta-llama-Llama-3.2-3B-Instruct" , 128 , PYTHON_TOOL , {"code" : "It's a spectork." } ),
239+ ("mistralai-Mistral-Nemo-Instruct-2407" , 128 , TEST_TOOL , {} ),
240+ ("mistralai-Mistral-Nemo-Instruct-2407" , 128 , PYTHON_TOOL , {"code" : "It's a speciachy!" } ),
241241])
242242def test_completion_with_required_tool (template_name : str , n_predict : int , tool : dict , expected_arguments : dict ):
243243 global server
@@ -254,6 +254,9 @@ def test_completion_with_required_tool(template_name: str, n_predict: int, tool:
254254 "tool_choice" : "required" ,
255255 "tools" : [tool ],
256256 "parallel_tool_calls" : False ,
257+ "temperature" : 0.0 ,
258+ "top_k" : 1 ,
259+ "top_p" : 1.0 ,
257260 })
258261 assert res .status_code == 200 , f"Expected status code 200, got { res .status_code } "
259262 choice = res .body ["choices" ][0 ]
@@ -290,6 +293,9 @@ def test_completion_without_tool_call(template_name: str, n_predict: int, tools:
290293 ],
291294 "tools" : tools if tools else None ,
292295 "tool_choice" : tool_choice ,
296+ "temperature" : 0.0 ,
297+ "top_k" : 1 ,
298+ "top_p" : 1.0 ,
293299 })
294300 assert res .status_code == 200 , f"Expected status code 200, got { res .status_code } "
295301 choice = res .body ["choices" ][0 ]
@@ -339,7 +345,6 @@ def test_hello_world_tool_call(tool: dict, expected_arguments: dict, hf_repo: st
339345 {"role" : "user" , "content" : "say hello world with python" },
340346 ],
341347 "tools" : [tool ],
342- # Greedy sampling
343348 "temperature" : 0.0 ,
344349 "top_k" : 1 ,
345350 "top_p" : 1.0 ,
0 commit comments