AlexMo commited on
Commit
399b64e
1 Parent(s): 489328e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -20
app.py CHANGED
@@ -13,8 +13,7 @@ def transcribe(microphone, file_upload):
13
  warn_output = ""
14
  if (microphone is not None) and (file_upload is not None):
15
  warn_output = (
16
- "WARNING: You've uploaded an audio file and used the microphone. "
17
- "The recorded file from the microphone will be used and the uploaded audio will be discarded.\n"
18
  )
19
 
20
  elif (microphone is None) and (file_upload is None):
@@ -22,8 +21,8 @@ def transcribe(microphone, file_upload):
22
 
23
  file = microphone if microphone is not None else file_upload
24
 
25
- text = summarizer(file)["text"]
26
-
27
  return warn_output + text
28
 
29
  def getAudio(url):
@@ -50,22 +49,6 @@ def getSummary(article):
50
 
51
  return b
52
 
53
- mf_transcribe = gr.Interface(
54
- fn=transcribe,
55
- inputs=[
56
- gr.inputs.Audio(source="microphone", type="filepath", optional=True),
57
- gr.inputs.Audio(source="upload", type="filepath", optional=True),
58
- ],
59
- outputs="text",
60
- layout="horizontal",
61
- theme="huggingface",
62
- title="Dutch whisper summarizer",
63
- description=(
64
- "Get a transcription and summary of some Dutch audio input!."
65
- ),
66
- allow_flagging="never",
67
- )
68
-
69
 
70
  with gr.Blocks() as demo:
71
  gr.HTML(
 
13
  warn_output = ""
14
  if (microphone is not None) and (file_upload is not None):
15
  warn_output = (
16
+ "NOTE: The audio file will be discarded after this run.\n"
 
17
  )
18
 
19
  elif (microphone is None) and (file_upload is None):
 
21
 
22
  file = microphone if microphone is not None else file_upload
23
 
24
+ text = model(file)["text"]
25
+
26
  return warn_output + text
27
 
28
  def getAudio(url):
 
49
 
50
  return b
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
  with gr.Blocks() as demo:
54
  gr.HTML(