Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
import os
|
2 |
import sys
|
3 |
os.system("pip install transformers==4.27.0")
|
4 |
-
from transformers import pipeline, WhisperModel
|
5 |
-
import gradio as gr
|
6 |
os.system("pip install evaluate")
|
7 |
os.system("pip install datasets")
|
8 |
os.system("pip install llvmlite")
|
@@ -21,9 +20,12 @@ disable_caching()
|
|
21 |
|
22 |
p = pipeline("automatic-speech-recognition")
|
23 |
|
|
|
|
|
24 |
huggingface_token = os.environ["huggingface_token"]
|
25 |
|
26 |
whisper_miso=WhisperModel.from_pretrained("mskov/whisper_miso", use_auth_token=huggingface_token)
|
|
|
27 |
|
28 |
|
29 |
task_evaluator = evaluator("automatic-speech-recognition")
|
@@ -35,6 +37,7 @@ results = task_evaluator.compute(
|
|
35 |
model_or_pipeline=whisper_miso,
|
36 |
#model_or_pipeline="mskov/whisper-small.en",
|
37 |
data=dataset,
|
|
|
38 |
input_column="audio",
|
39 |
label_column="audio",
|
40 |
# device=None,
|
|
|
1 |
import os
|
2 |
import sys
|
3 |
os.system("pip install transformers==4.27.0")
|
4 |
+
from transformers import pipeline, WhisperModel, WhisperTokenizer
|
|
|
5 |
os.system("pip install evaluate")
|
6 |
os.system("pip install datasets")
|
7 |
os.system("pip install llvmlite")
|
|
|
20 |
|
21 |
p = pipeline("automatic-speech-recognition")
|
22 |
|
23 |
+
#config = AutoConfig.from_pretrained('whisper-small')
|
24 |
+
|
25 |
huggingface_token = os.environ["huggingface_token"]
|
26 |
|
27 |
whisper_miso=WhisperModel.from_pretrained("mskov/whisper_miso", use_auth_token=huggingface_token)
|
28 |
+
miso_tokenizer = WhisperTokenizer.from_pretrained("mskov/whisper_miso/tokenizer_config.json", use_auth_token=huggingface_token)
|
29 |
|
30 |
|
31 |
task_evaluator = evaluator("automatic-speech-recognition")
|
|
|
37 |
model_or_pipeline=whisper_miso,
|
38 |
#model_or_pipeline="mskov/whisper-small.en",
|
39 |
data=dataset,
|
40 |
+
tokenizer=miso_tokenizer,
|
41 |
input_column="audio",
|
42 |
label_column="audio",
|
43 |
# device=None,
|