Update tests/snapshots

This commit is contained in:
Daniël de Kok 2024-11-22 16:40:20 +00:00
parent f5e55ad7d9
commit 639dc07088
7 changed files with 37 additions and 36 deletions

View File

@ -1,7 +1,7 @@
{
"choices": [
{
"finish_reason": "eos_token",
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
@ -13,12 +13,12 @@
"function": {
"arguments": {
"format": "celsius",
"location": "Brooklyn"
"location": "Brooklyn, New York"
},
"description": null,
"name": "get_current_weather"
},
"id": 0,
"id": "0",
"type": "function"
}
]
@ -26,14 +26,14 @@
"usage": null
}
],
"created": 1712782670,
"created": 1732293383,
"id": "",
"model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
"object": "text_completion",
"system_fingerprint": "2.0.1-native",
"model": "meta-llama/Llama-3.1-8B-Instruct",
"object": "chat.completion",
"system_fingerprint": "2.4.1-dev0-native",
"usage": {
"completion_tokens": 37,
"prompt_tokens": 524,
"total_tokens": 561
"completion_tokens": 30,
"prompt_tokens": 615,
"total_tokens": 645
}
}

View File

@ -1,7 +1,7 @@
{
"choices": [
{
"finish_reason": "eos_token",
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
@ -13,12 +13,12 @@
"function": {
"arguments": {
"format": "celsius",
"location": "Brooklyn"
"location": "Brooklyn, New York"
},
"description": null,
"name": "get_current_weather"
},
"id": 0,
"id": "0",
"type": "function"
}
]
@ -26,14 +26,14 @@
"usage": null
}
],
"created": 1712787937,
"created": 1732293384,
"id": "",
"model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
"object": "text_completion",
"system_fingerprint": "2.0.1-native",
"model": "meta-llama/Llama-3.1-8B-Instruct",
"object": "chat.completion",
"system_fingerprint": "2.4.1-dev0-native",
"usage": {
"completion_tokens": 37,
"prompt_tokens": 524,
"total_tokens": 561
"completion_tokens": 30,
"prompt_tokens": 615,
"total_tokens": 645
}
}

View File

@ -18,10 +18,10 @@
"logprobs": null
}
],
"created": 1729084854,
"created": 1732293254,
"id": "",
"model": "meta-llama/Llama-3.1-8B-Instruct",
"object": "chat.completion.chunk",
"system_fingerprint": "2.3.2-dev0-native",
"system_fingerprint": "2.4.1-dev0-native",
"usage": null
}

View File

@ -19,10 +19,10 @@
"logprobs": null
}
],
"created": 1729084850,
"created": 1732293246,
"id": "",
"model": "meta-llama/Llama-3.1-8B-Instruct",
"object": "chat.completion.chunk",
"system_fingerprint": "2.3.2-dev0-native",
"system_fingerprint": "2.4.1-dev0-native",
"usage": null
}

View File

@ -6,7 +6,7 @@
"role": "assistant",
"tool_calls": {
"function": {
"arguments": "</s>",
"arguments": "<|eot_id|>",
"name": null
},
"id": "",
@ -14,14 +14,15 @@
"type": "function"
}
},
"finish_reason": "eos_token",
"finish_reason": "stop",
"index": 0,
"logprobs": null
}
],
"created": 1712788218,
"created": 1732293235,
"id": "",
"model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
"object": "text_completion",
"system_fingerprint": "2.0.1-native"
"model": "meta-llama/Llama-3.1-8B-Instruct",
"object": "chat.completion.chunk",
"system_fingerprint": "2.4.1-dev0-native",
"usage": null
}

View File

@ -55,7 +55,7 @@ async def test_grammar_response_format_llama_json(llama_grammar, response_snapsh
called = chat_completion["choices"][0]["message"]["content"]
assert response.status_code == 200
assert called == '{ "temperature": [ 26, 30, 33, 29 ] ,"unit": "Fahrenheit" }'
assert called == '{ "unit": "fahrenheit", "temperature": [ 72, 79, 88 ] }'
assert chat_completion == response_snapshot

View File

@ -101,7 +101,7 @@ async def test_flash_llama_grammar_tools(flash_llama_grammar_tools, response_sna
"function": {
"description": None,
"name": "get_current_weather",
"arguments": {"format": "celsius", "location": "Brooklyn, NY"},
"arguments": {"format": "celsius", "location": "Brooklyn, New York"},
},
}
]
@ -138,7 +138,7 @@ async def test_flash_llama_grammar_tools_auto(
"function": {
"description": None,
"name": "get_current_weather",
"arguments": {"format": "celsius", "location": "Brooklyn, NY"},
"arguments": {"format": "celsius", "location": "Brooklyn, New York"},
},
}
]
@ -219,7 +219,7 @@ async def test_flash_llama_grammar_tools_stream(
assert (
tool_calls_generated
== '{"function": {"_name": "get_current_weather", "format": "celsius", "location": "Paris, France"}}<|eot_id|>'
== '{"function": {"_name": "get_current_weather", "location": "Paris, France", "format": "celsius"}}<|eot_id|>'
)
assert count == 28
assert last_response == response_snapshot
@ -366,7 +366,7 @@ async def test_flash_llama_grammar_tools_sea_creatures_stream_required(
assert count == 29
assert (
tool_calls_generated
== '{"function": {"_name": "get_current_weather", "format": "celsius", "location": "San Francisco, CA"}}<|eot_id|>'
== '{"function": {"_name": "get_current_weather", "location": "San Francisco, CA", "format": "celsius"}}<|eot_id|>'
)
assert last_response == response_snapshot
@ -465,6 +465,6 @@ async def test_flash_llama_grammar_tools_sea_creatures_stream_function_object(
assert count == 39
assert (
tool_calls_generated
== '{"function": {"_name": "get_n_day_weather_forecast", "format": "celsius", "location": "San Francisco, CA", "num_days":3}}<|eot_id|>'
== '{"function": {"_name": "get_n_day_weather_forecast", "location": "San Francisco, CA", "format": "celsius", "num_days":3}}<|eot_id|>'
)
assert last_response == response_snapshot