Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -133,11 +133,11 @@ def process_directory(directory, partial_paths=None, file_paths=None):
|
|
| 133 |
# Unzip the file into the temporary directory
|
| 134 |
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
|
| 135 |
zip_ref.extractall(tmpdirname)
|
| 136 |
-
print(f"Extracted {zip_file_path} to {tmpdirname}")
|
| 137 |
|
| 138 |
files = []
|
| 139 |
-
|
| 140 |
unzipped_root = os.listdir(tmpdirname)
|
|
|
|
| 141 |
if len(unzipped_root) == 1 and os.path.isdir(os.path.join(tmpdirname, unzipped_root[0])):
|
| 142 |
tmpsubdirpath= os.path.join(tmpdirname, unzipped_root[0])
|
| 143 |
else:
|
|
@@ -303,7 +303,7 @@ def retrieve_from_vectorstore(vectorstore, query, k):
|
|
| 303 |
return chunks_with_references
|
| 304 |
|
| 305 |
def rag_workflow(query):
|
| 306 |
-
retrieved_doc_chunks = retrieve_from_vectorstore(docstore, query, k=5)
|
| 307 |
retrieved_code_chunks = retrieve_from_vectorstore(codestore, query, k=5)
|
| 308 |
|
| 309 |
doc_context = "\n\n".join([doc_chunk for doc_chunk, _ in retrieved_doc_chunks])
|
|
|
|
| 133 |
# Unzip the file into the temporary directory
|
| 134 |
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
|
| 135 |
zip_ref.extractall(tmpdirname)
|
|
|
|
| 136 |
|
| 137 |
files = []
|
| 138 |
+
print("tmpdirname: " , tmpdirname)
|
| 139 |
unzipped_root = os.listdir(tmpdirname)
|
| 140 |
+
print("unzipped_root ", unzipped_root)
|
| 141 |
if len(unzipped_root) == 1 and os.path.isdir(os.path.join(tmpdirname, unzipped_root[0])):
|
| 142 |
tmpsubdirpath= os.path.join(tmpdirname, unzipped_root[0])
|
| 143 |
else:
|
|
|
|
| 303 |
return chunks_with_references
|
| 304 |
|
| 305 |
def rag_workflow(query):
|
| 306 |
+
retrieved_doc_chunks = retrieve_from_vectorstore (docstore, query, k=5)
|
| 307 |
retrieved_code_chunks = retrieve_from_vectorstore(codestore, query, k=5)
|
| 308 |
|
| 309 |
doc_context = "\n\n".join([doc_chunk for doc_chunk, _ in retrieved_doc_chunks])
|