rngzhi commited on
Commit
7fddde7
·
verified ·
1 Parent(s): 8e00d1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -3,15 +3,14 @@ import gradio as gr
3
  def process_audio(audio_file):
4
  # Load the model
5
  asr_model = gr.load("models/rngzhi/cs3264-project")
6
-
7
  result = asr_model(audio_file)
8
-
9
  return result.text
10
 
11
- iface = gr.Interface(
 
12
  fn=process_audio,
13
- inputs=gr.inputs.Audio(source="microphone", type="filepath", label="Upload an audio file or record from your microphone"),
14
- outputs="text"
15
  )
16
 
17
  # Launch the interface
 
3
  def process_audio(audio_file):
4
  # Load the model
5
  asr_model = gr.load("models/rngzhi/cs3264-project")
 
6
  result = asr_model(audio_file)
 
7
  return result.text
8
 
9
+
10
+ file_transcribe = gr.Interface(
11
  fn=process_audio,
12
+ inputs=gr.inputs.Audio(source="upload", type="filepath", optional=True, label="Audio file"),
13
+ outputs="text",
14
  )
15
 
16
  # Launch the interface