Replies: 1 comment
|
whisper.cpp does not support extra tokens at the end of the vocabulary. This is the cause of the illegible output. Why it failswhisper.cpp does not read the IDs of the special tokens from the model. It calculates them from bool is_multilingual() const {
return n_vocab >= 51865;
}
int num_languages() const {
return n_vocab - 51765 - (is_multilingual() ? 1 : 0);
}Then it moves all task and timestamp tokens by a delta: const int dt = vocab.num_languages() - 98;
vocab.token_translate += dt;
vocab.token_transcribe += dt;
vocab.token_solm += dt;
vocab.token_prev += dt;
vocab.token_nosp += dt;
vocab.token_not += dt;
vocab.token_beg += dt;
fout.write(struct.pack("i", hparams["vocab_size"]))Thus
Two things then go wrong:
The result is illegible text. How to confirm thisLook at the model load log. Find the What to doYou have two options. Option 1 — keep the vocabulary size (recommended). Do not call Option 2 — change whisper.cpp. Give |
Uh oh!
There was an error while loading. Please reload this page.
Hello!
I have fine-tuned whisper small via. transformers and I want to use with whisper.cpp. It has extra tokens added with
tokenizer.add_tokens()andmodel.resize_token_embeddings()that are tags outputted alongside speech. Testing it on transformers shows that it works.Currently generating the model with
python models/convert-h5-to-ggml.py safetensors_export_dir ./whisper ./out_modeland testing the ggml bin file on a test audio file produces illegible results.Is there something I'm missing in this process or are additional tokens currently not supported?
Thanks.
All reactions