File size: 1,015 Bytes
1a16094
 
 
 
 
 
 
 
83ba79c
 
 
 
 
 
 
 
 
 
 
 
 
1a16094
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import gradio as gr
import whisper

def convert_to_text(audio_path : str) -> str:  
    model = whisper.load_model("base")
    result = model.transcribe(audio_path)
    return result["text"]

  iface = gr.Interface(fn=transcribe_audio, inputs=audio_input, 
                         outputs=output_text, title="AUDIO -TEXTO",
                         description="Subir el Audio y Presionar el botón 'SUBMIT'\
                             ",
                              #theme='freddyaboulton/dracula_revamped'
                              
                              theme = gr.themes.Soft(),

                              
                              css='div {background-size: cover; background-repeat: no-repeat; margin-left: auto; margin-right: auto; width: 100%;\
            background-image: url(""); repeat 0 0;}')\
                  .launch(share=True)

audio_input = gr.components.Audio(type="filepath")
iface = gr.Interface(fn=convert_to_text, inputs=audio_input, outputs="text")
iface.launch()