Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
import json
|
2 |
-
import gradio as gr
|
3 |
from faster_whisper import WhisperModel # Assuming you have installed this library
|
4 |
|
5 |
def split_text_into_lines(data):
|
@@ -63,14 +62,6 @@ def transcribe_audio(audiofilename):
|
|
63 |
linelevel_subtitles = split_text_into_lines(wordlevel_info)
|
64 |
return linelevel_subtitles
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
inputs = gr.inputs.File(label="Upload Audio File", type="audio")
|
71 |
-
outputs = gr.outputs.Json(label="Transcription Output")
|
72 |
-
|
73 |
-
title = "Audio Transcription"
|
74 |
-
description = "Upload an audio file and get the transcription in JSON format."
|
75 |
-
|
76 |
-
gr.Interface(fn=audio_transcription, inputs=inputs, outputs=outputs, title=title, description=description).launch()
|
|
|
1 |
import json
|
|
|
2 |
from faster_whisper import WhisperModel # Assuming you have installed this library
|
3 |
|
4 |
def split_text_into_lines(data):
|
|
|
62 |
linelevel_subtitles = split_text_into_lines(wordlevel_info)
|
63 |
return linelevel_subtitles
|
64 |
|
65 |
+
audiofile = "Intro.mp3" # Assuming you've uploaded the audio file as "input.mp3"
|
66 |
+
transcription = transcribe_audio(audiofile)
|
67 |
+
print(json.dumps(transcription, indent=4))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|