ihanif commited on
Commit
fef2eb2
1 Parent(s): f651cd7

Remove warning message and second audio example

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -25,15 +25,18 @@ pipe = pipeline(
25
 
26
  def transcribe(microphone, file_upload):
27
  warn_output = ""
28
- if (microphone is not None) and (file_upload is not None):
29
- warn_output = (
30
- "WARNING: You've uploaded an audio file and used the microphone. "
31
- "The recorded file from the microphone will be used and the uploaded audio will be discarded.\n"
32
- )
33
 
34
- elif (microphone is None) and (file_upload is None):
35
- return "ERROR: You have to either use the microphone or upload an audio file"
36
 
 
 
 
37
  file = microphone if microphone is not None else file_upload
38
 
39
  text = pipe(file)["text"]
@@ -64,7 +67,8 @@ def yt_transcribe(yt_url):
64
 
65
  demo = gr.Blocks()
66
 
67
- examples=[["example-1.wav","example-2.wav"]]
 
68
 
69
  mf_transcribe = gr.Interface(
70
  fn=transcribe,
 
25
 
26
  def transcribe(microphone, file_upload):
27
  warn_output = ""
28
+ # if (microphone is not None) and (file_upload is not None):
29
+ # warn_output = (
30
+ # "WARNING: You've uploaded an audio file and used the microphone. "
31
+ # "The recorded file from the microphone will be used and the uploaded audio will be discarded.\n"
32
+ # )
33
 
34
+ # elif (microphone is None) and (file_upload is None):
35
+ # return "ERROR: You have to either use the microphone or upload an audio file"
36
 
37
+ if (microphone is None) and (file_upload is None):
38
+ return "ERROR: You have to either use the microphone or upload an audio file"
39
+
40
  file = microphone if microphone is not None else file_upload
41
 
42
  text = pipe(file)["text"]
 
67
 
68
  demo = gr.Blocks()
69
 
70
+ # examples=[["example-1.wav","example-2.wav"]]
71
+ examples=[["example-1.wav"]]
72
 
73
  mf_transcribe = gr.Interface(
74
  fn=transcribe,