Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import json
|
2 |
from faster_whisper import WhisperModel # Assuming you have installed this library
|
3 |
|
@@ -62,6 +63,12 @@ def transcribe_audio(audiofilename):
|
|
62 |
linelevel_subtitles = split_text_into_lines(wordlevel_info)
|
63 |
return linelevel_subtitles
|
64 |
|
65 |
-
audiofile
|
66 |
-
transcription = transcribe_audio(audiofile)
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
import json
|
3 |
from faster_whisper import WhisperModel # Assuming you have installed this library
|
4 |
|
|
|
63 |
linelevel_subtitles = split_text_into_lines(wordlevel_info)
|
64 |
return linelevel_subtitles
|
65 |
|
66 |
+
def audio_transcription(audiofile):
|
67 |
+
transcription = transcribe_audio(audiofile)
|
68 |
+
return json.dumps(transcription, indent=4)
|
69 |
+
|
70 |
+
iface = gr.Interface(audio_transcription,
|
71 |
+
gr.inputs.Audio(sources="upload", type="file"),
|
72 |
+
"text",
|
73 |
+
description="Upload an audio file and get its transcription in JSON format.")
|
74 |
+
iface.launch()
|