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

[BUG] Offline does not work #125

Open
IgNoras opened this issue Dec 18, 2024 · 1 comment
Open

[BUG] Offline does not work #125

IgNoras opened this issue Dec 18, 2024 · 1 comment

Comments

@IgNoras
Copy link

IgNoras commented Dec 18, 2024

Description

Thank you for the product! I have plenty of ideas for implementation, but only in an offline version. Unfortunately, when the internet is disconnected, the container tries to reach "https://registry-1.docker.io/v2/" and won't start anymore. How can I fix this issue?
Thanks in advance!

Environment

  • OS: Ubuntu 24, Debian 12
  • Browser: Firefox
  • Hosting: Local

P.S.: I'm willing to donate for a solution to this problem.

@speedy-rb
Copy link

speedy-rb commented Mar 28, 2025

For your specific issue you just need to modify the docker-compose.yml file.

Change pull_policy: always to pull_policy: missing under the whisper configuration.

This assumes you already have the container images on your machine.

But if you want to run whishper offline there are a few more things you need to do.

First you need to make some changes to your docker-compose.yml (on top of changing pull_policy to missing).

  1. Change the volumes under the translate image from
- ./whishper_data/libretranslate/data:/home/libretranslate/.local/share

to

- ./whishper_data/libretranslate/data:/root/.local/share

and

- ./whishper_data/libretranslate/cache:/home/libretranslate/.local/cache

to

- ./whishper_data/libretranslate/cache:/root/.local/cache
  1. Add a volume under the whishper volume
- ./whishper_data/uploads:/app/models

Then you need to launch the app while you're connected to the internet.

From here do a transcription with a random audio/video with whatever models you want to use (I used tiny and small).

Now you can stop the app (sudo docker compose down) and disconnect from the internet.

For some reason, the whisper transcription models aren't saved to a snapshots folder automatically so you need to do that manually.

For each transcription model do the following:

On your host machine:

cd whishper_data/models

then enter whichever directory you want to work on first

You should be inside a directory like faster-whisper-small.

From here you need to create the snapshot directory

sudo mkdir cache/models--Systran--faster-whisper-<size>/snapshots

Then you need to grab the hash of the model

cat cache/models--Systran--faster-whisper-<size>/refs/main

Take that hash and make a folder with that hash as its name under snapshots

ex.

sudo mkdir cache/models--Systran--faster-whisper-<size>/snapshots/a654c76b4a76c476a54c7b64ca76b4a764cb7

Then you need to copy all the model files into the snapshots folder

sudo cp config.json model.bin tokenizer.json vocabulary.txt cache/models--Systran--faster-whisper-<size>/snapshots/a654c76b4a76c476a54c7b64ca76b4a764cb7/

Repeat this for all the models you want to use offline.

From here you should be able to go offline and use this app (at least I was able to).

It would be great if there was a way to make this app write to snapshots automatically.

It would also be nice to have a docker-compose.yml file that is configured for 100% offline use on this repo.

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

2 participants