Spaces:
Sleeping
Sleeping
tensorkelechi
commited on
Commit
•
a646756
1
Parent(s):
72c69ab
Update app.py
Browse files
app.py
CHANGED
@@ -44,7 +44,7 @@ def embed_data(dataset):
|
|
44 |
dataset, retrieval_type="text-image", dataset_type="huggingface"
|
45 |
)
|
46 |
embedded_data = embedder.create_embeddings(device="cpu")
|
47 |
-
return embedded_data
|
48 |
|
49 |
@stl.cache_resource
|
50 |
def init_search(_embedded_data, embedder):
|
@@ -59,10 +59,10 @@ def get_images_from_description(description):
|
|
59 |
|
60 |
if dataset and stl.button("embed image dataset"):
|
61 |
with stl.spinner("Initializing and creating image embeddings from dataset"):
|
62 |
-
embedded_data = embed_data(dataset)
|
63 |
stl.success("Successfully embedded and created image index")
|
64 |
|
65 |
-
if embedded_data:
|
66 |
finder = init_search(embedded_data, embedder)
|
67 |
|
68 |
search_term = stl.text_input("Text description/search for image")
|
|
|
44 |
dataset, retrieval_type="text-image", dataset_type="huggingface"
|
45 |
)
|
46 |
embedded_data = embedder.create_embeddings(device="cpu")
|
47 |
+
return embedded_data. embedder
|
48 |
|
49 |
@stl.cache_resource
|
50 |
def init_search(_embedded_data, embedder):
|
|
|
59 |
|
60 |
if dataset and stl.button("embed image dataset"):
|
61 |
with stl.spinner("Initializing and creating image embeddings from dataset"):
|
62 |
+
embedded_data, embedder = embed_data(dataset)
|
63 |
stl.success("Successfully embedded and created image index")
|
64 |
|
65 |
+
if embedded_data and embedder:
|
66 |
finder = init_search(embedded_data, embedder)
|
67 |
|
68 |
search_term = stl.text_input("Text description/search for image")
|