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

An error occurred while synchronising the Systran/faster-whisper-tiny model from the Hugging Face Hub #92

Open
simon-231 opened this issue Apr 26, 2024 · 1 comment

Comments

@simon-231
Copy link

Description

I get the following error message in the transcription.err.log:
"An error occurred while synchronising the Systran/faster-whisper-tiny model from the Hugging Face Hub".

The Ubuntu firewall does not block outgoing traffic and I don't understand why the models fail to load.

If the models keep failing I would like to provide them locally. What steps do I have to follow to do that?

Environment

Logs and Configuration

transcription.err.log
An error occurred while synchronising the Systran/faster-whisper-tiny model from the Hugging Face Hub: No suitable cache snapshot folder for the specified revision could be found on the local hard drive and outgoing traffic has been disabled. To enable repo searches and downloads online, pass 'local_files_only=False' as input. An attempt is made to load the model directly from the local cache, if this exists.

Docker Compose Logs

Run the following command in the project folder, force the error, and paste the logs below: docker compose logs -f --tail 50

whishper                | 2024-04-26 15:55:59,313 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
whishper                | 2024-04-26 15:55:59,316 INFO supervisord started with pid 1
whishper                | 2024-04-26 15:56:00,321 INFO spawned: 'backend' with pid 8
whishper                | 2024-04-26 15:56:00,327 INFO spawned: 'frontend' with pid 9
whishper                | 2024-04-26 15:56:00,335 INFO spawned: 'nginx' with pid 10
whishper                | 2024-04-26 15:56:00,340 INFO spawned: 'transcription' with pid 11
whishper                | 2024-04-26 15:56:01,518 INFO success: backend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
whishper                | 2024-04-26 15:56:01,518 INFO success: frontend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
whishper                | 2024-04-26 15:56:01,518 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
whishper                | 2024-04-26 15:56:01,519 INFO success: transcription entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
mongo-1                 | {"t":{"$date":"2024-04-26T15:55:58.807Z"},"s":"I",  "c":"CONTROL",  "id":20697,   "ctx":"main","msg":"Renamed existing log file","attr":{"oldLogPath":"/var/log/mongodb/mongod.log","newLogPath":"/var/log/mongodb/mongod.log.2024-04-26T15-55-58"}}
whisper-libretranslate  | Updating language models
whisper-libretranslate  | Found 88 models
whisper-libretranslate  | Keep 2 models
whisper-libretranslate  | Loaded support for 4 languages (2 models total)!
whisper-libretranslate  | Running on http://*:5000

Docker Compose File

I use the original file

version: "3.9"

services:
  mongo:
    image: mongo
    env_file:
      - .env
    restart: unless-stopped
    volumes:
      - ./whishper_data/db_data:/data/db
      - ./whishper_data/db_data/logs/:/var/log/mongodb/
    environment:
      MONGO_INITDB_ROOT_USERNAME: ${DB_USER:-whishper}
      MONGO_INITDB_ROOT_PASSWORD: ${DB_PASS:-whishper}
    expose:
      - 27017
    command: ['--logpath', '/var/log/mongodb/mongod.log']

  translate:
    container_name: whisper-libretranslate
    image: libretranslate/libretranslate:latest
    restart: unless-stopped
    volumes:
      - ./whishper_data/libretranslate/data:/home/libretranslate/.local/share
      - ./whishper_data/libretranslate/cache:/home/libretranslate/.local/cache
    env_file:
      - .env
    tty: true
    environment:
      LT_DISABLE_WEB_UI: True
      LT_UPDATE_MODELS: True
    expose:
      - 5000
    networks:
      default:
        aliases:
          - translate
    healthcheck:
      test: ['CMD-SHELL', './venv/bin/python scripts/healthcheck.py']
      interval: 2s
      timeout: 3s
      retries: 5

  whishper:
    pull_policy: always
    image: pluja/whishper:${WHISHPER_VERSION:-latest}
    env_file:
      - .env
    volumes:
      - ./whishper_data/uploads:/app/uploads
      - ./whishper_data/logs:/var/log/whishper
    container_name: whishper
    restart: unless-stopped
    networks:
      default:
        aliases:
          - whishper
    ports:
      - 8082:80
    depends_on:
      - mongo
      - translate
    environment:
      PUBLIC_INTERNAL_API_HOST: "http://127.0.0.1:80"
      PUBLIC_TRANSLATION_API_HOST: ""
      PUBLIC_API_HOST: ${WHISHPER_HOST:-}
      PUBLIC_WHISHPER_PROFILE: cpu
      WHISPER_MODELS_DIR: /app/models
      UPLOAD_DIR: /app/uploads
      CPU_THREADS: 4
@simon-231 simon-231 changed the title [BUG] Bug Title An error occurred while synchronising the Systran/faster-whisper-tiny model from the Hugging Face Hub Apr 28, 2024
@massimo2001
Copy link

After a while it started working. With every restart, the modules had to be downloaded again. Got the same error message, but deemed it misleading, since the models have been downloaded eventually.

What fixed it for me: In the docker-compose.yml's whishper: section, add a volume mount for the /app/modules path in the container (also see WHISPER_MODELS_DIR).

  whishper:
     ...
    volumes:
      - ./whishper_data/uploads:/app/uploads
+     - ./whishper_data/models:/app/models
      - ./whishper_data/logs:/var/log/whishper

After the container is re-created, models are downloaded and persisted to disk. Without, they're just stored on the volatile OverlayFS, and do not survive the container restart. Error message is gone.

Cheers,
Mo

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