Alfie Grace commited on
Commit
8d0ae3b
·
1 Parent(s): 0687070

Removed talking head column and added settings tab back in

Browse files
Files changed (1) hide show
  1. app.py +27 -17
app.py CHANGED
@@ -615,23 +615,6 @@ with gr.Blocks(css=".gradio-container {background-color: black}") as block:
615
  show_label=False, lines=1, type='password')
616
 
617
  with gr.Row():
618
- with gr.Column(scale=1, min_width=TALKING_HEAD_WIDTH, visible=True):
619
- speak_text_cb = gr.Checkbox(label="Enable speech", value=False)
620
- speak_text_cb.change(update_foo, inputs=[speak_text_cb, speak_text_state],
621
- outputs=[speak_text_state])
622
-
623
- my_file = gr.File(label="Upload a file", type="file", visible=False)
624
- tmp_file = gr.File(LOOPING_TALKING_HEAD, visible=False)
625
- # tmp_file_url = "/file=" + tmp_file.value['name']
626
- htm_video = create_html_video(LOOPING_TALKING_HEAD, TALKING_HEAD_WIDTH)
627
- video_html = gr.HTML(htm_video)
628
-
629
- # my_aud_file = gr.File(label="Audio file", type="file", visible=True)
630
- tmp_aud_file = gr.File("audios/tempfile.mp3", visible=False)
631
- tmp_aud_file_url = "/file=" + tmp_aud_file.value['name']
632
- htm_audio = f'<audio><source src={tmp_aud_file_url} type="audio/mp3"></audio>'
633
- audio_html = gr.HTML(htm_audio)
634
-
635
  with gr.Column(scale=7):
636
  chatbot = gr.Chatbot()
637
 
@@ -641,6 +624,33 @@ with gr.Blocks(css=".gradio-container {background-color: black}") as block:
641
  lines=1)
642
  submit = gr.Button(value="Send", variant="secondary").style(full_width=False)
643
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
644
  message.submit(chat, inputs=[openai_api_key_textbox, message, history_state, chain_state, trace_chain_state,
645
  speak_text_state, talking_head_state, monologue_state,
646
  express_chain_state, num_words_state, formality_state,
 
615
  show_label=False, lines=1, type='password')
616
 
617
  with gr.Row():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
618
  with gr.Column(scale=7):
619
  chatbot = gr.Chatbot()
620
 
 
624
  lines=1)
625
  submit = gr.Button(value="Send", variant="secondary").style(full_width=False)
626
 
627
+ with gr.Tab("Settings"):
628
+ tools_cb_group = gr.CheckboxGroup(label="Tools:", choices=TOOLS_LIST,
629
+ value=TOOLS_DEFAULT_LIST)
630
+ tools_cb_group.change(update_selected_tools,
631
+ inputs=[tools_cb_group, tools_list_state, llm_state],
632
+ outputs=[tools_list_state, llm_state, chain_state, express_chain_state])
633
+
634
+ trace_chain_cb = gr.Checkbox(label="Show reasoning chain in chat bubble", value=False)
635
+ trace_chain_cb.change(update_foo, inputs=[trace_chain_cb, trace_chain_state],
636
+ outputs=[trace_chain_state])
637
+
638
+ # speak_text_cb = gr.Checkbox(label="Speak text from agent", value=False)
639
+ # speak_text_cb.change(update_foo, inputs=[speak_text_cb, speak_text_state],
640
+ # outputs=[speak_text_state])
641
+
642
+ talking_head_cb = gr.Checkbox(label="Show talking head", value=True)
643
+ talking_head_cb.change(update_talking_head, inputs=[talking_head_cb, talking_head_state],
644
+ outputs=[talking_head_state, video_html])
645
+
646
+ monologue_cb = gr.Checkbox(label="Babel fish mode (translate/restate what you enter, no conversational agent)",
647
+ value=False)
648
+ monologue_cb.change(update_foo, inputs=[monologue_cb, monologue_state],
649
+ outputs=[monologue_state])
650
+
651
+ reset_btn = gr.Button(value="Reset chat", variant="secondary").style(full_width=False)
652
+ reset_btn.click(reset_memory, inputs=[history_state, memory_state], outputs=[chatbot, history_state, memory_state])
653
+
654
  message.submit(chat, inputs=[openai_api_key_textbox, message, history_state, chain_state, trace_chain_state,
655
  speak_text_state, talking_head_state, monologue_state,
656
  express_chain_state, num_words_state, formality_state,