rohitp1 commited on
Commit
2435dc7
·
1 Parent(s): bd88d92

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -22
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
- 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()
 
 
 
 
 
 
 
 
 
 
 
 
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()