diff --git a/examples/server/tests/unit/test_chat_completion.py b/examples/server/tests/unit/test_chat_completion.py index ce94398d6..0fa1a17c1 100644 --- a/examples/server/tests/unit/test_chat_completion.py +++ b/examples/server/tests/unit/test_chat_completion.py @@ -186,7 +186,7 @@ def test_logprobs(): for token in res.choices[0].logprobs.content: aggregated_text += token.token assert token.logprob <= 0.0 - assert token.bytes is not None and len(token.bytes) > 0 + assert token.bytes is not None assert len(token.top_logprobs) > 0 assert aggregated_text == output_text @@ -219,7 +219,7 @@ def test_logprobs_stream(): for token in choice.logprobs.content: aggregated_text += token.token assert token.logprob <= 0.0 - assert token.bytes is not None and len(token.bytes) > 0 + assert token.bytes is not None assert token.top_logprobs is not None assert len(token.top_logprobs) > 0 assert aggregated_text == output_text diff --git a/examples/server/tests/unit/test_completion.py b/examples/server/tests/unit/test_completion.py index 9e91c5da2..7b33ec531 100644 --- a/examples/server/tests/unit/test_completion.py +++ b/examples/server/tests/unit/test_completion.py @@ -263,13 +263,13 @@ def test_n_probs(): assert "id" in tok and tok["id"] > 0 assert "token" in tok and type(tok["token"]) == str assert "logprob" in tok and tok["logprob"] <= 0.0 - assert "bytes" in tok and len(tok["bytes"]) > 0 + assert "bytes" in tok and type(tok["bytes"]) == list assert len(tok["top_logprobs"]) == 10 for prob in tok["top_logprobs"]: assert "id" in prob and prob["id"] > 0 assert "token" in prob and type(prob["token"]) == str assert "logprob" in prob and prob["logprob"] <= 0.0 - assert "bytes" in prob and len(prob["bytes"]) > 0 + assert "bytes" in prob and type(prob["bytes"]) == list def test_n_probs_stream(): @@ -290,10 +290,10 @@ def test_n_probs_stream(): assert "id" in tok and tok["id"] > 0 assert "token" in tok and type(tok["token"]) == str assert "logprob" in tok and tok["logprob"] <= 0.0 - assert "bytes" in tok and len(tok["bytes"]) > 0 + assert "bytes" in tok and type(tok["bytes"]) == list assert len(tok["top_logprobs"]) == 10 for prob in tok["top_logprobs"]: assert "id" in prob and prob["id"] > 0 assert "token" in prob and type(prob["token"]) == str assert "logprob" in prob and prob["logprob"] <= 0.0 - assert "bytes" in prob and len(prob["bytes"]) > 0 + assert "bytes" in prob and type(prob["bytes"]) == list