LianjiaTech / BELLE

BELLE: Be Everyone's Large Language model Engine(开源中文对话大模型)
Apache License 2.0
7.95k stars 761 forks source link

expect 'max_length' in BELLE-2/Belle-whisper-large-v3-zh/config.json when converting to ggml #585

Open XUJiahua opened 6 months ago

XUJiahua commented 6 months ago

reproduce the error:

git clone https://github.com/openai/whisper
git clone https://github.com/ggerganov/whisper.cpp
git clone https://huggingface.co/BELLE-2/Belle-whisper-large-v3-zh

python whisper.cpp/models/convert-h5-to-ggml.py ./Belle-whisper-large-v3-zh ./whisper .

Traceback (most recent call last):
  File "/Users/jiahua/projects/asr/whisper.cpp/models/convert-h5-to-ggml.py", line 115, in <module>
    fout.write(struct.pack("i", hparams["max_length"]))
                                ~~~~~~~^^^^^^^^^^^^^^
KeyError: 'max_length'
cyp0633 commented 4 months ago

I added the value from whisper-large-v3,

{
  ...
  "max_length": 448,
  ...
}

to config.json. It worked.