Skip to content

Commit

Permalink
convert : use presence of tokenizer.json to determine StableLM tokeni…
Browse files Browse the repository at this point in the history
…zer loader

It's a less arbitrary heuristic than the vocab size.
  • Loading branch information
compilade committed Jan 21, 2024
1 parent a11f149 commit b7b53a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions convert-hf-to-gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,11 +929,11 @@ def write_tensors(self):

class StableLMModel(Model):
def set_vocab(self):
# StableLM 2 1.6B uses a vocab in a similar format to Qwen's vocab
if self.hparams["vocab_size"] > 100000:
self._set_vocab_qwen()
else:
if (self.dir_model / "tokenizer.json").is_file():
self._set_vocab_gpt2()
else:
# StableLM 2 1.6B uses a vocab in a similar format to Qwen's vocab
self._set_vocab_qwen()

def set_gguf_parameters(self):
hparams = self.hparams
Expand Down

0 comments on commit b7b53a5

Please sign in to comment.