mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 12:24:53 +00:00
fix: update tests for new behavior
This commit is contained in:
parent
a62e30462b
commit
c7b4cd318f
@ -2,13 +2,19 @@
|
|||||||
"choices": [
|
"choices": [
|
||||||
{
|
{
|
||||||
"finish_reason": "eos_token",
|
"finish_reason": "eos_token",
|
||||||
"index": 0,
|
"index": 1,
|
||||||
"logprobs": null,
|
"logprobs": null,
|
||||||
"text": " PR for more information?"
|
"text": " PR for more information?"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"finish_reason": "length",
|
"finish_reason": "length",
|
||||||
"index": 1,
|
"index": 3,
|
||||||
|
"logprobs": null,
|
||||||
|
"text": "hd20220811-"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"finish_reason": "length",
|
||||||
|
"index": 0,
|
||||||
"logprobs": null,
|
"logprobs": null,
|
||||||
"text": "le Business Incubator is providing a workspace"
|
"text": "le Business Incubator is providing a workspace"
|
||||||
},
|
},
|
||||||
@ -16,29 +22,17 @@
|
|||||||
"finish_reason": "length",
|
"finish_reason": "length",
|
||||||
"index": 2,
|
"index": 2,
|
||||||
"logprobs": null,
|
"logprobs": null,
|
||||||
"text": "hd20220811-"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"finish_reason": "length",
|
|
||||||
"index": 3,
|
|
||||||
"logprobs": null,
|
|
||||||
"text": " severely flawed and often has a substandard"
|
"text": " severely flawed and often has a substandard"
|
||||||
},
|
|
||||||
{
|
|
||||||
"finish_reason": "length",
|
|
||||||
"index": 4,
|
|
||||||
"logprobs": null,
|
|
||||||
"text": "](https://i.imgur.com/as"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"created": 1712862968,
|
"created": 1712875413,
|
||||||
"id": "",
|
"id": "",
|
||||||
"model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
|
"model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
|
||||||
"object": "text_completion",
|
"object": "text_completion",
|
||||||
"system_fingerprint": "1.4.5-native",
|
"system_fingerprint": "1.4.5-native",
|
||||||
"usage": {
|
"usage": {
|
||||||
"completion_tokens": 46,
|
"completion_tokens": 36,
|
||||||
"prompt_tokens": 10,
|
"prompt_tokens": 8,
|
||||||
"total_tokens": 56
|
"total_tokens": 44
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
"<ClientResponse(http://localhost:9483/v1/completions) [200 OK]>\n<CIMultiDictProxy('Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache', 'x-compute-type': '1-nvidia-a10g', 'x-compute-characters': '72', 'x-accel-buffering': 'no', 'Access-Control-Allow-Origin': '*', 'Vary': 'origin', 'Vary': 'access-control-request-method', 'Vary': 'access-control-request-headers', 'Transfer-Encoding': 'chunked', 'Date': 'Thu, 11 Apr 2024 19:19:32 GMT')>\n"
|
"<ClientResponse(http://localhost:8041/v1/completions) [200 OK]>\n<CIMultiDictProxy('Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache', 'x-compute-type': '1-nvidia-a10g', 'x-compute-characters': '72', 'x-accel-buffering': 'no', 'Access-Control-Allow-Origin': '*', 'Vary': 'origin', 'Vary': 'access-control-request-method', 'Vary': 'access-control-request-headers', 'Transfer-Encoding': 'chunked', 'Date': 'Thu, 11 Apr 2024 22:43:33 GMT')>\n"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"text": " PR for flake8"
|
"text": " PR for flake8"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"created": 1712862926,
|
"created": 1712875413,
|
||||||
"id": "",
|
"id": "",
|
||||||
"model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
|
"model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
|
||||||
"object": "text_completion",
|
"object": "text_completion",
|
||||||
|
@ -47,7 +47,7 @@ def test_flash_llama_completion_many_prompts(flash_llama_completion, response_sn
|
|||||||
f"{flash_llama_completion.base_url}/v1/completions",
|
f"{flash_llama_completion.base_url}/v1/completions",
|
||||||
json={
|
json={
|
||||||
"model": "tgi",
|
"model": "tgi",
|
||||||
"prompt": ["Say", "this", "is", "a", "test"],
|
"prompt": ["Say", "this", "is", "a"],
|
||||||
"max_tokens": 10,
|
"max_tokens": 10,
|
||||||
"seed": 0,
|
"seed": 0,
|
||||||
},
|
},
|
||||||
@ -55,11 +55,11 @@ def test_flash_llama_completion_many_prompts(flash_llama_completion, response_sn
|
|||||||
stream=False,
|
stream=False,
|
||||||
)
|
)
|
||||||
response = response.json()
|
response = response.json()
|
||||||
assert len(response["choices"]) == 5
|
assert len(response["choices"]) == 4
|
||||||
|
|
||||||
all_indexes = [choice["index"] for choice in response["choices"]]
|
all_indexes = [choice["index"] for choice in response["choices"]]
|
||||||
all_indexes.sort()
|
all_indexes.sort()
|
||||||
assert all_indexes == [0, 1, 2, 3, 4]
|
assert all_indexes == [0, 1, 2, 3]
|
||||||
|
|
||||||
response == response_snapshot
|
response == response_snapshot
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user