Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -73,19 +73,19 @@ def upload_gitRepository():
|
|
73 |
target_path = f"{REPOSITORY_DIRECTORY}/{filename}"
|
74 |
print("Constructed target path:", target_path) # Debug print statement
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
|
80 |
# Upload the ZIP file to the new folder in the Hugging Face space repository
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
|
88 |
-
|
89 |
|
90 |
def process_directory(directory):
|
91 |
all_texts = []
|
@@ -194,10 +194,10 @@ def initialize():
|
|
194 |
global vectorstore, chunks, llm
|
195 |
|
196 |
upload_gitRepository()
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
|
202 |
# Gradio utils
|
203 |
def check_input_text(text):
|
|
|
73 |
target_path = f"{REPOSITORY_DIRECTORY}/{filename}"
|
74 |
print("Constructed target path:", target_path) # Debug print statement
|
75 |
|
76 |
+
# if target_path in existing_files:
|
77 |
+
# print(f"File '{target_path}' already exists in the repository. Skipping upload...")
|
78 |
+
# continue
|
79 |
|
80 |
# Upload the ZIP file to the new folder in the Hugging Face space repository
|
81 |
+
# api.upload_file(
|
82 |
+
# path_or_fileobj=archive_bytes,
|
83 |
+
# path_in_repo=target_path,
|
84 |
+
# repo_id=HF_SPACE_NAME,
|
85 |
+
# repo_type='space'
|
86 |
+
# )
|
87 |
|
88 |
+
# print(f"Repository '{project_id}' downloaded and uploaded to Hugging Face space '{HF_SPACE_NAME}' in folder '{REPOSITORY_DIRECTORY}' with original file name '{filename}'")
|
89 |
|
90 |
def process_directory(directory):
|
91 |
all_texts = []
|
|
|
194 |
global vectorstore, chunks, llm
|
195 |
|
196 |
upload_gitRepository()
|
197 |
+
# all_texts, file_references = process_directory(REPOSITORY_DIRECTORY)
|
198 |
+
# chunks = split_into_chunks(all_texts, file_references, CHUNK_SIZE, CHUNK_OVERLAP)
|
199 |
+
# vectorstore = setup_chroma(chunks, EMBEDDING_MODEL_NAME, PERSIST_DIRECTORY)
|
200 |
+
# llm = setup_llm(LLM_MODEL_NAME, LLM_TEMPERATURE, GROQ_API_KEY)
|
201 |
|
202 |
# Gradio utils
|
203 |
def check_input_text(text):
|