Update app.py
Browse files
app.py
CHANGED
@@ -202,17 +202,22 @@ with gr.Blocks(theme=gr.themes.Ocean()) as demo:
|
|
202 |
file_types=[".pdf"], file_count="multiple", label="Upload PDFs"
|
203 |
)
|
204 |
|
|
|
205 |
convert_button = gr.Button("🔄 Index documents")
|
206 |
message = gr.Textbox("Files not yet uploaded", label="Status")
|
207 |
-
api_key = gr.Textbox(
|
208 |
-
|
209 |
-
|
210 |
-
)
|
211 |
embeds = gr.State(value=[])
|
212 |
imgs = gr.State(value=[])
|
213 |
|
214 |
with gr.Column(scale=3):
|
215 |
-
gr.Markdown("##
|
|
|
|
|
|
|
|
|
216 |
query = gr.Textbox(placeholder="Enter your query here", label="Query")
|
217 |
k = gr.Slider(
|
218 |
minimum=1,
|
@@ -225,11 +230,13 @@ with gr.Blocks(theme=gr.themes.Ocean()) as demo:
|
|
225 |
|
226 |
# Define the output components
|
227 |
search_button = gr.Button("🔍 Search", variant="primary")
|
228 |
-
|
|
|
229 |
output_gallery = gr.Gallery(
|
230 |
label="Retrieved Documents", height=600, show_label=True
|
231 |
)
|
232 |
-
|
|
|
233 |
output_text = gr.Textbox(
|
234 |
label="AI Response",
|
235 |
placeholder="Generated response based on retrieved documents",
|
|
|
202 |
file_types=[".pdf"], file_count="multiple", label="Upload PDFs"
|
203 |
)
|
204 |
|
205 |
+
gr.Markdown("## 2️⃣ Index the PDFs")
|
206 |
convert_button = gr.Button("🔄 Index documents")
|
207 |
message = gr.Textbox("Files not yet uploaded", label="Status")
|
208 |
+
# api_key = gr.Textbox(
|
209 |
+
# placeholder="Enter your Gemini API key here (must be valid)",
|
210 |
+
# label="API key",
|
211 |
+
# )
|
212 |
embeds = gr.State(value=[])
|
213 |
imgs = gr.State(value=[])
|
214 |
|
215 |
with gr.Column(scale=3):
|
216 |
+
gr.Markdown("## 3️⃣ Search")
|
217 |
+
api_key = gr.Textbox(
|
218 |
+
placeholder="Enter your Gemini API key here (must be valid)",
|
219 |
+
label="API key",
|
220 |
+
)
|
221 |
query = gr.Textbox(placeholder="Enter your query here", label="Query")
|
222 |
k = gr.Slider(
|
223 |
minimum=1,
|
|
|
230 |
|
231 |
# Define the output components
|
232 |
search_button = gr.Button("🔍 Search", variant="primary")
|
233 |
+
|
234 |
+
gr.Markdown("## 4️⃣ Retrieved Image")
|
235 |
output_gallery = gr.Gallery(
|
236 |
label="Retrieved Documents", height=600, show_label=True
|
237 |
)
|
238 |
+
|
239 |
+
gr.Markdown("## 5️⃣ Gemini Response")
|
240 |
output_text = gr.Textbox(
|
241 |
label="AI Response",
|
242 |
placeholder="Generated response based on retrieved documents",
|