From 883dc22d4475c07079abe33bc1d17d303f83e352 Mon Sep 17 00:00:00 2001 From: Robert Date: Sun, 17 Nov 2024 08:35:07 -0800 Subject: [PATCH] Update test-tokenizer-random.py Re-added type declarations --- tests/test-tokenizer-random.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-tokenizer-random.py b/tests/test-tokenizer-random.py index 93da1d21f..7d84ff554 100644 --- a/tests/test-tokenizer-random.py +++ b/tests/test-tokenizer-random.py @@ -423,7 +423,7 @@ def compare_tokenizers(tokenizer1: TokenizerGroundtruth, tokenizer2: TokenizerLl # return -1 # return min(len(ids1), len(ids2)) # Rewritten to use zip() and next() instead of for loop - def find_first_mismatch(ids1, ids2) -> int: + def find_first_mismatch(ids1: Sequence[Any], ids2: Sequence[Any]) -> int: index = next((i for i, (a, b) in enumerate(zip(ids1, ids2)) if a != b), -1) if index < 0 and len(ids1) != len(ids2): index = min(len(ids1), len(ids2))