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

Docker image for running whisper-ctranslate2 #75

Open
extremelyonline opened this issue Dec 17, 2023 · 1 comment
Open

Docker image for running whisper-ctranslate2 #75

extremelyonline opened this issue Dec 17, 2023 · 1 comment

Comments

@extremelyonline
Copy link

extremelyonline commented Dec 17, 2023

Hello, just wanted to start a discussion about running whisper-ctranslate2 in Docker. Referencing #109 of faster-whisper, I came up with the following Dockerfile, which works.

# Use Ubuntu as base
FROM ubuntu:20.04

# Alternatively, use a base image with CUDA and cuDNN support
# FROM nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu20.04

# Install necessary dependencies
RUN apt-get update && apt-get install -y python3-pip

# Set the working directory
WORKDIR /app

# Copy the app code and requirements filed
COPY . /app

# Install dependencies
RUN pip3 install --no-cache-dir -r requirements.txt

# Install whisper-ctranslate2
RUN pip install -U whisper-ctranslate2

# Set the entry point
ENTRYPOINT ["whisper-ctranslate2"]

Build with: docker build -t asr .
Run with: docker run --rm -v /path/to/folder:/app --gpus '"device=0,1"' asr myfile.mp3 --compute_type int8

My observations are:

  • If the entrypoint is set, the container will not show transcribed lines as it runs. The result are only printed afterwards
  • However, The progress can be shown if you run the docker container (without the entrypoint) in interactive mode
@extremelyonline
Copy link
Author

If a memory limit is set via docker run/docker compose, whisper-ctranslate2 would return Killed when it fails to transcribe a large file.

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