fedirz / faster-whisper-server

https://hub.docker.com/r/fedirz/faster-whisper-server
MIT License
477 stars 78 forks source link

Allow setting WHISPER_MODEL to model ID #14

Closed powellnorma closed 4 months ago

powellnorma commented 4 months ago

If WHISPER_MODEL contains a '/', faster-whisper would interpreted it as HF Model ID:

https://github.com/SYSTRAN/faster-whisper/blob/v1.0.2/faster_whisper/transcribe.py#L102 https://github.com/SYSTRAN/faster-whisper/blob/v1.0.2/faster_whisper/utils.py#L56

However faster-whisper-server currently only allows sizes:

pydantic_core._pydantic_core.ValidationError: 1 validation error for Config
whisper.model
  Input should be 'tiny.en', 'tiny', 'base.en', 'base', 'small.en', 'small', 'medium.en', 'medium', 'large', 'large-v1', 'large-v2', 'large-v3', 'distil-small.en', 'distil-medium.en', 'distil-large-v2' or 'distil-large-v3' [type=enum, input_value='bofenghuang/whisper-large-v2-cv11-german-ct2', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/enum
fedirz commented 4 months ago

Thanks, for creating the issue! I'll make the change to allow passing model ids.

fedirz commented 4 months ago

Passing in model IDs is now supported!

I've also added /v1/models and /v1/models/{model} routes