File size: 1,141 Bytes
fd37dfd
 
 
 
 
50aad7c
fd37dfd
2b0ad9d
 
 
fd37dfd
bd88d92
 
2435dc7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# import gradio as gr

# gr.Interface.load("models/rohitp1/kkkh_whisper_small_distillation_att_loss_libri360_epochs_100_batch_4_concat_dataset").launch()


import gradio as gr
import os
import transformers
from transformers import pipeline
import time

auth_token = os.getenv("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")

# p = pipeline('automatic-speech-recognition', model='rohitp1/kkkh_whisper_small_distillation_att_loss_libri360_epochs_100_batch_4_concat_dataset')

# def transcribe(audio, state=""):
#     time.sleep(3)
#     text = p(audio)["text"]
#     state = text + " "
#     return state, state



# gr.Interface(
#     fn=transcribe, 
#     inputs=[
#         gr.inputs.Audio(source="microphone", type="filepath"),
#         'state'
#     ],
#     outputs=[
#         "textbox",
#         "state"
#     ],
#     live=False,
#     api_key=auth_token).launch()


demo = gr.load(
    "huggingface/rohitp1/kkkh_whisper_small_distillation_att_loss_libri360_epochs_100_batch_4_concat_dataset",
    title="Speech-to-text",
    inputs="mic",
    description="Let me try to guess what you're saying!",
    api_key=auth_token
)

demo.launch()