dineshb commited on
Commit
7b16031
·
1 Parent(s): 9a63a49

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -65,10 +65,19 @@ def yt_transcribe(yt_url, task):
65
 
66
  text = pipe("audio.mp3", batch_size=BATCH_SIZE)["text"]
67
 
68
- return html_embed_str, text
 
 
 
 
 
 
 
 
69
 
70
  demo = gr.Blocks()
71
  output_2 = gr.File(label="Download")
 
72
  description = """This application displays transcribed text for given audio input <img src="https://i.ibb.co/J5DscKw/GVP-Womens.jpg" width=100px>"""
73
  mf_transcribe = gr.Interface(
74
  fn=transcribe,
@@ -91,7 +100,7 @@ yt_transcribe = gr.Interface(
91
  gr.inputs.Textbox(lines=1, placeholder="Paste the URL to a YouTube video here", label="YouTube URL"),
92
  gr.inputs.Radio(["transcribe", "translate"], label="Task", default="transcribe")
93
  ],
94
- outputs=["html", "text"],
95
  layout="horizontal",
96
  theme="huggingface",
97
  title="Speech to Text Converter using OpenAI Whisper Model",
 
65
 
66
  text = pipe("audio.mp3", batch_size=BATCH_SIZE)["text"]
67
 
68
+
69
+ with open('outtt.txt', 'a+') as sw:
70
+ sw.writelines(text)
71
+
72
+ return [text,"outtt.txt"]
73
+
74
+
75
+
76
+
77
 
78
  demo = gr.Blocks()
79
  output_2 = gr.File(label="Download")
80
+ output_3 = gr.File(label="Download")
81
  description = """This application displays transcribed text for given audio input <img src="https://i.ibb.co/J5DscKw/GVP-Womens.jpg" width=100px>"""
82
  mf_transcribe = gr.Interface(
83
  fn=transcribe,
 
100
  gr.inputs.Textbox(lines=1, placeholder="Paste the URL to a YouTube video here", label="YouTube URL"),
101
  gr.inputs.Radio(["transcribe", "translate"], label="Task", default="transcribe")
102
  ],
103
+ outputs=["text",output_3],
104
  layout="horizontal",
105
  theme="huggingface",
106
  title="Speech to Text Converter using OpenAI Whisper Model",