Unverified Commit 2b1e2111 authored by Lu Fang's avatar Lu Fang Committed by GitHub
Browse files

Fix test_max_model_len in tests/entrypoints/llm/test_generate.py (#19451)


Signed-off-by: default avatarLu Fang <lufang@fb.com>
parent a45b979d
...@@ -125,4 +125,7 @@ def test_max_model_len(): ...@@ -125,4 +125,7 @@ def test_max_model_len():
for output in outputs: for output in outputs:
num_total_tokens = len(output.prompt_token_ids) + len( num_total_tokens = len(output.prompt_token_ids) + len(
output.outputs[0].token_ids) output.outputs[0].token_ids)
assert num_total_tokens == max_model_len # Total tokens must not exceed max_model_len.
# It can be less if generation finishes due to other reasons (e.g., EOS)
# before reaching the absolute model length limit.
assert num_total_tokens <= max_model_len
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment