Spaces:
Sleeping
Sleeping
zeyadahmedd
commited on
Commit
•
ab09b12
1
Parent(s):
48f15e8
Update app.py
Browse files
app.py
CHANGED
@@ -146,7 +146,10 @@ def update(data):
|
|
146 |
if(not os.path.exists(id)):
|
147 |
return "sorry ,there is no directory for this client"
|
148 |
else:
|
149 |
-
|
|
|
|
|
|
|
150 |
collection=chroma_client.create_collection(name=id)
|
151 |
print(os.chdir(id))
|
152 |
return create_multiple_db(os.getcwd(),collection,working_dir)+"updating client embeddings"
|
|
|
146 |
if(not os.path.exists(id)):
|
147 |
return "sorry ,there is no directory for this client"
|
148 |
else:
|
149 |
+
try:
|
150 |
+
chroma_client.delete_collection(name=id)
|
151 |
+
except error:
|
152 |
+
pass
|
153 |
collection=chroma_client.create_collection(name=id)
|
154 |
print(os.chdir(id))
|
155 |
return create_multiple_db(os.getcwd(),collection,working_dir)+"updating client embeddings"
|