KingNish commited on
Commit
edd1760
1 Parent(s): c533de0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
 
3
  # Import modules from other files
4
  from chatbot import chatbot, model_inference, BOT_AVATAR, EXAMPLES, model_selector, decoding_strategy, temperature, max_new_tokens, repetition_penalty, top_p
5
- from voice_chat import respond
6
  from live_chat import videochat
7
 
8
  # Define Gradio theme
@@ -76,10 +76,10 @@ with gr.Blocks(
76
  # Voice chat block
77
  with gr.Blocks() as voice:
78
  with gr.Row():
79
- input = gr.Audio(label="Voice Chat (BETA)", sources="microphone", type="filepath", waveform_options=False)
80
- output = gr.Audio(label="JARVIS", type="filepath", interactive=False, autoplay=True, elem_classes="audio")
81
- gr.Interface(fn=respond, inputs=[input], outputs=[output])
82
- input.stop_recording(fn=respond, inputs=[input], outputs=[output])
83
 
84
 
85
  # Live chat block
 
2
 
3
  # Import modules from other files
4
  from chatbot import chatbot, model_inference, BOT_AVATAR, EXAMPLES, model_selector, decoding_strategy, temperature, max_new_tokens, repetition_penalty, top_p
5
+ from voice_chat import respond, model, transcribe, search
6
  from live_chat import videochat
7
 
8
  # Define Gradio theme
 
76
  # Voice chat block
77
  with gr.Blocks() as voice:
78
  with gr.Row():
79
+ web_search = gr.Checkbox(label="Web Search", value=False)
80
+ input = gr.Audio(label="Voice Chat", sources="microphone")
81
+ output = gr.Audio(label="AI",autoplay=True)
82
+ gr.Interface(fn=respond, inputs=[input, web_search], outputs=[output], live=True, batch=True, max_batch_size=20, delete_cache=(60,60))
83
 
84
 
85
  # Live chat block