We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 919c406 commit f7f468aCopy full SHA for f7f468a
gguf-py/gguf/vocab.py
@@ -109,8 +109,10 @@ def _try_load_merges_txt(self, path: Path) -> bool:
109
return True
110
111
def _set_special_token(self, typ: str, tid: Any) -> None:
112
- if not isinstance(tid, int) or tid < 0:
+ if not isinstance(tid, int):
113
return
114
+ if tid < 0:
115
+ raise ValueError(f'invalid value for special token type {typ}: {tid}')
116
if self.n_vocab is None or tid < self.n_vocab:
117
if typ in self.special_token_ids:
118
0 commit comments