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

Using local model_path from the UI doesn't work. Breaks whisper-writer. #66

Open
GustJc opened this issue Nov 4, 2024 · 0 comments
Open

Comments

@GustJc
Copy link

GustJc commented Nov 4, 2024

Trying to set the mode_path for a local model in the UI breaks whisper-writer (won't start anymore).

The problem is that the dialog options only accepts a ".bin" file.
But after putting the path to the model.bin and restarting whisper-writer...
The program won't start, so you can't even revert and change back the settings from the UI.

Here's the error log. It can't load the model, and closes itself.

Loading model from: D:/unpack/WhisperAI/models/Systran-faster-distil-whisper-medium.en/model.bin
Error initializing WhisperModel: Repo id must be in the form 'repo_name' or 'namespace/repo_name': 'D:/unpack/WhisperAI/models/Systran-faster-distil-whisper-medium.en/model.bin'. Use `repo_type` argument if needed.
Falling back to CPU.
Traceback (most recent call last):
  File "D:\unpack\WhisperAI\whisper-writer\src\transcription.py", line 28, in create_local_model
    model = WhisperModel(model_path,
  File "D:\unpack\WhisperAI\whisper-writer\venv\lib\site-packages\faster_whisper\transcribe.py", line 138, in __init__
    model_path = download_model(
  File "D:\unpack\WhisperAI\whisper-writer\venv\lib\site-packages\faster_whisper\utils.py", line 104, in download_model
    return huggingface_hub.snapshot_download(repo_id, **kwargs)
  File "D:\unpack\WhisperAI\whisper-writer\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 110, in _inner_fn
    validate_repo_id(arg_value)
  File "D:\unpack\WhisperAI\whisper-writer\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 158, in validate_repo_id
    raise HFValidationError(
huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': 'D:/unpack/WhisperAI/models/Systran-faster-distil-whisper-medium.en/model.bin'. Use `repo_type` argument if needed.

Looking at the code, it seems the code expects a FOLDER, and not a bin file.
But the UI doesn't allow to set a folder path, only accepting a .bin file.

To manually fix it:
You can change the config.yaml and manually change the model_path to the folder where the model is.
Now it loads the model properly.

But it's still very bad when changing a settings option can break the ability to start the program.

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