Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,25 +11,36 @@ import time
|
|
11 |
|
12 |
auth_token = os.getenv("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")
|
13 |
|
14 |
-
p = pipeline('automatic-speech-recognition', model='rohitp1/kkkh_whisper_small_distillation_att_loss_libri360_epochs_100_batch_4_concat_dataset')
|
15 |
-
|
16 |
-
def transcribe(audio, state=""):
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
gr.Interface(
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
auth_token = os.getenv("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")
|
13 |
|
14 |
+
# p = pipeline('automatic-speech-recognition', model='rohitp1/kkkh_whisper_small_distillation_att_loss_libri360_epochs_100_batch_4_concat_dataset')
|
15 |
+
|
16 |
+
# def transcribe(audio, state=""):
|
17 |
+
# time.sleep(3)
|
18 |
+
# text = p(audio)["text"]
|
19 |
+
# state = text + " "
|
20 |
+
# return state, state
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
+
# gr.Interface(
|
25 |
+
# fn=transcribe,
|
26 |
+
# inputs=[
|
27 |
+
# gr.inputs.Audio(source="microphone", type="filepath"),
|
28 |
+
# 'state'
|
29 |
+
# ],
|
30 |
+
# outputs=[
|
31 |
+
# "textbox",
|
32 |
+
# "state"
|
33 |
+
# ],
|
34 |
+
# live=False,
|
35 |
+
# api_key=auth_token).launch()
|
36 |
+
|
37 |
+
|
38 |
+
demo = gr.load(
|
39 |
+
"huggingface/rohitp1/kkkh_whisper_small_distillation_att_loss_libri360_epochs_100_batch_4_concat_dataset",
|
40 |
+
title="Speech-to-text",
|
41 |
+
inputs="mic",
|
42 |
+
description="Let me try to guess what you're saying!",
|
43 |
+
api_key=auth_token
|
44 |
+
)
|
45 |
+
|
46 |
+
demo.launch()
|