Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -65,17 +65,18 @@ def run_agent(query: str):
|
|
| 65 |
# Gradio interface to show images
|
| 66 |
def gradio_interface(query: str):
|
| 67 |
# Call the agent to run the query and return the image
|
| 68 |
-
|
|
|
|
| 69 |
|
| 70 |
# Return the image to Gradio for display
|
| 71 |
-
return
|
| 72 |
|
| 73 |
|
| 74 |
# Set up Gradio interface
|
| 75 |
gr.Interface(
|
| 76 |
fn=gradio_interface,
|
| 77 |
inputs="text", # Text input for the search query
|
| 78 |
-
outputs=gr.
|
| 79 |
title="Figure, Image & Logo Finder",
|
| 80 |
description="Enter a query to search for relevant images, logos, or figures for your presentation."
|
| 81 |
).launch()
|
|
|
|
| 65 |
# Gradio interface to show images
|
| 66 |
def gradio_interface(query: str):
|
| 67 |
# Call the agent to run the query and return the image
|
| 68 |
+
image_paths = run_agent(query)
|
| 69 |
+
images = [Image.open(image_path) for image_path in image_paths]
|
| 70 |
|
| 71 |
# Return the image to Gradio for display
|
| 72 |
+
return images
|
| 73 |
|
| 74 |
|
| 75 |
# Set up Gradio interface
|
| 76 |
gr.Interface(
|
| 77 |
fn=gradio_interface,
|
| 78 |
inputs="text", # Text input for the search query
|
| 79 |
+
outputs=gr.Gallery(label="Found Images").style(grid=3), # Image output to display the fetched image
|
| 80 |
title="Figure, Image & Logo Finder",
|
| 81 |
description="Enter a query to search for relevant images, logos, or figures for your presentation."
|
| 82 |
).launch()
|