Skip to content

Commit

Permalink
Fix remainder handling in chunking test
Browse files Browse the repository at this point in the history
Signed-off-by: Alex-Brooks <[email protected]>
  • Loading branch information
alex-jw-brooks committed Sep 29, 2023
1 parent 511e561 commit ccd9c13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/resources/test_pretrained_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ def test_causal_lm_tok_output_correctness(models_cache_dir, chunk_size, drop_rem
has_remainder = False
if len(concat_tok) > chunk_size:
num_expected_chunks = len(concat_tok) // chunk_size
if num_expected_chunks * chunk_size != len(concat_tok):
# Should only care about the remainder if we are not dropping it
if num_expected_chunks * chunk_size != len(concat_tok) and not drop_remainder:
has_remainder = True
else:
num_expected_chunks = 1
Expand Down

0 comments on commit ccd9c13

Please sign in to comment.