-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
34 lines (29 loc) · 1.01 KB
/
app.py
File metadata and controls
34 lines (29 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# App #
# Import Packages
from gradio.themes.base import Base
from query import query_data
import gradio as gr
# App Interface
# Title
with gr.Blocks(theme=Base(), title="QnA App") as demo:
# Header
gr.Markdown("# Question Answering App Using Atlas Vector Search + RAG Architecture")
# Textbox and Button
textbox = gr.Textbox(label="Enter Your Question:")
with gr.Row():
button = gr.Button("Submit", variant="primary")
with gr.Column():
output1 = gr.Textbox(
lines=1,
max_lines=10,
label="Output Using Atlas Vector Search: (Returns Page Content)",
)
output2 = gr.Textbox(
lines=1,
max_lines=10,
label="Output Using Chaining: Atlas Vector Search -> LangChain RetrieverQA -> OpenAI LLM: (Returns Answer)",
)
# Button Click Event Handler Function Call
button.click(query_data, textbox, outputs=[output1, output2])
# Launch The App
demo.launch(share=True) # For Public Link Make share=True