Spaces:
Sleeping
Sleeping
Ankitajadhav
commited on
Commit
•
fe984aa
1
Parent(s):
3efbabd
Update app.py
Browse files
app.py
CHANGED
@@ -44,16 +44,18 @@ embedding_function = OpenCLIPEmbeddingFunction()
|
|
44 |
image_loader = ImageLoader() # must be if you reads from URIs
|
45 |
|
46 |
# initialize separate collection for image and text data
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
|
|
57 |
# Get the uris to the images
|
58 |
IMAGE_FOLDER = 'images'
|
59 |
|
|
|
44 |
image_loader = ImageLoader() # must be if you reads from URIs
|
45 |
|
46 |
# initialize separate collection for image and text data
|
47 |
+
def create_collection(name_image_collection,name_text_collection)
|
48 |
+
collection_images = client.create_collection(
|
49 |
+
name=name_image_collection,
|
50 |
+
embedding_function=embedding_function,
|
51 |
+
data_loader=image_loader)
|
52 |
+
|
53 |
+
collection_text = client.create_collection(
|
54 |
+
name=name_text_collection,
|
55 |
+
embedding_function=embedding_function,
|
56 |
+
)
|
57 |
+
return collection_images, collection_text
|
58 |
+
collection_images,collection_text = create_collection(name_image_collection = "collection_images",name_text_collection = "collection_text")
|
59 |
# Get the uris to the images
|
60 |
IMAGE_FOLDER = 'images'
|
61 |
|