Spaces:
Runtime error
Runtime error
David_A
commited on
Commit
Β·
4906acb
1
Parent(s):
b5e0c18
Chargement application
Browse files- README.md +5 -5
- app.py +27 -0
- requirements.txt +5 -0
README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
---
|
2 |
-
title: Transcription
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 3.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: mit
|
|
|
1 |
---
|
2 |
+
title: Transcription Whisper
|
3 |
+
emoji: π
|
4 |
+
colorFrom: indigo
|
5 |
+
colorTo: green
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 3.32.0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: mit
|
app.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import whisper
|
3 |
+
import ffmpeg
|
4 |
+
import streamlit.components.v1 as components
|
5 |
+
|
6 |
+
|
7 |
+
def transcribe_audio(audio_file):
|
8 |
+
model = whisper.load_model("small")
|
9 |
+
result = model.transcribe(audio_file, fp16=False)
|
10 |
+
return result["text"]
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
def main():
|
15 |
+
audio_input = gr.inputs.Audio(source="upload", type="filepath")
|
16 |
+
output_text = gr.outputs.Textbox()
|
17 |
+
iface = gr.Interface(fn=transcribe_audio, inputs=audio_input,
|
18 |
+
outputs=output_text, title="Transciption Audio",
|
19 |
+
description="Charger l'audio")
|
20 |
+
|
21 |
+
iface.launch(auth=("admin", "pass1234"))
|
22 |
+
|
23 |
+
|
24 |
+
if __name__ == '__main__':
|
25 |
+
main()
|
26 |
+
|
27 |
+
#
|
requirements.txt
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
openai-whisper
|
2 |
+
setuptools-rust
|
3 |
+
ffmpeg-python
|
4 |
+
gradio
|
5 |
+
streamlit
|