Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,7 +33,7 @@ dataset = stl.selectbox(
|
|
| 33 |
|
| 34 |
embedded_data = None
|
| 35 |
embedder = None
|
| 36 |
-
|
| 37 |
search_term = None
|
| 38 |
ret_images = []
|
| 39 |
scores = []
|
|
@@ -53,8 +53,9 @@ def init_search(embedded_data):
|
|
| 53 |
return text_search
|
| 54 |
|
| 55 |
def get_images_from_description(description):
|
| 56 |
-
scores, ret_images = description, k_images=4)
|
| 57 |
return scores, ret_images
|
|
|
|
| 58 |
|
| 59 |
if dataset and stl.button("embed image dataset"):
|
| 60 |
with stl.spinner("Initializing and creating image embeddings from dataset"):
|
|
|
|
| 33 |
|
| 34 |
embedded_data = None
|
| 35 |
embedder = None
|
| 36 |
+
finder = None
|
| 37 |
search_term = None
|
| 38 |
ret_images = []
|
| 39 |
scores = []
|
|
|
|
| 53 |
return text_search
|
| 54 |
|
| 55 |
def get_images_from_description(description):
|
| 56 |
+
scores, ret_images = finder.get_nearest_examples(description, k_images=4)
|
| 57 |
return scores, ret_images
|
| 58 |
+
|
| 59 |
|
| 60 |
if dataset and stl.button("embed image dataset"):
|
| 61 |
with stl.spinner("Initializing and creating image embeddings from dataset"):
|