Skip to content

Commit

Permalink
chore: misc
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedir Zadniprovskyi committed May 27, 2024
1 parent af41874 commit 47627a9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/docker-build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
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
Expand All @@ -33,7 +33,8 @@ jobs:
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}}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN poetry install --only main
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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ print(transcript.text)
# If `model` isn't specified, the default model is used
curl http://localhost:8000/v1/audio/transcriptions -F "[email protected]"
curl http://localhost:8000/v1/audio/transcriptions -F "[email protected]"
curl http://localhost:8000/v1/audio/transcriptions -F "[email protected]" -F "streaming=true"
curl http://localhost:8000/v1/audio/transcriptions -F "[email protected]" -F "streaming=true" -F "model=distil-large-v3"
curl http://localhost:8000/v1/audio/transcriptions -F "[email protected]" -F "stream=true"
curl http://localhost:8000/v1/audio/transcriptions -F "[email protected]" -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 "[email protected]" -F "streaming=true" -F "model=distil-large-v3" -F "language=en"
curl http://localhost:8000/v1/audio/transcriptions -F "[email protected]" -F "stream=true" -F "model=distil-large-v3" -F "language=en"

curl http://localhost:8000/v1/audio/translations -F "[email protected]"
```
Expand Down
2 changes: 1 addition & 1 deletion faster_whisper_server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class Language(enum.StrEnum):


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)

Expand Down
2 changes: 1 addition & 1 deletion faster_whisper_server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def load_model(model_name: Model) -> WhisperModel:
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
Expand Down

0 comments on commit 47627a9

Please sign in to comment.