on1onmangoes commited on
Commit
f16d889
·
verified ·
1 Parent(s): 8158395

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -11
app.py CHANGED
@@ -729,19 +729,41 @@ def response(audio: tuple[int, np.ndarray], conversation_llm_format: list[dict],
729
  ##-------------- Added by AL based on feedback from Claude -----------
730
 
731
  with gr.Blocks(css=css_code) as demo:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
732
  with gr.Group():
733
- with gr.Row(variant="compact", height="10px"):
734
- chatbot = gr.Chatbot(label="Conversation", type="messages", visible=False, render=False)
735
  with gr.Row():
736
- with gr.Column():
737
- with gr.Row():
738
- set_key_button = gr.Button("Ask ZZK", variant="primary")
739
- with gr.Column():
740
  with gr.Row():
741
- audio = WebRTC(modality="audio", mode="send-receive",
742
- label="Audio Stream",
743
- rtc_configuration=rtc_configuration)
744
-
 
 
745
  client_state = gr.State(None)
746
  conversation_llm_format = gr.State([])
747
  set_key_button.click(set_api_key, inputs=[],
@@ -753,6 +775,5 @@ with gr.Blocks(css=css_code) as demo:
753
  )
754
  audio.on_additional_outputs(lambda l, g: (l, g), outputs=[conversation_llm_format, chatbot])
755
 
756
-
757
  if __name__ == "__main__":
758
  demo.launch(show_error=True)
 
729
  ##-------------- Added by AL based on feedback from Claude -----------
730
 
731
  with gr.Blocks(css=css_code) as demo:
732
+ # with gr.Group():
733
+ # with gr.Row(variant="compact", height="10px"):
734
+ # chatbot = gr.Chatbot(label="Conversation", type="messages", visible=False, render=False)
735
+ # with gr.Row():
736
+ # with gr.Column():
737
+ # with gr.Row():
738
+ # set_key_button = gr.Button("Ask ZZK", variant="primary")
739
+ # with gr.Column():
740
+ # with gr.Row():
741
+ # audio = WebRTC(modality="audio", mode="send-receive",
742
+ # label="Audio Stream",
743
+ # rtc_configuration=rtc_configuration)
744
+
745
+ # client_state = gr.State(None)
746
+ # conversation_llm_format = gr.State([])
747
+ # set_key_button.click(set_api_key, inputs=[],
748
+ # outputs=[client_state, set_key_button])
749
+ # audio.stream(
750
+ # ReplyOnPause(response),
751
+ # inputs=[audio, conversation_llm_format, chatbot, client_state],
752
+ # outputs=[audio]
753
+ # )
754
+ # audio.on_additional_outputs(lambda l, g: (l, g), outputs=[conversation_llm_format, chatbot])
755
  with gr.Group():
 
 
756
  with gr.Row():
757
+ chatbot = gr.Chatbot(label="Conversation", type="messages")
758
+ with gr.Row(equal_height=True):
759
+ with gr.Column(scale=1):
 
760
  with gr.Row():
761
+ set_key_button = gr.Button("Set Radar", variant="primary")
762
+ with gr.Column(scale=5):
763
+ audio = WebRTC(modality="audio", mode="send-receive",
764
+ label="Audio Stream",
765
+ rtc_configuration=rtc_configuration)
766
+
767
  client_state = gr.State(None)
768
  conversation_llm_format = gr.State([])
769
  set_key_button.click(set_api_key, inputs=[],
 
775
  )
776
  audio.on_additional_outputs(lambda l, g: (l, g), outputs=[conversation_llm_format, chatbot])
777
 
 
778
  if __name__ == "__main__":
779
  demo.launch(show_error=True)