KeenWoo commited on
Commit
3d33115
·
verified ·
1 Parent(s): c673893

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -24
app.py CHANGED
@@ -9,30 +9,6 @@ from pytube import YouTube
9
  from pathlib import Path # <-- Add this import at the top of your file with the other imports
10
  import re
11
 
12
- # --- START: Filesystem Write Test ---
13
- import os
14
- import datetime
15
-
16
- TEST_DIR = "test_directory"
17
- try:
18
- print("--- RUNNING FILESYSTEM WRITE TEST ---")
19
- if not os.path.exists(TEST_DIR):
20
- print(f"Attempting to create '{TEST_DIR}'...")
21
- os.makedirs(TEST_DIR)
22
- print(f"'{TEST_DIR}' created successfully.")
23
- else:
24
- print(f"'{TEST_DIR}' already exists.")
25
-
26
- with open(os.path.join(TEST_DIR, "test_file.txt"), "w") as f:
27
- f.write(f"File write successful at: {datetime.datetime.now()}")
28
- print("Test file written successfully.")
29
- print("--- FILESYSTEM WRITE TEST PASSED ---")
30
-
31
- except Exception as e:
32
- print(f"--- !!! FILESYSTEM WRITE TEST FAILED !!! ---")
33
- print(f"Error: {e}")
34
- # --- END: Filesystem Write Test ---
35
-
36
 
37
  # --- Agent Imports & Safe Fallbacks ---
38
  try:
@@ -816,5 +792,8 @@ def pre_load_indexes():
816
  print("All indexes loaded. Application is ready.")
817
 
818
  if __name__ == "__main__":
 
 
 
819
  pre_load_indexes()
820
  demo.queue().launch(debug=True)
 
9
  from pathlib import Path # <-- Add this import at the top of your file with the other imports
10
  import re
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  # --- Agent Imports & Safe Fallbacks ---
14
  try:
 
792
  print("All indexes loaded. Application is ready.")
793
 
794
  if __name__ == "__main__":
795
+ # Ensure the default theme has its sample files before we try to build an index
796
+ seed_files_into_theme('All')
797
+
798
  pre_load_indexes()
799
  demo.queue().launch(debug=True)