py : suggest hint for missing vocab size

This commit is contained in:
Georgi Gerganov 2024-01-09 20:44:22 +02:00
parent 90582b7341
commit 7cfcee408d
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

View file

@ -991,7 +991,7 @@ def check_vocab_size(params: Params, vocab: Vocab, pad_vocab: bool = False) -> N
# Handle special case where the model's vocab size is not set
if params.n_vocab == -1:
raise ValueError(
"The model's vocab size is set to -1 in params.json. Please update it manually."
f"The model's vocab size is set to -1 in params.json. Please update it manually. Maybe {vocab.vocab_size}?"
)
# Check for a vocab size mismatch