Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -99,7 +99,7 @@ def get_all_files_in_folder(temp_dir, partial_paths):
|
|
| 99 |
target_dir = os.path.join(temp_dir, partial_path)
|
| 100 |
print(target_dir)
|
| 101 |
|
| 102 |
-
for root,
|
| 103 |
print(f"Files in current directory ({root}): {files}")
|
| 104 |
for file in files:
|
| 105 |
print(f"Processing file: {file}")
|
|
@@ -112,7 +112,14 @@ def get_file(temp_dir, file_path):
|
|
| 112 |
full_path = os.path.join(temp_dir, file_path)
|
| 113 |
return full_path
|
| 114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
|
|
|
|
| 116 |
def process_directory(directory, partial_paths=None, file_paths=None):
|
| 117 |
all_texts = []
|
| 118 |
file_references = []
|
|
|
|
| 99 |
target_dir = os.path.join(temp_dir, partial_path)
|
| 100 |
print(target_dir)
|
| 101 |
|
| 102 |
+
for root, dirs, files in os.walk(target_dir):
|
| 103 |
print(f"Files in current directory ({root}): {files}")
|
| 104 |
for file in files:
|
| 105 |
print(f"Processing file: {file}")
|
|
|
|
| 112 |
full_path = os.path.join(temp_dir, file_path)
|
| 113 |
return full_path
|
| 114 |
|
| 115 |
+
def find_folder_path(root_directory, target_folder):
|
| 116 |
+
for root, dirs, _ in os.walk(root_directory):
|
| 117 |
+
if target_folder in dirs:
|
| 118 |
+
folder_path = os.path.join(root, target_folder)
|
| 119 |
+
return folder_path
|
| 120 |
+
return
|
| 121 |
|
| 122 |
+
|
| 123 |
def process_directory(directory, partial_paths=None, file_paths=None):
|
| 124 |
all_texts = []
|
| 125 |
file_references = []
|