razhan commited on
Commit
8454d58
·
verified ·
1 Parent(s): 0392a4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -189,7 +189,7 @@ pipe = pipeline(
189
 
190
 
191
  @spaces.GPU
192
- def transcribe(inputs, task):
193
  if inputs is None:
194
  raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
195
 
@@ -237,7 +237,7 @@ def download_yt_audio(yt_url, filename):
237
  raise gr.Error(str(err))
238
 
239
  @spaces.GPU
240
- def yt_transcribe(yt_url, task, max_filesize=75.0):
241
  html_embed_str = _return_yt_html_embed(yt_url)
242
 
243
  with tempfile.TemporaryDirectory() as tmpdirname:
@@ -260,7 +260,7 @@ mf_transcribe = gr.Interface(
260
  fn=transcribe,
261
  inputs=[
262
  gr.Audio(sources="microphone", type="filepath"),
263
- gr.Radio(["transcribe", "translate"], label="Task", value="transcribe"),
264
  ],
265
  outputs="text",
266
  title="Whisper Central Kurdish‌ (Sorani) Demo: Transcribe Audio",
@@ -276,7 +276,7 @@ file_transcribe = gr.Interface(
276
  fn=transcribe,
277
  inputs=[
278
  gr.Audio(sources="upload", type="filepath", label="Audio file"),
279
- gr.Radio(["transcribe", "translate"], label="Task", value="transcribe"),
280
  ],
281
  outputs="text",
282
  title="Whisper Central Kurdish‌ (Sorani) Demo: Transcribe Audio",
@@ -292,7 +292,7 @@ yt_transcribe = gr.Interface(
292
  fn=yt_transcribe,
293
  inputs=[
294
  gr.Textbox(lines=1, placeholder="Paste the URL to a YouTube video here", label="YouTube URL"),
295
- gr.Radio(["transcribe", "translate"], label="Task", value="transcribe")
296
  ],
297
  outputs=["html", "text"],
298
  title="Whisper Central Kurdish‌ (Sorani) Demo: Transcribe YouTube",
 
189
 
190
 
191
  @spaces.GPU
192
+ def transcribe(inputs, task="transcribe"):
193
  if inputs is None:
194
  raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
195
 
 
237
  raise gr.Error(str(err))
238
 
239
  @spaces.GPU
240
+ def yt_transcribe(yt_url, task="transcribe", max_filesize=75.0):
241
  html_embed_str = _return_yt_html_embed(yt_url)
242
 
243
  with tempfile.TemporaryDirectory() as tmpdirname:
 
260
  fn=transcribe,
261
  inputs=[
262
  gr.Audio(sources="microphone", type="filepath"),
263
+ # gr.Radio(["transcribe", "translate"], label="Task", value="transcribe"),
264
  ],
265
  outputs="text",
266
  title="Whisper Central Kurdish‌ (Sorani) Demo: Transcribe Audio",
 
276
  fn=transcribe,
277
  inputs=[
278
  gr.Audio(sources="upload", type="filepath", label="Audio file"),
279
+ # gr.Radio(["transcribe", "translate"], label="Task", value="transcribe"),
280
  ],
281
  outputs="text",
282
  title="Whisper Central Kurdish‌ (Sorani) Demo: Transcribe Audio",
 
292
  fn=yt_transcribe,
293
  inputs=[
294
  gr.Textbox(lines=1, placeholder="Paste the URL to a YouTube video here", label="YouTube URL"),
295
+ # gr.Radio(["transcribe", "translate"], label="Task", value="transcribe")
296
  ],
297
  outputs=["html", "text"],
298
  title="Whisper Central Kurdish‌ (Sorani) Demo: Transcribe YouTube",