

fix: incorrect whisper model env references
@af0231d0cf933267013855f0e0b9181e8665e747
--- README.md
+++ README.md
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 |
Features: |
4 | 4 |
- GPU and CPU support. |
5 | 5 |
- Easily deployable using Docker. |
6 |
-- Configurable through environment variables (see [config.py](./faster_whisper_server/config.py)). |
|
6 |
+- **Configurable through environment variables (see [config.py](./faster_whisper_server/config.py))**. |
|
7 | 7 |
- OpenAI API compatible. |
8 | 8 |
|
9 | 9 |
Please create an issue if you find a bug, have a question, or a feature suggestion. |
--- examples/live-audio/script.sh
+++ examples/live-audio/script.sh
... | ... | @@ -7,12 +7,12 @@ |
7 | 7 |
# ffmpeg -y -hide_banner -loglevel quiet -i audio.mp3 -ac 1 -ar 16000 -f s16le -acodec pcm_s16le audio.pcm |
8 | 8 |
# rm -f audio.mp3 |
9 | 9 |
|
10 |
-export WHISPER_MODEL=Systran/faster-distil-whisper-large-v3 # or Systran/faster-whisper-tiny.en if you are running on a CPU for a faster inference. |
|
10 |
+export WHISPER__MODEL=Systran/faster-distil-whisper-large-v3 # or Systran/faster-whisper-tiny.en if you are running on a CPU for a faster inference. |
|
11 | 11 |
|
12 | 12 |
# Ensure you have `faster-whisper-server` running. If this is your first time running it expect to wait up-to a minute for the model to be downloaded and loaded into memory. You can run `curl localhost:8000/health` to check if the server is ready or watch the logs with `docker logs -f <container_id>`. |
13 |
-docker run --detach --gpus=all --publish 8000:8000 --volume ~/.cache/huggingface:/root/.cache/huggingface --env WHISPER_MODEL=$WHISPER_MODEL fedirz/faster-whisper-server:latest-cuda |
|
13 |
+docker run --detach --gpus=all --publish 8000:8000 --volume ~/.cache/huggingface:/root/.cache/huggingface --env WHISPER__MODEL=$WHISPER__MODEL fedirz/faster-whisper-server:latest-cuda |
|
14 | 14 |
# or you can run it on a CPU |
15 |
-# docker run --detach --publish 8000:8000 --volume ~/.cache/huggingface:/root/.cache/huggingface --env WHISPER_MODEL=$WHISPER_MODEL fedirz/faster-whisper-server:latest-cpu |
|
15 |
+# docker run --detach --publish 8000:8000 --volume ~/.cache/huggingface:/root/.cache/huggingface --env WHISPER__MODEL=$WHISPER__MODEL fedirz/faster-whisper-server:latest-cpu |
|
16 | 16 |
|
17 | 17 |
# `pv` is used to limit the rate at which the audio is streamed to the server. Audio is being streamed at a rate of 32kb/s(16000 sample rate * 16-bit sample / 8 bits per byte = 32000 bytes per second). This emulutes live audio input from a microphone: `ffmpeg -loglevel quiet -f alsa -i default -ac 1 -ar 16000 -f s16le` |
18 | 18 |
# shellcheck disable=SC2002 |
--- examples/youtube/script.sh
+++ examples/youtube/script.sh
... | ... | @@ -3,12 +3,12 @@ |
3 | 3 |
set -e |
4 | 4 |
|
5 | 5 |
# NOTE: do not use any distil-* model other than the large ones as they don't work on long audio files for some reason. |
6 |
-export WHISPER_MODEL=Systran/faster-distil-whisper-large-v3 # or Systran/faster-whisper-tiny.en if you are running on a CPU for a faster inference. |
|
6 |
+export WHISPER__MODEL=Systran/faster-distil-whisper-large-v3 # or Systran/faster-whisper-tiny.en if you are running on a CPU for a faster inference. |
|
7 | 7 |
|
8 | 8 |
# Ensure you have `faster-whisper-server` running. If this is your first time running it expect to wait up-to a minute for the model to be downloaded and loaded into memory. You can run `curl localhost:8000/health` to check if the server is ready or watch the logs with `docker logs -f <container_id>`. |
9 |
-docker run --detach --gpus=all --publish 8000:8000 --volume ~/.cache/huggingface:/root/.cache/huggingface --env WHISPER_MODEL=$WHISPER_MODEL fedirz/faster-whisper-server:latest-cuda |
|
9 |
+docker run --detach --gpus=all --publish 8000:8000 --volume ~/.cache/huggingface:/root/.cache/huggingface --env WHISPER__MODEL=$WHISPER__MODEL fedirz/faster-whisper-server:latest-cuda |
|
10 | 10 |
# or you can run it on a CPU |
11 |
-# docker run --detach --publish 8000:8000 --volume ~/.cache/huggingface:/root/.cache/huggingface --env WHISPER_MODEL=$WHISPER_MODEL fedirz/faster-whisper-server:latest-cpu |
|
11 |
+# docker run --detach --publish 8000:8000 --volume ~/.cache/huggingface:/root/.cache/huggingface --env WHISPER__MODEL=$WHISPER__MODEL fedirz/faster-whisper-server:latest-cpu |
|
12 | 12 |
|
13 | 13 |
# Download the audio from a YouTube video. In this example I'm downloading "The Evolution of the Operating System" by Asionometry YouTube channel. I highly checking this channel out, the guy produces very high content. If you don't have `youtube-dl`, you'll have to install it. https://github.com/ytdl-org/youtube-dl |
14 | 14 |
youtube-dl --extract-audio --audio-format mp3 -o the-evolution-of-the-operating-system.mp3 'https://www.youtube.com/watch?v=1lG7lFLXBIs' |
--- faster_whisper_server/config.py
+++ faster_whisper_server/config.py
... | ... | @@ -162,8 +162,8 @@ |
162 | 162 |
|
163 | 163 |
Pydantic will automatically handle mapping uppercased environment variables to the corresponding fields. |
164 | 164 |
To populate nested, the environment should be prefixed with the nested field name and an underscore. For example, |
165 |
- the environment variable `LOG_LEVEL` will be mapped to `log_level`, `WHISPER_MODEL` to `whisper.model`, etc. |
|
166 |
- """ |
|
165 |
+ the environment variable `LOG_LEVEL` will be mapped to `log_level`, `WHISPER__MODEL`(note the double underscore) to `whisper.model`, etc. |
|
166 |
+ """ # noqa: E501 |
|
167 | 167 |
|
168 | 168 |
model_config = SettingsConfigDict(env_nested_delimiter="__") |
169 | 169 |
|
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?