Spaces:
Runtime error
Runtime error
David_A
commited on
Commit
·
d187c24
1
Parent(s):
1f80a68
whisper-web-app
Browse files- requirements.txt +4 -0
- web-app.py +24 -0
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
openai-whisper
|
2 |
+
setuptools-rust
|
3 |
+
ffmpeg-python
|
4 |
+
gradio
|
web-app.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import whisper
|
3 |
+
import ffmpeg
|
4 |
+
|
5 |
+
|
6 |
+
def transcribe_audio(audio_file):
|
7 |
+
model = whisper.load_model("medium")
|
8 |
+
result = model.transcribe(audio_file, fp16=False)
|
9 |
+
return result["text"]
|
10 |
+
|
11 |
+
|
12 |
+
def main():
|
13 |
+
audio_input = gr.inputs.Audio(source="upload", type="filepath")
|
14 |
+
output_text = gr.outputs.Textbox()
|
15 |
+
|
16 |
+
iface = gr.Interface(fn=transcribe_audio, inputs=audio_input,
|
17 |
+
outputs=output_text, title="Transciption Audio DITALIXSA",
|
18 |
+
description="Charger l'audio")
|
19 |
+
|
20 |
+
iface.launch()
|
21 |
+
|
22 |
+
|
23 |
+
if __name__ == '__main__':
|
24 |
+
main()
|