palbha commited on
Commit
0623b1b
·
verified ·
1 Parent(s): d723026

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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
- image_path = run_agent(query)
 
69
 
70
  # Return the image to Gradio for display
71
- return image_path
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.Image(), # Image output to display the fetched image
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()