Spaces:
Runtime error
Runtime error
pushing all files
Browse files
app.py
CHANGED
@@ -72,11 +72,11 @@ if os.path.exists(VECTORSTORE_PATH):
|
|
72 |
else:
|
73 |
print("Indexing Files")
|
74 |
os.makedirs(VECTORSTORE_DIR, exist_ok=True)
|
75 |
-
for i in range(0, len(
|
76 |
if i == 0:
|
77 |
-
vectorstore = FAISS.from_documents(
|
78 |
continue
|
79 |
-
vectorstore.add_documents(
|
80 |
vectorstore.save_local(VECTORSTORE_DIR)
|
81 |
|
82 |
hf_retriever = vectorstore.as_retriever()
|
@@ -127,7 +127,7 @@ def rename(original_author: str):
|
|
127 |
In this case, we're overriding the 'Assistant' author to be 'Paul Graham Essay Bot'.
|
128 |
"""
|
129 |
rename_dict = {
|
130 |
-
"Assistant" : "Paul Graham
|
131 |
}
|
132 |
return rename_dict.get(original_author, original_author)
|
133 |
|
|
|
72 |
else:
|
73 |
print("Indexing Files")
|
74 |
os.makedirs(VECTORSTORE_DIR, exist_ok=True)
|
75 |
+
for i in range(0, len(split_documents), 32):
|
76 |
if i == 0:
|
77 |
+
vectorstore = FAISS.from_documents(split_documents[i:i+32], hf_embeddings)
|
78 |
continue
|
79 |
+
vectorstore.add_documents(split_documents[i:i+32])
|
80 |
vectorstore.save_local(VECTORSTORE_DIR)
|
81 |
|
82 |
hf_retriever = vectorstore.as_retriever()
|
|
|
127 |
In this case, we're overriding the 'Assistant' author to be 'Paul Graham Essay Bot'.
|
128 |
"""
|
129 |
rename_dict = {
|
130 |
+
"Assistant" : "Paul Graham's Personal Historian"
|
131 |
}
|
132 |
return rename_dict.get(original_author, original_author)
|
133 |
|