Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -137,14 +137,14 @@ with gr.Blocks() as app:
|
|
137 |
# Left Column for instructions
|
138 |
with gr.Column(scale=1, min_width=250):
|
139 |
gr.Markdown("""
|
140 |
-
<div style="background:
|
141 |
<h2 style="color: #fff; font-size: 32px; font-weight: bold;">DocAI: Document Assistant</h2>
|
142 |
<p style="color: #ddd; font-size: 18px;">Welcome to DocAI! Upload your documents and get intelligent answers based on their content.</p>
|
143 |
<p style="color: #ddd; font-size: 16px; line-height: 1.6;"><strong>Steps to use:</strong></p>
|
144 |
<ul style="color: #ddd; font-size: 16px; line-height: 1.6;">
|
145 |
<li>Upload your PDF or DOCX files.</li>
|
146 |
<li>Ask questions related to the document.</li>
|
147 |
-
|
148 |
<li>Click "Submit" to get your answers.</li>
|
149 |
</ul>
|
150 |
<p style="color: #ddd; font-size: 16px; line-height: 1.6;">Upload multiple files and get answers based on their contents.</p>
|
@@ -154,7 +154,7 @@ with gr.Blocks() as app:
|
|
154 |
# Right Column for the main application content
|
155 |
with gr.Column(scale=2, min_width=600):
|
156 |
gr.Markdown("""
|
157 |
-
<div style="background:
|
158 |
<h2 style="color: #fff; font-size: 36px; font-weight: bold; text-align: center; letter-spacing: 2px; text-transform: uppercase;">
|
159 |
Ask Your Document
|
160 |
</h2>
|
@@ -174,18 +174,18 @@ with gr.Blocks() as app:
|
|
174 |
|
175 |
# Question input
|
176 |
question_input = gr.Textbox(
|
177 |
-
label="Ask a question",
|
178 |
placeholder="Type your question here...",
|
179 |
interactive=True,
|
180 |
lines=2,
|
181 |
max_lines=4
|
182 |
)
|
183 |
|
184 |
-
# Summarize before sending checkbox
|
185 |
-
summarize_before_input = gr.Checkbox(
|
186 |
-
|
187 |
-
|
188 |
-
)
|
189 |
|
190 |
# Output text box with enhanced styling
|
191 |
output = gr.Textbox(
|
@@ -199,9 +199,9 @@ with gr.Blocks() as app:
|
|
199 |
submit_button = gr.Button("Submit", icon="send")
|
200 |
|
201 |
# Loading spinner
|
202 |
-
with gr.Row():
|
203 |
-
|
204 |
-
|
205 |
|
206 |
# Apply the logic for the button to trigger the RAG pipeline
|
207 |
submit_button.click(rag_pipeline, inputs=[file_input, question_input, summarize_before_input], outputs=output)
|
|
|
137 |
# Left Column for instructions
|
138 |
with gr.Column(scale=1, min_width=250):
|
139 |
gr.Markdown("""
|
140 |
+
<div style="background: #3498db; padding: 30px; border-radius: 12px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); font-family: 'Roboto', sans-serif;">
|
141 |
<h2 style="color: #fff; font-size: 32px; font-weight: bold;">DocAI: Document Assistant</h2>
|
142 |
<p style="color: #ddd; font-size: 18px;">Welcome to DocAI! Upload your documents and get intelligent answers based on their content.</p>
|
143 |
<p style="color: #ddd; font-size: 16px; line-height: 1.6;"><strong>Steps to use:</strong></p>
|
144 |
<ul style="color: #ddd; font-size: 16px; line-height: 1.6;">
|
145 |
<li>Upload your PDF or DOCX files.</li>
|
146 |
<li>Ask questions related to the document.</li>
|
147 |
+
|
148 |
<li>Click "Submit" to get your answers.</li>
|
149 |
</ul>
|
150 |
<p style="color: #ddd; font-size: 16px; line-height: 1.6;">Upload multiple files and get answers based on their contents.</p>
|
|
|
154 |
# Right Column for the main application content
|
155 |
with gr.Column(scale=2, min_width=600):
|
156 |
gr.Markdown("""
|
157 |
+
<div style="background: #3498db; padding: 20px; border-radius: 15px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); font-family: 'Roboto', sans-serif;">
|
158 |
<h2 style="color: #fff; font-size: 36px; font-weight: bold; text-align: center; letter-spacing: 2px; text-transform: uppercase;">
|
159 |
Ask Your Document
|
160 |
</h2>
|
|
|
174 |
|
175 |
# Question input
|
176 |
question_input = gr.Textbox(
|
177 |
+
label="Ask a question related your document",
|
178 |
placeholder="Type your question here...",
|
179 |
interactive=True,
|
180 |
lines=2,
|
181 |
max_lines=4
|
182 |
)
|
183 |
|
184 |
+
# # Summarize before sending checkbox
|
185 |
+
# summarize_before_input = gr.Checkbox(
|
186 |
+
# label="Summarize Before Sending",
|
187 |
+
# value=False
|
188 |
+
# )
|
189 |
|
190 |
# Output text box with enhanced styling
|
191 |
output = gr.Textbox(
|
|
|
199 |
submit_button = gr.Button("Submit", icon="send")
|
200 |
|
201 |
# Loading spinner
|
202 |
+
# with gr.Row():
|
203 |
+
# with gr.Column(scale=1, min_width=250):
|
204 |
+
# gr.Markdown("<div style='font-size: 14px; color: #555;'>Your answer will appear here...</div>")
|
205 |
|
206 |
# Apply the logic for the button to trigger the RAG pipeline
|
207 |
submit_button.click(rag_pipeline, inputs=[file_input, question_input, summarize_before_input], outputs=output)
|