Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,6 +18,7 @@ from langchain.schema import Document
|
|
| 18 |
from chunk_python_code import chunk_python_code_with_metadata
|
| 19 |
from vectorstore import get_chroma_vectorstore
|
| 20 |
from download_gitlab_repo import download_and_upload_kadiAPY_repo_to_huggingfacespace
|
|
|
|
| 21 |
|
| 22 |
# Load environment variables from .env file
|
| 23 |
load_dotenv()
|
|
@@ -213,13 +214,10 @@ def initialize():
|
|
| 213 |
|
| 214 |
download_and_upload_kadiAPY_repo_to_huggingfacespace()
|
| 215 |
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
code_texts, code_references = process_directory(DATA_DIR, code_folder_paths, [])
|
| 220 |
print("LEEEEEEEEEEEENGTH of code_texts: ", len(code_texts))
|
| 221 |
-
|
| 222 |
-
doc_texts, kadiAPY_doc_references = process_directory(DATA_DIR, doc_folder_paths, [])
|
| 223 |
print("LEEEEEEEEEEEENGTH of doc_files: ", len(doc_texts))
|
| 224 |
|
| 225 |
code_chunks = split_python_code_into_chunks(code_texts, code_references)
|
|
|
|
| 18 |
from chunk_python_code import chunk_python_code_with_metadata
|
| 19 |
from vectorstore import get_chroma_vectorstore
|
| 20 |
from download_gitlab_repo import download_and_upload_kadiAPY_repo_to_huggingfacespace
|
| 21 |
+
from process_repo_zipfile.py import extract_files_and_filepath_from_dir
|
| 22 |
|
| 23 |
# Load environment variables from .env file
|
| 24 |
load_dotenv()
|
|
|
|
| 214 |
|
| 215 |
download_and_upload_kadiAPY_repo_to_huggingfacespace()
|
| 216 |
|
| 217 |
+
code_texts, code_references = extract_files_and_filepath_from_dir(DATA_DIR, ['kadi_apy'], [])
|
| 218 |
+
doc_texts, kadiAPY_doc_references = extract_files_and_filepath_from_dir(DATA_DIR, ['docs/source/'], [])
|
| 219 |
+
|
|
|
|
| 220 |
print("LEEEEEEEEEEEENGTH of code_texts: ", len(code_texts))
|
|
|
|
|
|
|
| 221 |
print("LEEEEEEEEEEEENGTH of doc_files: ", len(doc_texts))
|
| 222 |
|
| 223 |
code_chunks = split_python_code_into_chunks(code_texts, code_references)
|