Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
import gradio as gr
|
7 |
import os
|
8 |
import transformers
|
9 |
-
from transformers import pipeline, WhisperForConditionalGeneration
|
10 |
import time
|
11 |
|
12 |
# def greet_from_secret(ignored_param):
|
@@ -18,7 +18,13 @@ auth_token = os.environ.get('TOKEN')
|
|
18 |
model = WhisperForConditionalGeneration.from_pretrained("rohitp1/kkkh_whisper_small_distillation_att_loss_libri360_epochs_100_batch_4_concat_dataset",
|
19 |
use_auth_token=auth_token)
|
20 |
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
def transcribe(audio, state=""):
|
24 |
time.sleep(3)
|
|
|
6 |
import gradio as gr
|
7 |
import os
|
8 |
import transformers
|
9 |
+
from transformers import pipeline, WhisperForConditionalGeneration, WhisperTokenizer, WhisperFeatureExtractor
|
10 |
import time
|
11 |
|
12 |
# def greet_from_secret(ignored_param):
|
|
|
18 |
model = WhisperForConditionalGeneration.from_pretrained("rohitp1/kkkh_whisper_small_distillation_att_loss_libri360_epochs_100_batch_4_concat_dataset",
|
19 |
use_auth_token=auth_token)
|
20 |
|
21 |
+
tokenizer = WhisperTokenizer.from_pretrained("rohitp1/kkkh_whisper_small_distillation_att_loss_libri360_epochs_100_batch_4_concat_dataset",
|
22 |
+
use_auth_token=auth_token)
|
23 |
+
|
24 |
+
feat_ext = WhisperFeatureExtractor.from_pretrained("rohitp1/kkkh_whisper_small_distillation_att_loss_libri360_epochs_100_batch_4_concat_dataset",
|
25 |
+
use_auth_token=auth_token)
|
26 |
+
|
27 |
+
p = pipeline('automatic-speech-recognition', model=model, tokenizer=tokenizer, feature_extractor=feat_ext)
|
28 |
|
29 |
def transcribe(audio, state=""):
|
30 |
time.sleep(3)
|