gpt-omni commited on
Commit
3811d15
1 Parent(s): f7f7077
Files changed (1) hide show
  1. app.py +18 -18
app.py CHANGED
@@ -333,28 +333,28 @@ def process_audio(audio):
333
  return OUT_RATE, audio_data.astype(np.int16)
334
 
335
 
336
- # Create the Gradio interface
337
- with gr.Blocks() as demo:
338
- # Input component: allows users to record or upload audio
339
- audio_input = gr.Audio(type="filepath", label="Record or Upload Audio")
340
 
341
- # Output component: audio output that will automatically play
342
- audio_output = gr.Audio(label="Processed Audio", streaming=streaming_output, autoplay=True)
343
 
344
- # Button to trigger processing after recording/uploading
345
- submit_btn = gr.Button("Submit")
346
 
347
- # Functionality: When the button is clicked, process the audio and output it
348
- submit_btn.click(fn=process_audio, inputs=audio_input, outputs=audio_output)
349
 
350
 
351
  if __name__ == '__main__':
352
- # demo = gr.Interface(
353
- # process_audio,
354
- # inputs=gr.Audio(type="filepath", label="Microphone"),
355
- # outputs=[gr.Audio(label="Response", streaming=streaming_output, autoplay=True)],
356
- # title="Chat Mini-Omni Demo",
357
- # live=True,
358
- # )
359
- # demo.queue()
360
  demo.launch()
 
333
  return OUT_RATE, audio_data.astype(np.int16)
334
 
335
 
336
+ # # Create the Gradio interface
337
+ # with gr.Blocks() as demo:
338
+ # # Input component: allows users to record or upload audio
339
+ # audio_input = gr.Audio(type="filepath", label="Record or Upload Audio")
340
 
341
+ # # Output component: audio output that will automatically play
342
+ # audio_output = gr.Audio(label="Processed Audio", streaming=streaming_output, autoplay=True)
343
 
344
+ # # Button to trigger processing after recording/uploading
345
+ # submit_btn = gr.Button("Submit")
346
 
347
+ # # Functionality: When the button is clicked, process the audio and output it
348
+ # submit_btn.click(fn=process_audio, inputs=audio_input, outputs=audio_output)
349
 
350
 
351
  if __name__ == '__main__':
352
+ demo = gr.Interface(
353
+ process_audio,
354
+ inputs=gr.Audio(type="filepath", label="Microphone"),
355
+ outputs=[gr.Audio(label="Response", streaming=streaming_output, autoplay=True)],
356
+ title="Chat Mini-Omni Demo",
357
+ live=True,
358
+ )
359
+ demo.queue()
360
  demo.launch()