KeenWoo commited on
Commit
8fa6c27
·
verified ·
1 Parent(s): e2a27da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -1
app.py CHANGED
@@ -794,9 +794,30 @@ def pre_load_indexes():
794
  print(f" ...Error loading personal knowledge: {e}")
795
  print("All indexes loaded. Application is ready.")
796
 
 
 
 
797
  if __name__ == "__main__":
798
- # Ensure the default theme has its sample files before we try to build an index
 
 
799
  seed_files_into_theme('All')
 
800
 
 
801
  pre_load_indexes()
 
 
 
802
  demo.queue().launch(debug=True)
 
 
 
 
 
 
 
 
 
 
 
 
794
  print(f" ...Error loading personal knowledge: {e}")
795
  print("All indexes loaded. Application is ready.")
796
 
797
+ # --- STARTUP LOGIC WITH DIAGNOSTICS ---
798
+ print("\n--- SCRIPT LOADED. CHECKING IF RUNNING AS MAIN ---\n")
799
+
800
  if __name__ == "__main__":
801
+ print("--- STARTUP BLOCK (__name__ == '__main__') IS EXECUTING ---")
802
+
803
+ print("\nStep 1: Seeding sample files...")
804
  seed_files_into_theme('All')
805
+ print("Step 1: Seeding complete.")
806
 
807
+ print("\nStep 2: Pre-loading indexes...")
808
  pre_load_indexes()
809
+ print("Step 2: Pre-loading complete.")
810
+
811
+ print("\nStep 3: Launching Gradio interface...")
812
  demo.queue().launch(debug=True)
813
+ print("Step 3: Gradio launch command issued.")
814
+ else:
815
+ print("--- WARNING: SCRIPT IS BEING IMPORTED, NOT RUN DIRECTLY ---")
816
+ print("--- The if __name__ == '__main__' block was SKIPPED. ---")
817
+
818
+
819
+ # if __name__ == "__main__":
820
+ # Ensure the default theme has its sample files before we try to build an index
821
+ # seed_files_into_theme('All')
822
+ # pre_load_indexes()
823
+ # demo.queue().launch(debug=True)