Compare commits

...

13 Commits

Author SHA1 Message Date
937b6e1201 Update Dockerfile
All checks were successful
Docker Build and Publish / Build Docker image amd publish to Gitea (push) Successful in 16m20s
2025-09-02 20:53:52 -04:00
19fdd475a5 Update .github/workflows/docker-image.yml
All checks were successful
Docker Build and Publish / Build Docker image amd publish to Gitea (push) Successful in 19m34s
2025-09-02 20:32:09 -04:00
9e4c81439f Update .github/workflows/docker-image.yml 2025-09-02 20:30:02 -04:00
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 72 additions and 144 deletions

View File

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

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

@@ -0,0 +1,58 @@
name: Docker Build and Publish
on:
schedule:
- cron: '30 6 * * SUN'
push:
branches: [ "main" ]
paths-ignore:
- '**/README.md'
pull_request:
branches: [ "main" ]
paths-ignore:
- '**/README.md'
workflow_dispatch:
jobs:
## define job to build and publish docker image
build-and-push-docker-image:
name: Build Docker image amd publish to Gitea
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
## This is used to complete the identity challenge
## with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
## https://github.com/docker/build-push-action
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
## https://github.com/docker/login-action
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: git.sdgarren.com
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
## https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
provenance: false
context: .
platforms: linux/amd64
push: true
tags: |
git.sdgarren.com/scott/rocm-wyoming-whisper:latest
- name: Image digest
run: echo ${{ steps.build-and-push.outputs.digest }}

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/rocm6.4/
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
```