Skip to content

Commit 6854234

Browse files
committed
update tests
Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
1 parent 13cc6f2 commit 6854234

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

services/uds_tokenizer/tests/test_renderer.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,31 +94,28 @@ def test_render_deterministic(self, grpc_stub, test_model):
9494
"""The same completion request rendered twice produces identical token IDs."""
9595
req = tokenizer_pb2.RenderCompletionRequest(
9696
model_name=test_model,
97-
prompts=["Determinism check."],
97+
prompt="Determinism check.",
9898
)
9999
resp1 = grpc_stub.RenderCompletion(req)
100100
resp2 = grpc_stub.RenderCompletion(req)
101-
assert list(resp1.items[0].token_ids) == list(resp2.items[0].token_ids)
101+
assert list(resp1.token_ids) == list(resp2.token_ids)
102102

103103
def test_render_matches_direct(self, grpc_stub, test_model):
104104
"""RenderCompletion token IDs match a direct RendererService call."""
105-
prompts = ["Hello world", "foo bar"]
105+
prompt = "Hello world"
106106
grpc_resp = grpc_stub.RenderCompletion(
107107
tokenizer_pb2.RenderCompletionRequest(
108108
model_name=test_model,
109-
prompts=prompts,
109+
prompt=prompt,
110110
)
111111
)
112-
assert len(grpc_resp.items) == len(prompts)
113-
for item in grpc_resp.items:
114-
assert item.request_id
112+
assert grpc_resp.request_id
115113

116114
renderer_service = RendererService()
117115
direct = asyncio.run(
118116
renderer_service.render_completion(
119-
CompletionRequest(model=test_model, prompt=prompts),
117+
CompletionRequest(model=test_model, prompt=prompt),
120118
test_model,
121119
)
122120
)
123-
for grpc_item, direct_item in zip(grpc_resp.items, direct):
124-
assert list(grpc_item.token_ids) == list(direct_item.token_ids)
121+
assert list(grpc_resp.token_ids) == list(direct[0].token_ids)

0 commit comments

Comments
 (0)