From 4fec982325290cfc99ab4ac68dd55c5b2f3e4c80 Mon Sep 17 00:00:00 2001 From: drbh Date: Tue, 16 Apr 2024 16:23:39 +0000 Subject: [PATCH] fix: adjust naming and tests and rebase typo --- clients/python/text_generation/types.py | 2 +- integration-tests/conftest.py | 15 +- ...t_flash_llama_completion_many_prompts.json | 16 +- ..._llama_completion_many_prompts_stream.json | 602 +++++++++--------- ..._flash_llama_completion_single_prompt.json | 4 +- .../models/test_completion_prompts.py | 5 +- router/src/server.rs | 2 +- 7 files changed, 325 insertions(+), 321 deletions(-) diff --git a/clients/python/text_generation/types.py b/clients/python/text_generation/types.py index 5dab1f80..cfa2a9ed 100644 --- a/clients/python/text_generation/types.py +++ b/clients/python/text_generation/types.py @@ -115,7 +115,7 @@ class ChatComplete(BaseModel): usage: Any -class CompletionComplete(BaseModel): +class Completion(BaseModel): # Completion details id: str object: str diff --git a/integration-tests/conftest.py b/integration-tests/conftest.py index 616446ba..cf0f498d 100644 --- a/integration-tests/conftest.py +++ b/integration-tests/conftest.py @@ -27,7 +27,7 @@ from text_generation.types import ( ChatComplete, ChatCompletionChunk, ChatCompletionComplete, - CompletionComplete, + Completion, ) DOCKER_IMAGE = os.getenv("DOCKER_IMAGE", None) @@ -71,17 +71,22 @@ class ResponseComparator(JSONSnapshotExtension): data = json.loads(data) if isinstance(data, Dict) and "choices" in data: choices = data["choices"] - print(choices) if isinstance(choices, List) and len(choices) >= 1: if "delta" in choices[0]: return ChatCompletionChunk(**data) if "text" in choices[0]: - return CompletionComplete(**data) + return Completion(**data) return ChatComplete(**data) if isinstance(data, Dict): return Response(**data) if isinstance(data, List): + if ( + len(data) > 0 + and "object" in data[0] + and data[0]["object"] == "text_completion" + ): + return [Completion(**d) for d in data] return [Response(**d) for d in data] raise NotImplementedError @@ -163,7 +168,7 @@ class ResponseComparator(JSONSnapshotExtension): ) ) - def eq_completion(response: ChatComplete, other: ChatComplete) -> bool: + def eq_completion(response: Completion, other: Completion) -> bool: return response.choices[0].text == other.choices[0].text def eq_chat_complete(response: ChatComplete, other: ChatComplete) -> bool: @@ -189,7 +194,7 @@ class ResponseComparator(JSONSnapshotExtension): if not isinstance(snapshot_data, List): snapshot_data = [snapshot_data] - if isinstance(serialized_data[0], CompletionComplete): + if isinstance(serialized_data[0], Completion): return len(snapshot_data) == len(serialized_data) and all( [eq_completion(r, o) for r, o in zip(serialized_data, snapshot_data)] ) diff --git a/integration-tests/models/__snapshots__/test_completion_prompts/test_flash_llama_completion_many_prompts.json b/integration-tests/models/__snapshots__/test_completion_prompts/test_flash_llama_completion_many_prompts.json index 2d32b332..3fe0a482 100644 --- a/integration-tests/models/__snapshots__/test_completion_prompts/test_flash_llama_completion_many_prompts.json +++ b/integration-tests/models/__snapshots__/test_completion_prompts/test_flash_llama_completion_many_prompts.json @@ -6,12 +6,6 @@ "logprobs": null, "text": " PR for more information?" }, - { - "finish_reason": "length", - "index": 3, - "logprobs": null, - "text": "hd20220811-" - }, { "finish_reason": "length", "index": 0, @@ -23,13 +17,19 @@ "index": 2, "logprobs": null, "text": " severely flawed and often has a substandard" + }, + { + "finish_reason": "length", + "index": 3, + "logprobs": null, + "text": "hd20220811-" } ], - "created": 1712875413, + "created": 1713284455, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native", + "system_fingerprint": "2.0.0-native", "usage": { "completion_tokens": 36, "prompt_tokens": 8, diff --git a/integration-tests/models/__snapshots__/test_completion_prompts/test_flash_llama_completion_many_prompts_stream.json b/integration-tests/models/__snapshots__/test_completion_prompts/test_flash_llama_completion_many_prompts_stream.json index b3e20c30..702d48f4 100644 --- a/integration-tests/models/__snapshots__/test_completion_prompts/test_flash_llama_completion_many_prompts_stream.json +++ b/integration-tests/models/__snapshots__/test_completion_prompts/test_flash_llama_completion_many_prompts_stream.json @@ -8,11 +8,11 @@ "text": "\n" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -23,11 +23,11 @@ "text": "\n" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -38,11 +38,11 @@ "text": "\n" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -53,11 +53,11 @@ "text": "hd" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -65,14 +65,14 @@ "finish_reason": "", "index": 0, "logprobs": null, - "text": "2" + "text": "\n" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -80,14 +80,14 @@ "finish_reason": "", "index": 1, "logprobs": null, - "text": "2" + "text": "\n" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -95,14 +95,14 @@ "finish_reason": "", "index": 2, "logprobs": null, - "text": "2" + "text": "\n" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -110,14 +110,14 @@ "finish_reason": "", "index": 3, "logprobs": null, - "text": "2" + "text": "aho" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -125,14 +125,74 @@ "finish_reason": "", "index": 0, "logprobs": null, - "text": "0" + "text": "2" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 1, + "logprobs": null, + "text": "2" + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 2, + "logprobs": null, + "text": "2" + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 3, + "logprobs": null, + "text": "ima" + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 0, + "logprobs": null, + "text": "." + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -143,11 +203,11 @@ "text": "." } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -158,11 +218,11 @@ "text": "." } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -173,11 +233,11 @@ "text": "\n" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -185,14 +245,14 @@ "finish_reason": "", "index": 0, "logprobs": null, - "text": "." + "text": " Sarah" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -200,14 +260,14 @@ "finish_reason": "", "index": 1, "logprobs": null, - "text": " And" + "text": " Yes" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -218,11 +278,11 @@ "text": " And" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -230,14 +290,14 @@ "finish_reason": "", "index": 3, "logprobs": null, - "text": "def" + "text": "i" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -245,194 +305,14 @@ "finish_reason": "", "index": 0, "logprobs": null, - "text": " What" + "text": "'" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 1, - "logprobs": null, - "text": " away" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 2, - "logprobs": null, - "text": " what" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 3, - "logprobs": null, - "text": " mai" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 0, - "logprobs": null, - "text": " is" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 1, - "logprobs": null, - "text": " we" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 2, - "logprobs": null, - "text": " is" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 3, - "logprobs": null, - "text": "hd" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 0, - "logprobs": null, - "text": " the" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 1, - "logprobs": null, - "text": " go" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 2, - "logprobs": null, - "text": " the" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 3, - "logprobs": null, - "text": "\n" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 0, - "logprobs": null, - "text": " temperature" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -443,11 +323,191 @@ "text": "," } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 2, + "logprobs": null, + "text": " what" + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 3, + "logprobs": null, + "text": "'" + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 0, + "logprobs": null, + "text": "s" + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 1, + "logprobs": null, + "text": " Moh" + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 2, + "logprobs": null, + "text": " is" + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 3, + "logprobs": null, + "text": "m" + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 0, + "logprobs": null, + "text": " Room" + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 1, + "logprobs": null, + "text": "s" + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 2, + "logprobs": null, + "text": " the" + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 3, + "logprobs": null, + "text": " tired" + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 0, + "logprobs": null, + "text": ":" + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" + }, + { + "choices": [ + { + "finish_reason": "", + "index": 1, + "logprobs": null, + "text": "'" + } + ], + "created": 1713284431, + "id": "", + "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", + "object": "text_completion", + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -458,11 +518,11 @@ "text": " capital" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -470,14 +530,14 @@ "finish_reason": "", "index": 3, "logprobs": null, - "text": "\t" + "text": " of" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -485,14 +545,14 @@ "finish_reason": "", "index": 0, "logprobs": null, - "text": " in" + "text": " She" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -500,14 +560,14 @@ "finish_reason": "", "index": 1, "logprobs": null, - "text": " sc" + "text": " scale" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -518,11 +578,11 @@ "text": " of" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" }, { "choices": [ @@ -530,73 +590,13 @@ "finish_reason": "", "index": 3, "logprobs": null, - "text": "p" + "text": " being" } ], - "created": 1713282708, + "created": 1713284431, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 0, - "logprobs": null, - "text": " New" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 1, - "logprobs": null, - "text": "rap" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 2, - "logprobs": null, - "text": " Ukraine" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" - }, - { - "choices": [ - { - "finish_reason": "", - "index": 3, - "logprobs": null, - "text": " text" - } - ], - "created": 1713282708, - "id": "", - "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", - "object": "text_completion", - "system_fingerprint": "1.4.5-native" + "system_fingerprint": "2.0.0-native" } ] diff --git a/integration-tests/models/__snapshots__/test_completion_prompts/test_flash_llama_completion_single_prompt.json b/integration-tests/models/__snapshots__/test_completion_prompts/test_flash_llama_completion_single_prompt.json index 925f7db7..8b001a09 100644 --- a/integration-tests/models/__snapshots__/test_completion_prompts/test_flash_llama_completion_single_prompt.json +++ b/integration-tests/models/__snapshots__/test_completion_prompts/test_flash_llama_completion_single_prompt.json @@ -7,11 +7,11 @@ "text": " PR for flake8" } ], - "created": 1712875413, + "created": 1713284454, "id": "", "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "object": "text_completion", - "system_fingerprint": "1.4.5-native", + "system_fingerprint": "2.0.0-native", "usage": { "completion_tokens": 5, "prompt_tokens": 6, diff --git a/integration-tests/models/test_completion_prompts.py b/integration-tests/models/test_completion_prompts.py index 1d7af0a4..cafa8ea6 100644 --- a/integration-tests/models/test_completion_prompts.py +++ b/integration-tests/models/test_completion_prompts.py @@ -4,7 +4,7 @@ import json from aiohttp import ClientSession from text_generation.types import ( - CompletionComplete, + Completion, ) @@ -101,8 +101,7 @@ async def test_flash_llama_completion_many_prompts_stream( chunk = [json.loads(c) for c in chunk] for c in chunk: - print(c) - chunks.append(CompletionComplete(**c)) + chunks.append(Completion(**c)) assert "choices" in c assert 0 <= c["choices"][0]["index"] <= 4 diff --git a/router/src/server.rs b/router/src/server.rs index 07fbacfc..3b7c8e2e 100644 --- a/router/src/server.rs +++ b/router/src/server.rs @@ -15,7 +15,7 @@ use crate::{ ChatRequest, CompatGenerateRequest, Completion, CompletionComplete, CompletionCompleteChunk, CompletionRequest, DeltaToolCall, Function, Tool, VertexRequest, VertexResponse, }; -use crate::{FunctionDefinition, FunctionRef, FunctionsMap, Properties, ToolCall, ToolType, Tools}; +use crate::{FunctionDefinition, ToolCall, ToolType}; use async_stream::__private::AsyncStream; use axum::extract::Extension; use axum::http::{HeaderMap, Method, StatusCode};