[BUG] Cannot synchronise models from HuggingFace
Description
When transcribing or strating the container I get the following error:
An error occured while synchronizing the model Systran/faster-whisper-small from the Hugging Face Hub:
Cannot find an appropriate cached snapshot folder for the specified revision on the local disk and outgoing traffic has been disabled. To enable repo look-ups and downloads online, pass 'local_files_only=False' as input.
And the transcription fails
To Reproduce
try transcribing a video with any model other than small
Environment
- OS: MacOS Silicon
- Browser: Firefox, Safari, Chrome
I have the same problem:
Trying to load the model directly from the local cache, if it exists. INFO: Started server process [10] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) INFO: Shutting down INFO: Waiting for application shutdown. INFO: Application shutdown complete. INFO: Finished server process [10] An error occured while synchronizing the model Systran/faster-whisper-tiny from the Hugging Face Hub: Cannot find an appropriate cached snapshot folder for the specified revision on the local disk and outgoing traffic has been disabled. To enable repo look-ups and downloads online, pass 'local_files_only=False' as input. Trying to load the model directly from the local cache, if it exists. /usr/local/lib/python3.11/site-packages/huggingface_hub/file_download.py:1204: UserWarning: local_dir_use_symlinks parameter is deprecated and will be ignored. The process to download files to a local folder has been updated and do not rely on symlinks anymore. You only need to pass a destination folder aslocal_dir. For more details, check out https://huggingface.co/docs/huggingface_hub/main/en/guides/download#download-files-to-local-folder. warnings.warn( An error occured while synchronizing the model Systran/faster-whisper-small from the Hugging Face Hub: Cannot find an appropriate cached snapshot folder for the specified revision on the local disk and outgoing traffic has been disabled. To enable repo look-ups and downloads online, pass 'local_files_only=False' as input. Trying to load the model directly from the local cache, if it exists. INFO: Started server process [10] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) An error occured while synchronizing the model Systran/faster-whisper-small from the Hugging Face Hub: Cannot find an appropriate cached snapshot folder for the specified revision on the local disk and outgoing traffic has been disabled. To enable repo look-ups and downloads online, pass 'local_files_only=False' as input. Trying to load the model directly from the local cache, if it exists. An error occured while synchronizing the model Systran/faster-whisper-small from the Hugging Face Hub: Cannot find an appropriate cached snapshot folder for the specified revision on the local disk and outgoing traffic has been disabled. To enable repo look-ups and downloads online, pass 'local_files_only=False' as input. Trying to load the model directly from the local cache, if it exists. An error occured while synchronizing the model Systran/faster-whisper-small from the Hugging Face Hub: Cannot find an appropriate cached snapshot folder for the specified revision on the local disk and outgoing traffic has been disabled. To enable repo look-ups and downloads online, pass 'local_files_only=False' as input. Trying to load the model directly from the local cache, if it exists.
I get this in transcription.err.log.
An error occured while synchronizing the model Systran/faster-whisper-tiny from the Hugging Face Hub:
Cannot find an appropriate cached snapshot folder for the specified revision on the local disk and outgoing traffic has been disabled. To enable repo look-ups and downloads online, pass 'local_files_only=False' as input.
Trying to load the model directly from the local cache, if it exists.
/usr/local/lib/python3.11/site-packages/huggingface_hub/file_download.py:1204: UserWarning: `local_dir_use_symlinks` parameter is deprecated and will be ignored. The process to download files to a local folder has been updated and do not rely on symlinks anymore. You only need to pass a destination folder as`local_dir`.
For more details, check out https://huggingface.co/docs/huggingface_hub/main/en/guides/download#download-files-to-local-folder.
warnings.warn(
An error occured while synchronizing the model Systran/faster-whisper-small from the Hugging Face Hub:
Cannot find an appropriate cached snapshot folder for the specified revision on the local disk and outgoing traffic has been disabled. To enable repo look-ups and downloads online, pass 'local_files_only=False' as input.
Trying to load the model directly from the local cache, if it exists.
INFO: Started server process [10]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
My dir structure looks like this:
.
`-- whishper_data
|-- db_data
| |-- diagnostic.data
| |-- journal
| `-- logs
|-- libretranslate
| |-- cache
| | `-- argos-translate
| `-- data
| `-- argos-translate
|-- logs
`-- uploads
I don't see any versions numbers anywhere. Probably good to have one somewhere in the interface.
ProductName: macOS
ProductVersion: 15.5
BuildVersion: 24F74
Has anyone found a resolution for this? I'm also getting this error and it's very annoying because the documentation as-is does NOT produce a working application.
While manually downloading the models might work, I do not understand where I should put which files.
You can try my PR and see if that fixes it for you. After checking out my branch, you should be able to locally build the Dockerfile then change the docker-compose.yml to your image that you made. Beyond that it should work with the default docker-compose.yaml and .env.example (after renaming it to .env) included in this project
Go into the whisper container, open /app/transcription/backends/fasterwhisper.py, and replace lines 42-46 with:
download_model(self.model_size, output_dir=local_model_path, local_files_only=False, cache_dir=local_model_cache)
You should then be able to open http://localhost:8082/ and start transcription tasks.
Thank you @cinderisles for figuring this out in #169!