marinap commited on
Commit
194e5e6
·
1 Parent(s): 01bf704

fixed Gallery grid

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -47,7 +47,7 @@ def find_topk(text):
47
  print('top_k_urls', top_k_urls)
48
  print(datetime.now().strftime("%H:%M:%S"))
49
 
50
- images = [url2img(url, resize = True) for url in top_k_urls]
51
 
52
  print('got PIL images')
53
  print(datetime.now().strftime("%H:%M:%S"))
@@ -91,7 +91,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
91
  prompt_box = gr.Textbox(label = 'Enter your prompt', lines = 3)
92
  btn_search = gr.Button("Find images")
93
 
94
- gallery = gr.Gallery().style(columns=[5], rows=[4], object_fit="contain", height="auto")
95
  btn_search.click(find_topk, inputs = prompt_box, outputs = gallery)
96
 
97
  if __name__ == "__main__":
 
47
  print('top_k_urls', top_k_urls)
48
  print(datetime.now().strftime("%H:%M:%S"))
49
 
50
+ images = [url2img(url, resize = False) for url in top_k_urls]
51
 
52
  print('got PIL images')
53
  print(datetime.now().strftime("%H:%M:%S"))
 
91
  prompt_box = gr.Textbox(label = 'Enter your prompt', lines = 3)
92
  btn_search = gr.Button("Find images")
93
 
94
+ gallery = gr.Gallery().style(columns=5, rows=4, object_fit="contain", height="auto")
95
  btn_search.click(find_topk, inputs = prompt_box, outputs = gallery)
96
 
97
  if __name__ == "__main__":