mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-12 04:44:52 +00:00
fix: expect content in test
This commit is contained in:
parent
6def99d61b
commit
2abcc8ea0b
@ -1,38 +1,26 @@
|
|||||||
{
|
{
|
||||||
"choices": [
|
"choices": [
|
||||||
{
|
{
|
||||||
"finish_reason": "eos_token",
|
"finish_reason": "stop",
|
||||||
"index": 0,
|
"index": 0,
|
||||||
"logprobs": null,
|
"logprobs": null,
|
||||||
"message": {
|
"message": {
|
||||||
"content": null,
|
"content": "There is no weather related function available to answer your prompt.",
|
||||||
"name": null,
|
"name": null,
|
||||||
"role": "assistant",
|
"role": "assistant",
|
||||||
"tool_calls": [
|
"tool_calls": null
|
||||||
{
|
|
||||||
"function": {
|
|
||||||
"arguments": {
|
|
||||||
"error": "Cannot get current weather forecast from specified location and temperature unit. Please try again with different options."
|
|
||||||
},
|
|
||||||
"description": null,
|
|
||||||
"name": "notify_error"
|
|
||||||
},
|
|
||||||
"id": 0,
|
|
||||||
"type": "function"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"usage": null
|
"usage": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"created": 1712852597,
|
"created": 1728306098,
|
||||||
"id": "",
|
"id": "",
|
||||||
"model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
|
"model": "meta-llama/Llama-3.1-8B-Instruct",
|
||||||
"object": "text_completion",
|
"object": "chat.completion",
|
||||||
"system_fingerprint": "1.4.5-native",
|
"system_fingerprint": "2.3.2-dev0-native",
|
||||||
"usage": {
|
"usage": {
|
||||||
"completion_tokens": 39,
|
"completion_tokens": 29,
|
||||||
"prompt_tokens": 496,
|
"prompt_tokens": 616,
|
||||||
"total_tokens": 535
|
"total_tokens": 645
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,8 +237,10 @@ async def test_flash_llama_grammar_tools_insufficient_information(
|
|||||||
stream=False,
|
stream=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
assert responses.choices[0].message.content is None
|
assert responses.choices[0].message.tool_calls == None
|
||||||
assert (
|
assert (
|
||||||
responses.choices[0].message.tool_calls[0]["function"]["name"] == "notify_error"
|
responses.choices[0].message.content
|
||||||
|
== "There is no weather related function available to answer your prompt."
|
||||||
)
|
)
|
||||||
|
|
||||||
assert responses == response_snapshot
|
assert responses == response_snapshot
|
||||||
|
Loading…
Reference in New Issue
Block a user