Shreyas094 commited on
Commit
188f825
·
verified ·
1 Parent(s): 565ca72

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -23
app.py CHANGED
@@ -687,6 +687,16 @@ with gr.Blocks() as demo:
687
 
688
  audio_input = gr.Audio(sources=["microphone"], type="numpy", label="Speak your query")
689
 
 
 
 
 
 
 
 
 
 
 
690
  chat_interface = gr.ChatInterface(
691
  fn=process_input,
692
  additional_inputs=[
@@ -697,32 +707,11 @@ with gr.Blocks() as demo:
697
  gr.CheckboxGroup(label="Select documents to query"),
698
  audio_input
699
  ],
700
- chatbot=gr.Chatbot(
701
- show_copy_button=True,
702
- likeable=True,
703
- layout="bubble",
704
- height=400,
705
- value=initial_conversation()
706
- ),
707
  title="AI-powered PDF Chat and Web Search Assistant",
708
  description="Chat with your PDFs, use web search to answer questions, or speak your query.",
709
  theme=gr.themes.Soft(
710
- primary_hue="orange",
711
- secondary_hue="amber",
712
- neutral_hue="gray",
713
- font=[gr.themes.GoogleFont("Exo"), "ui-sans-serif", "system-ui", "sans-serif"]
714
- ).set(
715
- body_background_fill_dark="#0c0505",
716
- block_background_fill_dark="#0c0505",
717
- block_border_width="1px",
718
- block_title_background_fill_dark="#1b0f0f",
719
- input_background_fill_dark="#140b0b",
720
- button_secondary_background_fill_dark="#140b0b",
721
- border_color_accent_dark="#1b0f0f",
722
- border_color_primary_dark="#1b0f0f",
723
- background_fill_secondary_dark="#0c0505",
724
- color_accent_soft_dark="transparent",
725
- code_background_fill_dark="#140b0b"
726
  ),
727
  css=css,
728
  examples=[
 
687
 
688
  audio_input = gr.Audio(sources=["microphone"], type="numpy", label="Speak your query")
689
 
690
+ # Create the Chatbot component separately
691
+ chatbot = gr.Chatbot(
692
+ show_copy_button=True,
693
+ likeable=True,
694
+ layout="bubble",
695
+ height=400,
696
+ value=initial_conversation()
697
+ )
698
+
699
+ # Create the ChatInterface using the pre-defined Chatbot
700
  chat_interface = gr.ChatInterface(
701
  fn=process_input,
702
  additional_inputs=[
 
707
  gr.CheckboxGroup(label="Select documents to query"),
708
  audio_input
709
  ],
710
+ chatbot=chatbot, # Use the pre-defined Chatbot
 
 
 
 
 
 
711
  title="AI-powered PDF Chat and Web Search Assistant",
712
  description="Chat with your PDFs, use web search to answer questions, or speak your query.",
713
  theme=gr.themes.Soft(
714
+ # ... (theme configuration remains the same)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
715
  ),
716
  css=css,
717
  examples=[