Skip to content

Commit 23537aa

Browse files
committed
Support transformers
1 parent b7cbc15 commit 23537aa

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ services:
9797
- TZ=Etc/UTC
9898
- WHISPER_MODEL=tiny-int8
9999
- LOCAL_ONLY= #optional
100+
- USE_TRANSFORMERS= #optional
100101
- WHISPER_BEAM=1 #optional
101102
- WHISPER_LANG=en #optional
102103
volumes:
@@ -116,6 +117,7 @@ docker run -d \
116117
-e TZ=Etc/UTC \
117118
-e WHISPER_MODEL=tiny-int8 \
118119
-e LOCAL_ONLY= `#optional` \
120+
-e USE_TRANSFORMERS= `#optional` \
119121
-e WHISPER_BEAM=1 `#optional` \
120122
-e WHISPER_LANG=en `#optional` \
121123
-p 10300:10300 \
@@ -134,8 +136,9 @@ Containers are configured using parameters passed at runtime (such as those abov
134136
| `-e PUID=1000` | for UserID - see below for explanation |
135137
| `-e PGID=1000` | for GroupID - see below for explanation |
136138
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
137-
| `-e WHISPER_MODEL=tiny-int8` | Whisper model that will be used for transcription. From [here](https://github.com/SYSTRAN/faster-whisper/blob/master/faster_whisper/utils.py#L12-L31), all with `-int8` compressed variants |
139+
| `-e WHISPER_MODEL=tiny-int8` | Whisper model that will be used for transcription. From [here](https://github.com/home-assistant/addons/blob/master/whisper/config.yaml#L25), smaller models also have `-int8` compressed variants |
138140
| `-e LOCAL_ONLY=` | If set to `true`, or any other value, the container will not attempt to download models from HuggingFace and will only use locally-provided models. |
141+
| `-e USE_TRANSFORMERS=` | If set to `true`, or any other value, the container will interpret `WHISPER_MODEL` as a HuggingFace transformers model id. |
139142
| `-e WHISPER_BEAM=1` | Number of candidates to consider simultaneously during transcription. |
140143
| `-e WHISPER_LANG=en` | Language that you will speak to the add-on. |
141144
| `-v /config` | Local path for Whisper config files. |

readme-vars.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ common_param_env_vars_enabled: true
2222
param_container_name: "{{ project_name }}"
2323
param_usage_include_env: true
2424
param_env_vars:
25-
- {env_var: "WHISPER_MODEL", env_value: "tiny-int8", desc: "Whisper model that will be used for transcription. From [here](https://github.com/SYSTRAN/faster-whisper/blob/master/faster_whisper/utils.py#L12-L31), all with `-int8` compressed variants"}
25+
- {env_var: "WHISPER_MODEL", env_value: "tiny-int8", desc: "Whisper model that will be used for transcription. From [here](https://github.com/home-assistant/addons/blob/master/whisper/config.yaml#L25), smaller models also have `-int8` compressed variants"}
2626
param_usage_include_vols: true
2727
param_volumes:
2828
- {vol_path: "/config", vol_host_path: "/path/to/{{ project_name }}/data", desc: "Local path for Whisper config files."}
@@ -33,6 +33,7 @@ param_ports:
3333
opt_param_usage_include_env: true
3434
opt_param_env_vars:
3535
- {env_var: "LOCAL_ONLY", env_value: "", desc: "If set to `true`, or any other value, the container will not attempt to download models from HuggingFace and will only use locally-provided models."}
36+
- {env_var: "USE_TRANSFORMERS", env_value: "", desc: "If set to `true`, or any other value, the container will interpret `WHISPER_MODEL` as a HuggingFace transformers model id."}
3637
- {env_var: "WHISPER_BEAM", env_value: "1", desc: "Number of candidates to consider simultaneously during transcription."}
3738
- {env_var: "WHISPER_LANG", env_value: "en", desc: "Language that you will speak to the add-on."}
3839
readonly_supported: true

root/etc/s6-overlay/s6-rc.d/svc-whisper/run

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ exec \
1010
--language "${WHISPER_LANG:-en}" \
1111
--data-dir /config \
1212
--download-dir /config \
13-
${LOCAL_ONLY:+--local-files-only}
13+
${LOCAL_ONLY:+--local-files-only} \
14+
${USE_TRANSFORMERS:+--use-transformers}

0 commit comments

Comments
 (0)