Skip to content

Commit 4d7771b

Browse files
ggerganovngxson
andauthored
tests : improve "tokens" type check
Co-authored-by: Xuan Son Nguyen <[email protected]>
1 parent 8bcfc55 commit 4d7771b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/server/tests/unit/test_completion.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ def test_completion(prompt: str, n_predict: int, re_content: str, n_prompt: int,
2929
assert type(res.body["has_new_line"]) == bool
3030
assert match_regex(re_content, res.body["content"])
3131
if return_tokens:
32-
assert res.body["tokens"] != []
32+
assert len(res.body["tokens"]) > 0
33+
assert all(type(tok) == int for tok in res.body["tokens"])
3334
else:
3435
assert res.body["tokens"] == []
3536

0 commit comments

Comments
 (0)