Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

models/convert-h5-to-ggml.py : FileNotFoundError: [Errno 2] No such file or directory: 'whisper/whisper/assets/mel_filters.npz' #1076

Open
raphael10-collab opened this issue Jan 20, 2025 · 0 comments

Comments

@raphael10-collab
Copy link

raphael10-collab commented Jan 20, 2025

I want to convert this pythorch model : https://huggingface.co/whispy/whisper_italian into ggml model

But when using convert-h5-to-ggml.py I get this error :

(.venv) riccardo@riccardo-HP-Laptop-15-da0xxx:~/Downloads$ python3 ./whisper.cpp/models/convert-h5-to-ggml.py ./whisper_italian/ ./whisper.cpp/ .
Traceback (most recent call last):
  File "/home/riccardo/Downloads/./whisper.cpp/models/convert-h5-to-ggml.py", line 96, in <module>
    with np.load(os.path.join(dir_whisper, "whisper/assets", "mel_filters.npz")) as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/riccardo/Downloads/whisper.cpp/models/.venv/lib/python3.12/site-packages/numpy/lib/_npyio_impl.py", line 451, in load
    fid = stack.enter_context(open(os.fspath(file), "rb"))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'whisper.cpp/whisper/assets/mel_filters.npz'

I tried also with the ./models/README example but the same error:

(.venv) riccardo@riccardo-HP-Laptop-15-da0xxx:~/Downloads$ git clone https://huggingface.co/openai/whisper-medium
Cloning into 'whisper-medium'...
remote: Enumerating objects: 175, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 175 (delta 1), reused 0 (delta 0), pack-reused 169 (from 1)
Receiving objects: 100% (175/175), 2.88 MiB | 6.30 MiB/s, done.
Resolving deltas: 100% (102/102), done.
Filtering content: 100% (4/4), 11.38 GiB | 80.20 MiB/s, done.



(.venv) riccardo@riccardo-HP-Laptop-15-da0xxx:~/Downloads$ python3 ./whisper.cpp/models/convert-h5-to-ggml.py ./whisper-medium/ ./whisper .
Traceback (most recent call last):
  File "/home/riccardo/Downloads/./whisper.cpp/models/convert-h5-to-ggml.py", line 96, in <module>
    with np.load(os.path.join(dir_whisper, "whisper/assets", "mel_filters.npz")) as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/riccardo/Downloads/whisper.cpp/models/.venv/lib/python3.12/site-packages/numpy/lib/_npyio_impl.py", line 451, in load
    fid = stack.enter_context(open(os.fspath(file), "rb"))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'whisper/whisper/assets/mel_filters.npz'

How to make it work?

And for https://huggingface.co/jonatasgrosman/wav2vec2-large-xlsr-53-italian :

(.venv) raphy@raohy:~/whisper.cpp/models/models--sapienzanlp--Minerva-7B-instruct-v1.0$ ../../../llama.cpp/convert_hf_to_gguf.py . --outfile minerva.gguff  --outtype f16
INFO:hf-to-gguf:Loading model: 
Traceback (most recent call last):
  File "/home/raphy/whisper.cpp/models/models--sapienzanlp--Minerva-7B-instruct-v1.0/../../../llama.cpp/convert_hf_to_gguf.py", line 5140, in <module>
    main()
  File "/home/raphy/whisper.cpp/models/models--sapienzanlp--Minerva-7B-instruct-v1.0/../../../llama.cpp/convert_hf_to_gguf.py", line 5108, in main
    hparams = Model.load_hparams(dir_model)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raphy/whisper.cpp/models/models--sapienzanlp--Minerva-7B-instruct-v1.0/../../../llama.cpp/convert_hf_to_gguf.py", line 468, in load_hparams
    with open(dir_model / "config.json", "r", encoding="utf-8") as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'config.json'

Can someone explain me how to correctly use these converters ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant