Spaces:
Runtime error
Runtime error
fixed Gallery grid
Browse files
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 =
|
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=
|
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__":
|