Compare commits

...

10 Commits

Author SHA1 Message Date
scottgarren
4b6af29b5c Update docker-image.yml 2025-02-22 12:10:35 -05:00
scottgarren
2dd9ca5b0a Update docker-image.yml 2025-02-22 12:07:06 -05:00
albe873
206c91d3ad Image size reduction 2024-12-17 21:07:37 +01:00
albe873
7e4b0e3932 Update docker-image.yml 2024-12-14 00:03:36 +01:00
albe873
02dcfa245e Update docker-image.yml 2024-12-13 23:58:26 +01:00
albe873
880467a432 Create docker-image.yml 2024-12-13 23:37:44 +01:00
albe873
40215def13 Delete .dockerignore 2024-12-13 23:28:03 +01:00
albe873
cdbb528c96 Update .gitignore 2024-12-13 23:27:01 +01:00
albe873
a8706ebbe2 Update README 2024-12-13 23:25:26 +01:00
albe873
f62f995c1d README update 2024-12-13 23:23:07 +01:00
5 changed files with 66 additions and 144 deletions

View File

@@ -1,3 +0,0 @@
.venv
.git
data

52
.github/workflows/docker-image.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
name: Build and publish on dockerhub
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check disk usage
run: df -h
- name: Remove unused Docker images
run: docker system prune -af
- name: Clean up temporary files
run: sudo rm -rf /tmp/*
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{ secrets.DOCKERHUB_USERNAME }}/rocm-wyoming-whisper
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value={{date 'YYYY-MM-DD-HH.mm' tz='Europe/Rome'}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
#cache-from: type=gha
#cache-to: type=gha,mode=max

117
.gitignore vendored
View File

@@ -1,117 +0,0 @@
output/*
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that dont work, or not
# install all needed dependencies.
#Pipfile.lock
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# Pycharm
.idea
data

View File

@@ -2,12 +2,14 @@
FROM rocm/dev-ubuntu-24.04 FROM rocm/dev-ubuntu-24.04
RUN apt update && apt install -y libjpeg-dev python3-dev python3-pip RUN apt update && apt install -y --no-install-recommends libjpeg-dev python3-dev python3-pip && \
apt clean && \
rm -r /var/lib/apt/lists/*
RUN pip3 install --break-system-packages wheel setuptools RUN pip3 install --break-system-packages --no-cache-dir wheel setuptools
RUN pip3 install --break-system-packages --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.2/ RUN pip3 install --break-system-packages --no-cache-dir --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.2/
RUN pip3 install --break-system-packages wyoming openai-whisper tokenizers RUN pip3 install --break-system-packages --no-cache-dir wyoming openai-whisper tokenizers
COPY src /src COPY src /src

View File

@@ -2,28 +2,16 @@
A docker image and a few lines of python to use OpenAI whisper with Rhasspy and/or Home Assistant on AMD GPUs with ROCm. A docker image and a few lines of python to use OpenAI whisper with Rhasspy and/or Home Assistant on AMD GPUs with ROCm.
## Build Docker image
Build docker image:
```shell
docker build -t rocm-wyoming-whisper .
```
## Run with docker-compose ## Run with docker-compose
```shell ```shell
docker-compose up -d docker-compose up -d
``` ```
## Run with Docker
Build docker image:
```shell
docker build -t wyoming-whisper .
```
Run docker image:
```shell
docker run --entrypoint '' -v $(pwd)/data:/data -v $(pwd)/src:/src -it --device=/dev/kfd --device=/dev/dri --security-opt seccomp=unconfined --group-add video -p 10300:10300 wyoming-whisper bash
```
Run script:
```shell
python -m wyoming_whisper --download-dir /data --model medium --debug
```