Shreyas094 commited on
Commit
9d6f4ef
·
verified ·
1 Parent(s): 5128c7d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -481,6 +481,8 @@ document_selector = gr.CheckboxGroup(label="Select documents to query")
481
 
482
  use_web_search = gr.Checkbox(label="Use Web Search", value=True)
483
 
 
 
484
  demo = gr.ChatInterface(
485
  respond,
486
  additional_inputs=[
@@ -488,10 +490,10 @@ demo = gr.ChatInterface(
488
  gr.Slider(minimum=0.1, maximum=1.0, value=0.2, step=0.1, label="Temperature"),
489
  gr.Slider(minimum=1, maximum=5, value=1, step=1, label="Number of API Calls"),
490
  use_web_search,
491
- document_selector # Add the document selector to the chat interface
492
  ],
493
  title="AI-powered Web Search and PDF Chat Assistant",
494
- description="Chat with your PDFs or use web search to answer questions (Please use toggle under Additional Inputs to swithc between PDF and Web Search, Default Value Web Search)",
495
  theme=gr.themes.Soft(
496
  primary_hue="orange",
497
  secondary_hue="amber",
@@ -518,6 +520,7 @@ demo = gr.ChatInterface(
518
  ],
519
  cache_examples=False,
520
  analytics_enabled=False,
 
521
  )
522
 
523
  # Add file upload functionality
 
481
 
482
  use_web_search = gr.Checkbox(label="Use Web Search", value=True)
483
 
484
+ custom_placeholder = "Ask a question (Note: You can toggle between Web Search and PDF Chat in Additional Inputs below)"
485
+
486
  demo = gr.ChatInterface(
487
  respond,
488
  additional_inputs=[
 
490
  gr.Slider(minimum=0.1, maximum=1.0, value=0.2, step=0.1, label="Temperature"),
491
  gr.Slider(minimum=1, maximum=5, value=1, step=1, label="Number of API Calls"),
492
  use_web_search,
493
+ document_selector
494
  ],
495
  title="AI-powered Web Search and PDF Chat Assistant",
496
+ description="Chat with your PDFs or use web search to answer questions. Toggle between Web Search and PDF Chat in Additional Inputs below.",
497
  theme=gr.themes.Soft(
498
  primary_hue="orange",
499
  secondary_hue="amber",
 
520
  ],
521
  cache_examples=False,
522
  analytics_enabled=False,
523
+ textbox=gr.Textbox(placeholder=custom_placeholder, container=False, scale=7),
524
  )
525
 
526
  # Add file upload functionality