Spaces:
Sleeping
Sleeping
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() | |
# |