Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -196,7 +196,7 @@ def get_example():
|
|
196 |
]
|
197 |
|
198 |
with gr.Blocks(theme= "gstaff/xkcd" ) as demo:
|
199 |
-
gr.Markdown("
|
200 |
|
201 |
|
202 |
with gr.Row():
|
@@ -205,16 +205,16 @@ with gr.Blocks(theme= "gstaff/xkcd" ) as demo:
|
|
205 |
file = gr.File(file_types=["pdf"], file_count="multiple", label="Upload PDFs")
|
206 |
|
207 |
|
208 |
-
message = gr.Textbox("Files not yet
|
209 |
convert_button = gr.Button("🔄 Index documents")
|
210 |
embeds = gr.State(value=[])
|
211 |
imgs = gr.State(value=[])
|
212 |
img_chunk = gr.State(value=[])
|
213 |
|
214 |
with gr.Column(scale=3):
|
215 |
-
gr.Markdown("## 2️⃣ Search
|
216 |
query = gr.Textbox(placeholder="Enter your query here", label="Query")
|
217 |
-
k = gr.Slider(minimum=1, maximum=10, step=1, label="
|
218 |
search_button = gr.Button("🔍 Search", variant="primary")
|
219 |
|
220 |
with gr.Row():
|
@@ -225,13 +225,13 @@ with gr.Blocks(theme= "gstaff/xkcd" ) as demo:
|
|
225 |
|
226 |
# Define the actions
|
227 |
|
228 |
-
output_gallery = gr.Gallery(label="Retrieved Documents", height=600, show_label=True)
|
229 |
|
230 |
convert_button.click(index, inputs=[file, embeds], outputs=[message, embeds, imgs])
|
231 |
search_button.click(search, inputs=[query, embeds, imgs, k], outputs=[output_gallery])
|
232 |
|
233 |
-
gr.Markdown("## 3️⃣ Get your answer
|
234 |
-
answer_button = gr.Button("Answer", variant="primary")
|
235 |
output = gr.Markdown(label="Output")
|
236 |
answer_button.click(model_inference, inputs=[output_gallery, query], outputs=output)
|
237 |
|
|
|
196 |
]
|
197 |
|
198 |
with gr.Blocks(theme= "gstaff/xkcd" ) as demo:
|
199 |
+
gr.Markdown("🤓 Mulimoal RAGBOT: Ask Me About the Images 🌅 in Your PDF📚")
|
200 |
|
201 |
|
202 |
with gr.Row():
|
|
|
205 |
file = gr.File(file_types=["pdf"], file_count="multiple", label="Upload PDFs")
|
206 |
|
207 |
|
208 |
+
message = gr.Textbox("Files not yet chunked", label="Status")
|
209 |
convert_button = gr.Button("🔄 Index documents")
|
210 |
embeds = gr.State(value=[])
|
211 |
imgs = gr.State(value=[])
|
212 |
img_chunk = gr.State(value=[])
|
213 |
|
214 |
with gr.Column(scale=3):
|
215 |
+
gr.Markdown("## 2️⃣ Search the Image")
|
216 |
query = gr.Textbox(placeholder="Enter your query here", label="Query")
|
217 |
+
k = gr.Slider(minimum=1, maximum=10, step=1, label="batch", value=1)
|
218 |
search_button = gr.Button("🔍 Search", variant="primary")
|
219 |
|
220 |
with gr.Row():
|
|
|
225 |
|
226 |
# Define the actions
|
227 |
|
228 |
+
output_gallery = gr.Gallery(label="Retrieved Images From Your Documents", height=600, show_label=True)
|
229 |
|
230 |
convert_button.click(index, inputs=[file, embeds], outputs=[message, embeds, imgs])
|
231 |
search_button.click(search, inputs=[query, embeds, imgs, k], outputs=[output_gallery])
|
232 |
|
233 |
+
gr.Markdown("## 3️⃣ Get your answer")
|
234 |
+
answer_button = gr.Button("💁♀️Answer", variant="primary")
|
235 |
output = gr.Markdown(label="Output")
|
236 |
answer_button.click(model_inference, inputs=[output_gallery, query], outputs=output)
|
237 |
|