Skip to content

Commit

Permalink
docker #22
Browse files Browse the repository at this point in the history
  • Loading branch information
abdeladim-s committed Jul 17, 2023
1 parent 890c17f commit 6fbfb3f
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 7 deletions.
23 changes: 23 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
__pycache__
*.pyc
*.pyo
*.pyd
.Python
env/
venv/
pip-log.txt
pip-delete-this-directory.txt
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.log
.git
.gitignore
.mypy_cache
.pytest_cache
.hypothesis
.idea
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#FROM python:3.10.6
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime

WORKDIR /subsai

COPY requirements.txt .

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y git && \
apt-get -y install gcc mono-mcs && \
rm -rf /var/lib/apt/lists/*

RUN pip install --no-cache-dir -r requirements.txt

COPY pyproject.toml .
COPY ./src ./src
COPY ./assets ./assets

RUN pip install .

CMD ["python", "src/subsai/webui.py"]

16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,18 @@ _Quoted from the official openai/whisper installation_
```shell
pip install git+https://github.com/abdeladim-s/subsai
```

# Usage
### Web UI
### Web-UI

To use the web UI, run the following command on the terminal
To use the web-UI, run the following command on the terminal
```shell
subsai-webui
```

And a web page will open on your default browser, otherwise navigate to the links provided by the command

You can also run the Web-UI using [Docker](#Docker).

### CLI

```shell
Expand Down Expand Up @@ -176,6 +178,14 @@ Simple examples can be found in the [examples](https://github.com/abdeladim-s/su
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
</a>
# Docker
If you only want to use the Web-UI, you can use docker as follows:
1. Make sure that you have `docker` installed.
2. Clone and cd to the repository
3. ```docker compose build```
4. ```docker compose run -v /path/to/your/media_files/folder:/media_files subsai-webui```
5. You can access your media files through the mounted `media_files` folder.
# Notes
* If you have an NVIDIA graphics card, you may need to install [cuda](https://docs.nvidia.com/cuda/#installation-guides) to use the GPU capabilities.
* Transcription time is shown on the terminal, keep an eye on it while running the web UI.
Expand Down
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3.8'

services:
subsai-webui:
build:
context: .
dockerfile: Dockerfile
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
torch
torch==2.0.1
openai-whisper==20230124
streamlit~=1.20.0
streamlit_player~=0.1.5
streamlit-aggrid~=0.3.4
ffsubsync~=0.4.24
whisper-timestamped @ git+https://github.com/linto-ai/whisper-timestamped
pandas
pandas==1.5.3
pysubs2~=1.6.0
pywhispercpp==1.1.1
dl_translate
faster_whisper
dl_translate==0.2.6
faster_whisper==0.5.1
whisperx @ git+https://github.com/m-bain/whisperx.git

0 comments on commit 6fbfb3f

Please sign in to comment.