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

Offline Model Loading Issue and Feature Request #494

Open
grizzlycode opened this issue Feb 5, 2025 · 4 comments
Open

Offline Model Loading Issue and Feature Request #494

grizzlycode opened this issue Feb 5, 2025 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@grizzlycode
Copy link

I'm encountering a problem loading a Hugging Face model offline, even though I've manually transferred the model files. My setup is:

OS: Windows 11
Docker Desktop

Due to network restrictions in my environment, I can't directly access Hugging Face. I've copied the model files (Systran/faster-distil-whisper-small.en) from another installation, maintaining the same directory structure.

Despite this, the application log (below) shows it's still attempting to connect to Hugging Face before checking the local cache. This seems counterintuitive. If the model files are present locally, shouldn't it prioritize loading from the cache and only attempt a connection if the model isn't found?

Furthermore, even though the log indicates it's trying to load from the local cache, it doesn't appear to be successful. The UI displays "Initializing Model," runs for a while, and eventually shows "error" in the Output/Downloaded file sections. The log, however, just shows the connection error and the subsequent attempt to load from cache, without any further output indicating success or failure in loading the local files. I've double-checked the directory structure, and it's identical to the working installation. Am I missing something in the model transfer process? How can I ensure the application correctly identifies and loads the locally stored model?

Ideally, I'd like to be able to run the application completely offline, managing model downloads manually.

Finally, I have a feature request: Would it be possible to add a "Stop" button to interrupt processing if needed?

A separate issue I notice .m4a files don't work I have to use MP3 for audio files.

Use "faster-whisper" implementation
Device "cuda" is detected
* Running on local URL: http://0.0.0.0:7860
To create a public link, set `share=True` in `launch()`.
An error occured while synchronizing the model Systran/faster-distil-whisper-small.en from the Hugging Face Hub:
(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/Systran/faster-distil-whisper-small.en/re vision/main (Caused by SSLErгог (SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (ssl.c:992)')))"), '(Request ID: a9cb2630-c2f9-4aa4-ab0f-ace2371919a9)') 

Trying to load the model directly from the local cache, if it exists.
@grizzlycode grizzlycode added the bug Something isn't working label Feb 5, 2025
@jhj0517
Copy link
Owner

jhj0517 commented Feb 6, 2025

Hi.
This is an example of the model directory structure you should have in models/Whisper/faster-whisper:

Image

Then the directory name faster-whisper-large-v3-turbo ( or whatever you named the directory ) should appear in the models drop-down list, which you can use locally.

Systran/faster-distil-whisper-small.en

/ cannot be used in a directory name. I guess you probably entered huggignface's repository id in the models dropdown, so it tried to download the model from huggignface.

Regarding the m4a file, it should now be fixed in #493. Please let me know if the file still doesn't work with the latest update.

@grizzlycode
Copy link
Author

m4a File Issue Resolved, Offline Model Loading Still Problematic

The m4a file issue appears to be resolved with the fix in PR #493 Thank you!

However, I'm still encountering problems loading models for offline use.

Initially, I copied the model files from a working installation on another machine. This installation had a different directory structure (blobs, refs, snapshots). I then cloned the individual models and placed them in the directory as specified in your response. I don't have the .ipynb_checkpoints folder; is this created upon successful model initialization?

After manually selecting a downloaded model from the dropdown menu, the application displays "initializing model" and then hangs indefinitely, freezing my WSL instance. I have to kill and restart WSL to regain control. Any ideas what might be causing this?

@jhj0517
Copy link
Owner

jhj0517 commented Feb 7, 2025

blobs, refs, snapshots

This structure is huggingface's model caching system. The structure indicates that you may have previously tried to download model files using huggingface's API. And probably the model files are not fully downloaded.

Remove the directory ( the model directory name is probably something like models--Systran--faster-distil ).
And download the model files to your new specific directory name.

If you want to use Systran/faster-distil-whisper-small.en,
Download the model files from the link and place the files below this structure:

Whisper-WebUI
└── models
  └── Whisper
      └── faster-whisper
          └── directory-name-you-want-for-model
              ├── model1.bin
              ├── config.json
              ├── preprocessor_config.json
              ├── tokenizer.json
              └── vocabulary.json

@mekler22
Copy link

mekler22 commented Feb 15, 2025

I followed all the structure advice, and I still cannot see the model I placed in faster-whisper folder. (I placed ivrit-ai/faster-whisper-v2-d4 there). I have reloaded the page, restarted the container. the log says:

2025-02-15T02:53:43.630713450Z INFO:faster_whisper:Processing audio with duration 03:34.925
2025-02-15T03:04:59.030429540Z Use "faster-whisper" implementation
2025-02-15T03:04:59.030703414Z Device "cuda" is detected
2025-02-15T03:04:59.636920670Z * Running on local URL: http://0.0.0.0:7861
2025-02-15T03:04:59.806828977Z
2025-02-15T03:04:59.806860055Z To create a public link, set share=True in launch().
2025-02-15T03:07:52.668948772Z Use "faster-whisper" implementation
2025-02-15T03:07:52.669235846Z Device "cuda" is detected
2025-02-15T03:07:53.282372008Z * Running on local URL: http://0.0.0.0:7861
2025-02-15T03:07:53.423565939Z
2025-02-15T03:07:53.423617603Z To create a public link, set share=True in launch().

And the screen shows this list, without the model I placed:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants