Skip to content

Commit

Permalink
feat:finetuned models
Browse files Browse the repository at this point in the history
allow fine tuned models to be used for each language

examples:
- high accuracy for target lang https://huggingface.co/projecte-aina/faster-whisper-large-v3-ca-3catparla
- lots of tiny models for each language https://huggingface.co/ammaraldirawi
  • Loading branch information
JarbasAl committed Sep 13, 2024
1 parent 2a32cc7 commit d864270
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
12 changes: 0 additions & 12 deletions Dockerfile

This file was deleted.

12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ High-performance inference of [OpenAI's Whisper](https://github.com/openai/whisp

`pip install ovos-stt-plugin-fasterwhisper`

## Configuration
## Models

available models are `'tiny.en', 'tiny', 'base.en', 'base', 'small.en', 'small', 'medium.en', 'medium', 'large-v1', 'large-v2', 'large-v3', 'large', 'distil-large-v2', 'distil-medium.en', 'distil-small.en', 'distil-large-v3'`

available models are `"tiny.en", "tiny", "base.en", "base", "small.en", "small", "medium.en", "medium", "large-v2", "large-v3"`
you can also pass a full path to a local model or a huggingface repo_id, eg. `"projecte-aina/whisper-large-v3-ca-3catparla"`

eg, to use Large model with GPU
You can [convert](https://github.com/SYSTRAN/faster-whisper?tab=readme-ov-file#model-conversion) any whisper model, or use any [compatible model from huggingface](https://huggingface.co/models?pipeline_tag=automatic-speech-recognition&sort=modified&search=faster-whisper)

## Configuration

To use Whisper as STT
to use Large model with GPU

```json
"stt": {
Expand Down
9 changes: 4 additions & 5 deletions ovos_stt_plugin_fasterwhisper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,11 @@ class FasterWhisperSTT(STT):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
model = self.config.get("model")
model = self.config.get("model") or "small"
valid_model = model in FasterWhisperSTT.MODELS
if not model or not valid_model:
LOG.warning(f"{model} is not a valid model ({FasterWhisperSTT.MODELS}), using 'small' instead")
model = "small"
self.config["model"] = "small"
if not valid_model:
LOG.info(f"{model} is not default model_id ({FasterWhisperSTT.MODELS}), "
f"assuming huggingface repo_id or path to local model file")

self.beam_size = self.config.get("beam_size", 5)
self.compute_type = self.config.get("compute_type", "int8")
Expand Down

0 comments on commit d864270

Please sign in to comment.