Spaces:
Runtime error
Runtime error
fixing internal error
Browse files
app.py
CHANGED
|
@@ -2,7 +2,6 @@ import gradio as gr
|
|
| 2 |
import whisper
|
| 3 |
import os
|
| 4 |
|
| 5 |
-
|
| 6 |
model = whisper.load_model("base")
|
| 7 |
|
| 8 |
def transcribe_audio(audio_file):
|
|
@@ -12,10 +11,10 @@ def transcribe_audio(audio_file):
|
|
| 12 |
|
| 13 |
result = model.transcribe(audio_file.name)
|
| 14 |
output_filename = os.path.splitext(os.path.basename(audio_file.name))[0] + ".txt"
|
| 15 |
-
|
| 16 |
with open(output_filename, "w") as text_file:
|
| 17 |
text_file.write(result["text"])
|
| 18 |
-
|
| 19 |
return result["text"], output_filename
|
| 20 |
|
| 21 |
iface = gr.Interface(
|
|
|
|
| 2 |
import whisper
|
| 3 |
import os
|
| 4 |
|
|
|
|
| 5 |
model = whisper.load_model("base")
|
| 6 |
|
| 7 |
def transcribe_audio(audio_file):
|
|
|
|
| 11 |
|
| 12 |
result = model.transcribe(audio_file.name)
|
| 13 |
output_filename = os.path.splitext(os.path.basename(audio_file.name))[0] + ".txt"
|
| 14 |
+
|
| 15 |
with open(output_filename, "w") as text_file:
|
| 16 |
text_file.write(result["text"])
|
| 17 |
+
|
| 18 |
return result["text"], output_filename
|
| 19 |
|
| 20 |
iface = gr.Interface(
|