txya900619
commited on
Commit
·
f634938
1
Parent(s):
784aace
feat: add finetuned whisper-large-v3
Browse files- app.py +8 -0
- configs/models.yaml +2 -0
- requirements.txt +2 -1
app.py
CHANGED
@@ -2,6 +2,7 @@ import os
|
|
2 |
|
3 |
import gradio as gr
|
4 |
import torch
|
|
|
5 |
from huggingface_hub import snapshot_download
|
6 |
from nemo.collections.asr.models import ASRModel
|
7 |
from omegaconf import OmegaConf
|
@@ -20,6 +21,13 @@ def load_model(model_id: str):
|
|
20 |
return asr_model
|
21 |
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
OmegaConf.register_new_resolver("load_model", load_model)
|
24 |
|
25 |
models_config = OmegaConf.to_object(OmegaConf.load("configs/models.yaml"))
|
|
|
2 |
|
3 |
import gradio as gr
|
4 |
import torch
|
5 |
+
from faster_whisper import WhisperModel
|
6 |
from huggingface_hub import snapshot_download
|
7 |
from nemo.collections.asr.models import ASRModel
|
8 |
from omegaconf import OmegaConf
|
|
|
21 |
return asr_model
|
22 |
|
23 |
|
24 |
+
def load_faster_whisper(model_id: str):
|
25 |
+
# model_dir = snapshot_download(model_id)
|
26 |
+
# model_ckpt_path = os.path.join(model_dir, "model.nemo")
|
27 |
+
model = WhisperModel(model_id)
|
28 |
+
return model
|
29 |
+
|
30 |
+
|
31 |
OmegaConf.register_new_resolver("load_model", load_model)
|
32 |
|
33 |
models_config = OmegaConf.to_object(OmegaConf.load("configs/models.yaml"))
|
configs/models.yaml
CHANGED
@@ -1,2 +1,4 @@
|
|
|
|
|
|
1 |
parakeet-0.6b-custom-tokenizer:
|
2 |
model: ${load_model:kenkone/parakeet-ctc-0.6b-custom-tokenizer}
|
|
|
1 |
+
whisper-large-v3-finetune:
|
2 |
+
model: kenkone/kenkone-whisper-large-v3-ct2
|
3 |
parakeet-0.6b-custom-tokenizer:
|
4 |
model: ${load_model:kenkone/parakeet-ctc-0.6b-custom-tokenizer}
|
requirements.txt
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
omegaconf
|
2 |
git+https://github.com/NVIDIA/NeMo.git@main#egg=nemo_toolkit[asr]
|
3 |
IPython
|
4 |
-
numpy==1.*
|
|
|
|
1 |
omegaconf
|
2 |
git+https://github.com/NVIDIA/NeMo.git@main#egg=nemo_toolkit[asr]
|
3 |
IPython
|
4 |
+
numpy==1.*
|
5 |
+
faster-whisper
|