[object Object]

← back to Exo

ignore Qwen models in tokenizers test until bos issue is fixed

68028cc98083625b433831a7be0316669526f265 · 2024-09-19 00:18:21 +0100 · Alex Cheema

Files touched

Diff

commit 68028cc98083625b433831a7be0316669526f265
Author: Alex Cheema <alexcheema123@gmail.com>
Date:   Thu Sep 19 00:18:21 2024 +0100

    ignore Qwen models in tokenizers test until bos issue is fixed
---
 test/test_tokenizers.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/test/test_tokenizers.py b/test/test_tokenizers.py
index d60255ed..93156100 100644
--- a/test/test_tokenizers.py
+++ b/test/test_tokenizers.py
@@ -1,3 +1,5 @@
+import os
+import re
 from transformers import AutoTokenizer, AutoProcessor
 from exo.models import model_base_shards
 
@@ -22,10 +24,10 @@ def test_tokenizer(name, tokenizer, verbose=False):
     strip_tokens = lambda s: s.lstrip(tokenizer.decode([tokenizer.bos_token_id])).rstrip(tokenizer.decode([tokenizer.eos_token_id]))
     assert text == strip_tokens(decoded) == strip_tokens(reconstructed)
 
-ignore = ["TriAiExperiments/SFR-Iterative-DPO-LLaMA-3-70B-R", "mlx-community/DeepSeek-Coder-V2-Lite-Instruct-4bit-mlx", "llava-hf/llava-1.5-7b-hf"]
-models = [shard.model_id for shards in model_base_shards.values() for shard in shards.values() if shard.model_id not in ignore]
+ignore = ["TriAiExperiments/SFR-Iterative-DPO-LLaMA-3-70B-R", "mlx-community/DeepSeek-Coder-V2-Lite-Instruct-4bit-mlx", "llava-hf/llava-1.5-7b-hf", "mlx-community/Qwen*"]
+ignore_pattern = re.compile(r"^(" + "|".join(model.replace("*", ".*") for model in ignore) + r")")
+models = [shard.model_id for shards in model_base_shards.values() for shard in shards.values() if not ignore_pattern.match(shard.model_id)]
 
-import os
 verbose = os.environ.get("VERBOSE", "0").lower() == "1"
 for m in models:
     # TODO: figure out why use_fast=False is giving inconsistent behaviour (no spaces decoding invididual tokens) for Mistral-Large-Instruct-2407-4bit

← dee83e48 add more qwen2.5 models: mlx-community/Qwen2.5-7B-Instruct-4  ·  back to Exo  ·  update twitter handle exolabs_ -> exolabs 311c8197 →