Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -47,8 +47,25 @@ def find_best_matches(text):
|
|
47 |
return matched_images
|
48 |
|
49 |
|
50 |
-
#Gradio app
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
return matched_images
|
48 |
|
49 |
|
50 |
+
#Gradio app
|
51 |
+
with gr.Blocks() as demo:
|
52 |
+
with gr.Column(variant="panel"):
|
53 |
+
with gr.Row(variant="compact"):
|
54 |
+
text = gr.Textbox(
|
55 |
+
label="Search product",
|
56 |
+
show_label=False,
|
57 |
+
max_lines=1,
|
58 |
+
placeholder="Type product",
|
59 |
+
).style(
|
60 |
+
container=False,
|
61 |
+
)
|
62 |
+
btn = gr.Button("Search").style(full_width=False)
|
63 |
+
|
64 |
+
gallery = gr.Gallery(
|
65 |
+
label="Products", show_label=False, elem_id="gallery"
|
66 |
+
).style(grid=[2], height="auto")
|
67 |
+
|
68 |
+
btn.click(find_best_matches, None, gallery)
|
69 |
+
|
70 |
+
|
71 |
+
demo.launch()
|