Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -29,6 +29,15 @@ def transcribe(audio, state="", uploaded_audio=None):
|
|
29 |
except Exception as e:
|
30 |
return "An error occurred during transcription.", state # Handle other exceptions
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
gr.Interface(
|
34 |
fn=transcribe,
|
@@ -39,7 +48,8 @@ gr.Interface(
|
|
39 |
],
|
40 |
outputs=[
|
41 |
"textbox",
|
42 |
-
"state"
|
|
|
43 |
],
|
44 |
live=True).launch()
|
45 |
|
|
|
29 |
except Exception as e:
|
30 |
return "An error occurred during transcription.", state # Handle other exceptions
|
31 |
|
32 |
+
def save_to_file(text):
|
33 |
+
with open("transcription_output.txt", "w") as f:
|
34 |
+
f.write(text)
|
35 |
+
|
36 |
+
def download_button(text):
|
37 |
+
save_to_file(text)
|
38 |
+
return "Download Complete!"
|
39 |
+
|
40 |
+
|
41 |
|
42 |
gr.Interface(
|
43 |
fn=transcribe,
|
|
|
48 |
],
|
49 |
outputs=[
|
50 |
"textbox",
|
51 |
+
"state",
|
52 |
+
gr.outputs.Button("Download Transcription")
|
53 |
],
|
54 |
live=True).launch()
|
55 |
|