Add support for using whisper models from Huggingface by specifying the model id. (#334)

* Add support for downloading CTranslate-converted models from Huggingface.

* Update utils.py to pass Flake8.

* Update utils.py to pass black.

* Remove redundant usage instructions.

* Apply suggestions from code review

Co-authored-by: Guillaume Klein <guillaumekln@users.noreply.github.com>

---------

Co-authored-by: Guillaume Klein <guillaumekln@users.noreply.github.com>
This commit is contained in:
zh-plus
2023-07-03 23:40:10 +08:00
committed by GitHub
parent c0d93d0829
commit c7cb2aa8d4
3 changed files with 29 additions and 10 deletions

View File

@@ -88,8 +88,9 @@ class WhisperModel:
Args:
model_size_or_path: Size of the model to use (tiny, tiny.en, base, base.en,
small, small.en, medium, medium.en, large-v1, or large-v2) or a path to a converted
model directory. When a size is configured, the converted model is downloaded
small, small.en, medium, medium.en, large-v1, or large-v2), a path to a converted
model directory, or a CTranslate2-converted Whisper model ID from the Hugging Face Hub.
When a size or a model ID is configured, the converted model is downloaded
from the Hugging Face Hub.
device: Device to use for computation ("cpu", "cuda", "auto").
device_index: Device ID to use.