-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Publish to GitHub Container Registry | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to ghcr | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build Docker image | ||
run: docker build -t ghcr.io/softcatala/whisper-ctranslate2:latest . | ||
|
||
- name: Use Docker image | ||
run: docker run -v "$(pwd)":/srv/files/ ghcr.io/softcatala/whisper-ctranslate2:latest /srv/files/e2e-tests/gossos.mp3 | ||
|
||
- name: Push Docker image | ||
run: docker push ghcr.io/softcatala/whisper-ctranslate2:latest | ||
|
||
# These are untagged images left behind in the Docker public registry | ||
- name: Delete old images | ||
run: | | ||
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}" | ||
gh api -X GET /user/packages/container/whisper-ctranslate2/versions \ | ||
| jq -r '.[] | select(.metadata.container.tags | index("latest") | not) | .id' \ | ||
| xargs -I {} gh api -X DELETE /user/packages/container/whisper-ctranslate2/versions/{} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM nvidia/cuda:12.3.2-cudnn9-runtime-ubuntu22.04 | ||
|
||
RUN apt-get update && apt-get install -y python3-pip | ||
|
||
WORKDIR /app | ||
COPY . /app | ||
|
||
RUN pip3 install --no-cache-dir -U . | ||
RUN python3 -c 'from faster_whisper import WhisperModel; WhisperModel("small"); WhisperModel("medium"); WhisperModel("large-v2")' | ||
|
||
ENTRYPOINT ["whisper-ctranslate2"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters