yuchenlin commited on
Commit
f47abfa
1 Parent(s): d7b9e0b

rex_size check

Browse files
Files changed (1) hide show
  1. tokenization_rex_qwen2.py +1 -1
tokenization_rex_qwen2.py CHANGED
@@ -43,7 +43,7 @@ class RexQwen2Tokenizer(Qwen2Tokenizer):
43
  # redefine the _tokenize method
44
  def tokenize(self, text):
45
  # find the index for first user query
46
- if self.user_prefix not in text:
47
  # the query is not wrapped with chat template yet
48
  # raise NotImplementedError
49
  return super().tokenize(text)
 
43
  # redefine the _tokenize method
44
  def tokenize(self, text):
45
  # find the index for first user query
46
+ if self.user_prefix not in text or self.rex_size < 1:
47
  # the query is not wrapped with chat template yet
48
  # raise NotImplementedError
49
  return super().tokenize(text)