File size: 636 Bytes
cd490d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7277ae9
cd490d5
 
 
 
 
 
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
import gradio as gr
import whisper
import ffmpeg
import streamlit.components.v1 as components


def transcribe_audio(audio_file):
    model = whisper.load_model("small")
    result = model.transcribe(audio_file, fp16=False)
    return result["text"]



def main():
    audio_input = gr.inputs.Audio(source="upload", type="filepath")
    output_text = gr.outputs.Textbox()
    iface = gr.Interface(fn=transcribe_audio, inputs=audio_input, 
                         outputs=output_text, title="Transciption Audio",
                         description="Charger l'audio")
    
    iface.launch()


if __name__ == '__main__':
    main()

#