Skip to content

Commit a62c23e

Browse files
committed
Merge branch 'main' of github.com:abdeladim-s/subsai
2 parents 1370cfb + 2942b85 commit a62c23e

File tree

5 files changed

+79
-14
lines changed

5 files changed

+79
-14
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
name: ci
1+
name: mkdocs
22
on:
33
push:
4-
branches:
5-
- master
6-
- main
4+
pull_request:
5+
76
permissions:
87
contents: write
98
jobs:
109
deploy:
1110
runs-on: ubuntu-latest
1211
steps:
13-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1413
- uses: actions/setup-python@v4
1514
with:
1615
python-version: 3.x
17-
- uses: actions/cache@v2
16+
- uses: actions/cache@v4
1817
with:
1918
key: ${{ github.ref }}
2019
path: .cache
2120
- run: pip install mkdocs-macros-plugin
2221
- run: pip install mkdocs-material
2322
- run: pip install mkdocstrings[python]
2423
- run: pip install black
25-
- run: mkdocs gh-deploy --force
24+
- run: mkdocs build
25+
- name: Deploy to GitHub Pages
26+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
27+
run: mkdocs gh-deploy --force

.github/workflows/docker-image.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Docker image
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
docker_image:
9+
name: Build and push Docker image
10+
runs-on: ubuntu-latest
11+
permissions:
12+
packages: write
13+
contents: read
14+
attestations: write
15+
id-token: write
16+
steps:
17+
- name: Check out the repo
18+
uses: actions/checkout@v4
19+
20+
- name: Login to GitHub Container Registry
21+
uses: docker/login-action@v3
22+
with:
23+
registry: ghcr.io
24+
username: ${{ github.repository_owner }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Log in to Docker Hub
28+
uses: docker/login-action@v3
29+
if: env.DOCKER_USERNAME != ''
30+
with:
31+
username: ${{ secrets.DOCKER_USERNAME }}
32+
password: ${{ secrets.DOCKER_PASSWORD }}
33+
env:
34+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
35+
36+
- name: Extract metadata (tags, labels) for Docker
37+
id: meta
38+
uses: docker/metadata-action@v5
39+
with:
40+
images: |
41+
${{ secrets.DOCKER_USERNAME != '' && format('{0}/subsai', secrets.DOCKER_USERNAME) || '' }}
42+
ghcr.io/${{ github.repository_owner }}/subsai
43+
tags: |
44+
type=raw,value=latest,enable={{is_default_branch}}
45+
type=ref,event=branch
46+
type=ref,event=pr
47+
48+
- name: Build and push Docker image
49+
id: push
50+
uses: docker/build-push-action@v6
51+
with:
52+
context: .
53+
file: ./Dockerfile
54+
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
55+
tags: ${{ steps.meta.outputs.tags }}
56+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@ COPY ./assets ./assets
2020

2121
RUN pip install .
2222

23+
EXPOSE 8501
24+
2325
ENTRYPOINT ["python", "src/subsai/webui.py", "--server.fileWatcherType", "none", "--browser.gatherUsageStats", "false"]
2426

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,16 @@ Simple examples can be found in the [examples](https://github.com/absadiki/subsa
191191
</a>
192192
193193
# Docker
194-
195-
1. Make sure that you have `docker` installed.
196-
2. Clone and `cd` to the repository
197-
3. ```docker compose build```
198-
4. ```docker compose run -p 8501:8501 -v /path/to/your/media_files/folder:/media_files subsai-webui # subsai-webui-cpu for cpu only```
199-
6. You can access your media files through the mounted `media_files` folder.
194+
* Make sure that you have `docker` installed.
195+
* Prebuilt image
196+
1. ```docker pull absadiki/subsai:main```
197+
2. ```docker run --gpus=all -p 8501:8501 -v /path/to/your/media_files/folder:/media_files absadiki/subsai:main```
198+
* Build the image locally
199+
1. Clone and `cd` to the repository
200+
2. ```docker compose build```
201+
3. ```docker compose run -p 8501:8501 -v /path/to/your/media_files/folder:/media_files subsai-webui # subsai-webui-cpu for cpu only```
202+
203+
* You can access your media files through the mounted `media_files` folder.
200204
201205
# Notes
202206
* 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.

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ faster_whisper
1212
whisperx @ git+https://github.com/m-bain/whisperx.git
1313
stable-ts==2.13.3
1414
openai
15-
transformers
15+
transformers
16+
numpy<2

0 commit comments

Comments
 (0)