Explorar el Código

update model cdn

subDesTagesMitExtraKaese hace 1 año
padre
commit
9ad5ce3155
Se han modificado 3 ficheros con 15 adiciones y 5 borrados
  1. 13 3
      .github/workflows/docker.yml
  2. 1 1
      Dockerfile
  3. 1 1
      speech_recognition.py

+ 13 - 3
.github/workflows/docker.yml

@@ -27,6 +27,14 @@ jobs:
         with:
           username: ${{ secrets.DOCKERHUB_USERNAME }}
           password: ${{ secrets.DOCKERHUB_TOKEN }}
+      -
+        name: Build and push
+        uses: docker/build-push-action@v2
+        with:
+          context: .
+          platforms: linux/amd64,linux/arm64
+          push: true
+          tags: ftcaplan/matrix-stt-bot:latest
       -
         name: Build and push
         uses: docker/build-push-action@v2
@@ -44,7 +52,9 @@ jobs:
           context: .
           platforms: linux/amd64,linux/arm64
           push: true
-          tags: ftcaplan/matrix-stt-bot:latest
+          tags: ftcaplan/matrix-stt-bot:small
+          build-args: |
+            "PRELOAD_MODEL=small"
       -
         name: Build and push
         uses: docker/build-push-action@v2
@@ -52,9 +62,9 @@ jobs:
           context: .
           platforms: linux/amd64,linux/arm64
           push: true
-          tags: ftcaplan/matrix-stt-bot:small
+          tags: ftcaplan/matrix-stt-bot:base
           build-args: |
-            "PRELOAD_MODEL=small"
+            "PRELOAD_MODEL=base"
       -
         name: Build and push
         uses: docker/build-push-action@v2

+ 1 - 1
Dockerfile

@@ -34,6 +34,6 @@ ADD ./*.py /app/
 
 ARG PRELOAD_MODEL
 ENV PRELOAD_MODEL ${PRELOAD_MODEL}
-RUN if [ -n "$PRELOAD_MODEL" ]; then wget "https://ggml.ggerganov.com/ggml-model-whisper-$PRELOAD_MODEL.bin"; fi
+RUN if [ -n "$PRELOAD_MODEL" ]; then wget "https://huggingface.co/datasets/ggerganov/whisper.cpp/resolve/main/ggml-$PRELOAD_MODEL.bin"; fi
 
 CMD ["python3", "-u", "main.py"]

+ 1 - 1
speech_recognition.py

@@ -43,7 +43,7 @@ class ASR():
       if not os.path.exists("/data/models"):
         os.mkdir("/data/models")
         
-    self.model_url = f"https://ggml.ggerganov.com/ggml-model-whisper-{self.model}.bin"
+    self.model_url = f"https://huggingface.co/datasets/ggerganov/whisper.cpp/resolve/main/ggml-{self.model}.bin"
     self.lock = asyncio.Lock()
 
   def load_model(self):