Compare commits
13 Commits
400aa31d19
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 937b6e1201 | |||
| 19fdd475a5 | |||
| 9e4c81439f | |||
|
|
4b6af29b5c | ||
|
|
2dd9ca5b0a | ||
|
|
206c91d3ad | ||
|
|
7e4b0e3932 | ||
|
|
02dcfa245e | ||
|
|
880467a432 | ||
|
|
40215def13 | ||
|
|
cdbb528c96 | ||
|
|
a8706ebbe2 | ||
|
|
f62f995c1d |
@@ -1,3 +0,0 @@
|
||||
.venv
|
||||
.git
|
||||
data
|
||||
58
.github/workflows/docker-image.yml
vendored
Normal file
58
.github/workflows/docker-image.yml
vendored
Normal 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
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
|
||||
|
||||
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 --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.2/
|
||||
RUN pip3 install --break-system-packages --no-cache-dir wheel setuptools
|
||||
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
|
||||
|
||||
|
||||
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.
|
||||
|
||||
## Build Docker image
|
||||
|
||||
Build docker image:
|
||||
|
||||
```shell
|
||||
docker build -t rocm-wyoming-whisper .
|
||||
```
|
||||
|
||||
## Run with docker-compose
|
||||
|
||||
```shell
|
||||
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