Spaces:
Runtime error
Runtime error
v0.8.4
Browse files- src/chromaIntf.py +4 -3
src/chromaIntf.py
CHANGED
|
@@ -23,7 +23,8 @@ class ChromaIntf():
|
|
| 23 |
encode_kwargs=encode_kwargs
|
| 24 |
)
|
| 25 |
|
| 26 |
-
|
|
|
|
| 27 |
try:
|
| 28 |
dbh.restoreFolder("db")
|
| 29 |
except:
|
|
@@ -37,7 +38,7 @@ class ChromaIntf():
|
|
| 37 |
|
| 38 |
self.vectorstore = Chroma.from_documents(documents=docs,
|
| 39 |
embedding=embedding,
|
| 40 |
-
persist_directory=
|
| 41 |
|
| 42 |
self.metadata_field_info = [
|
| 43 |
AttributeInfo(
|
|
@@ -95,7 +96,7 @@ class ChromaIntf():
|
|
| 95 |
if "timestamp" not in metadata.keys():
|
| 96 |
metadata['timestamp']=datetime.now().isoformat()
|
| 97 |
else:
|
| 98 |
-
metadata['timestamp']=
|
| 99 |
pass
|
| 100 |
if "source" not in metadata.keys():
|
| 101 |
metadata['source']="conversation"
|
|
|
|
| 23 |
encode_kwargs=encode_kwargs
|
| 24 |
)
|
| 25 |
|
| 26 |
+
persist_db_directory = 'db'
|
| 27 |
+
persist_docs_directory = "docs"
|
| 28 |
try:
|
| 29 |
dbh.restoreFolder("db")
|
| 30 |
except:
|
|
|
|
| 38 |
|
| 39 |
self.vectorstore = Chroma.from_documents(documents=docs,
|
| 40 |
embedding=embedding,
|
| 41 |
+
persist_directory=persist_db_directory)
|
| 42 |
|
| 43 |
self.metadata_field_info = [
|
| 44 |
AttributeInfo(
|
|
|
|
| 96 |
if "timestamp" not in metadata.keys():
|
| 97 |
metadata['timestamp']=datetime.now().isoformat()
|
| 98 |
else:
|
| 99 |
+
metadata['timestamp']=metadata['timestamp']
|
| 100 |
pass
|
| 101 |
if "source" not in metadata.keys():
|
| 102 |
metadata['source']="conversation"
|