DIGITALIXSA / app.py
David_A
logo_test_2
0c1583f
raw
history blame
818 Bytes
import gradio as gr
import whisper
import ffmpeg
def transcribe_audio(audio_file):
model = whisper.load_model("small")
result = model.transcribe(audio_file, fp16=False)
return result["text"]
def inference():
html = (
"<div >"
"<img src='file/logo-digitalix.png' alt='image One'>"
+ "</div>"
)
return html
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 DIGITALIXSA",
description=inference)
iface.launch(auth=("admin", "pass1234"))
if __name__ == '__main__':
main()
# description="Charger l'audio")