Spaces:
Runtime error
Runtime error
David Li
commited on
Commit
•
62b066e
1
Parent(s):
e1d8031
fix: improve code
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ def get_text_from_mp3_whisper(mp3_file: str)->str:
|
|
6 |
model = whisper.load_model("base")
|
7 |
# options = whisper.DecodingOptions(language="en", without_timestamps=True)
|
8 |
result = model.transcribe(mp3_file)
|
9 |
-
return result.get("text", "No text found")
|
10 |
|
11 |
|
12 |
|
@@ -17,6 +17,6 @@ gr.Interface(
|
|
17 |
gr.inputs.Audio(type="filepath")
|
18 |
],
|
19 |
outputs=[
|
20 |
-
"textbox"
|
21 |
],
|
22 |
live=True).launch()
|
|
|
6 |
model = whisper.load_model("base")
|
7 |
# options = whisper.DecodingOptions(language="en", without_timestamps=True)
|
8 |
result = model.transcribe(mp3_file)
|
9 |
+
return result.get("text", "No text found"), result.get("segments", {})
|
10 |
|
11 |
|
12 |
|
|
|
17 |
gr.inputs.Audio(type="filepath")
|
18 |
],
|
19 |
outputs=[
|
20 |
+
"textbox", "json"
|
21 |
],
|
22 |
live=True).launch()
|