Fedir Zadniprovskyi 2024-05-27
chore: misc
@47627a910737768962d95354783277cfbf7e6c3c
.github/workflows/docker-build-and-push.yaml
--- .github/workflows/docker-build-and-push.yaml
+++ .github/workflows/docker-build-and-push.yaml
@@ -16,9 +16,9 @@
         dockerfile: [Dockerfile.cuda, Dockerfile.cpu]
         include:
           - dockerfile: Dockerfile.cuda
-            tag-prefix: cuda-
+            tag-suffix: -cuda
           - dockerfile: Dockerfile.cpu
-            tag-prefix: cpu-
+            tag-suffix: -cpu
     steps:
       - uses: actions/checkout@v4
       - name: Login to Docker Hub
@@ -33,7 +33,8 @@
             fedirz/faster-whisper-server
           # https://github.com/docker/metadata-action?tab=readme-ov-file#flavor-input
           flavor: |
-            prefix=${{ matrix.tag-prefix }}
+            latest=false
+            suffix=${{ matrix.tag-suffix}}
           tags: |
             type=semver,pattern={{version}}
             type=semver,pattern={{major}}.{{minor}}
Dockerfile.cpu
--- Dockerfile.cpu
+++ Dockerfile.cpu
@@ -15,7 +15,7 @@
 COPY ./faster_whisper_server ./faster_whisper_server
 ENTRYPOINT ["poetry", "run"]
 CMD ["uvicorn", "faster_whisper_server.main:app"]
-ENV WHISPER_MODEL=distil-medium.en
+ENV WHISPER_MODEL=medium.en
 ENV WHISPER_INFERENCE_DEVICE=cpu
 ENV WHISPER_COMPUTE_TYPE=int8
 ENV UVICORN_HOST=0.0.0.0
README.md
--- README.md
+++ README.md
@@ -60,10 +60,10 @@
 # If `model` isn't specified, the default model is used
 curl http://localhost:8000/v1/audio/transcriptions -F "file=@audio.wav"
 curl http://localhost:8000/v1/audio/transcriptions -F "file=@audio.mp3"
-curl http://localhost:8000/v1/audio/transcriptions -F "file=@audio.wav" -F "streaming=true"
-curl http://localhost:8000/v1/audio/transcriptions -F "file=@audio.wav" -F "streaming=true" -F "model=distil-large-v3"
+curl http://localhost:8000/v1/audio/transcriptions -F "file=@audio.wav" -F "stream=true"
+curl http://localhost:8000/v1/audio/transcriptions -F "file=@audio.wav" -F "stream=true" -F "model=distil-large-v3"
 # It's recommended that you always specify the language as that will reduce the transcription time
-curl http://localhost:8000/v1/audio/transcriptions -F "file=@audio.wav" -F "streaming=true" -F "model=distil-large-v3" -F "language=en"
+curl http://localhost:8000/v1/audio/transcriptions -F "file=@audio.wav" -F "stream=true" -F "model=distil-large-v3" -F "language=en"
 
 curl http://localhost:8000/v1/audio/translations -F "file=@audio.wav"
 ```
faster_whisper_server/config.py
--- faster_whisper_server/config.py
+++ faster_whisper_server/config.py
@@ -163,7 +163,7 @@
 
 
 class WhisperConfig(BaseModel):
-    model: Model = Field(default=Model.DISTIL_MEDIUM_EN)
+    model: Model = Field(default=Model.MEDIUM_EN)
     inference_device: Device = Field(default=Device.AUTO)
     compute_type: Quantization = Field(default=Quantization.DEFAULT)
 
faster_whisper_server/main.py
--- faster_whisper_server/main.py
+++ faster_whisper_server/main.py
@@ -58,7 +58,7 @@
         compute_type=config.whisper.compute_type,
     )
     logger.info(
-        f"Loaded {model_name} loaded in {time.perf_counter() - start:.2f} seconds"
+        f"Loaded {model_name} loaded in {time.perf_counter() - start:.2f} seconds. {config.whisper.inference_device}({config.whisper.compute_type}) will be used for inference."
     )
     models[model_name] = whisper
     return whisper
Add a comment
List