Spaces:
Runtime error
Runtime error
smaller Gallery grid
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ def find_topk(text):
|
|
32 |
|
33 |
print('text', text)
|
34 |
|
35 |
-
top_k =
|
36 |
|
37 |
text_data = model_multi.preprocess_text(text)
|
38 |
text_features, text_embedding = model_multi.encode_text(text_data, return_features=True)
|
@@ -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=
|
95 |
btn_search.click(find_topk, inputs = prompt_box, outputs = gallery)
|
96 |
|
97 |
if __name__ == "__main__":
|
|
|
32 |
|
33 |
print('text', text)
|
34 |
|
35 |
+
top_k = 10
|
36 |
|
37 |
text_data = model_multi.preprocess_text(text)
|
38 |
text_features, text_embedding = model_multi.encode_text(text_data, return_features=True)
|
|
|
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=2, object_fit="contain", height="auto")
|
95 |
btn_search.click(find_topk, inputs = prompt_box, outputs = gallery)
|
96 |
|
97 |
if __name__ == "__main__":
|