Compare commits
10 Commits
400aa31d19
...
4b6af29b5c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b6af29b5c | ||
|
|
2dd9ca5b0a | ||
|
|
206c91d3ad | ||
|
|
7e4b0e3932 | ||
|
|
02dcfa245e | ||
|
|
880467a432 | ||
|
|
40215def13 | ||
|
|
cdbb528c96 | ||
|
|
a8706ebbe2 | ||
|
|
f62f995c1d |
@@ -1,3 +0,0 @@
|
|||||||
.venv
|
|
||||||
.git
|
|
||||||
data
|
|
||||||
52
.github/workflows/docker-image.yml
vendored
Normal file
52
.github/workflows/docker-image.yml
vendored
Normal 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
117
.gitignore
vendored
@@ -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 don’t 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
|
|
||||||
|
|||||||
10
Dockerfile
10
Dockerfile
@@ -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
|
||||||
|
|
||||||
|
|||||||
28
README.md
28
README.md
@@ -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
|
|
||||||
```
|
|
||||||
|
|||||||
Reference in New Issue
Block a user