sofzcc commited on
Commit
16fad2b
·
verified ·
1 Parent(s): 25ac252

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -658,12 +658,12 @@ def create_interface():
658
  return demo
659
 
660
  # ----------- Main Entry Point -----------
661
- if __name__ == "__main__":
662
- config_file = os.getenv('RAG_CONFIG', 'config.yaml')
663
-
664
- config = Config(config_file)
665
- kb = KBIndex()
666
- ensure_index()
667
-
668
- demo = create_interface()
669
- demo.launch()
 
658
  return demo
659
 
660
  # ----------- Main Entry Point -----------
661
+
662
+ # Load config and KB at import time
663
+ config_file = os.getenv("RAG_CONFIG", "config.yaml")
664
+ config = Config(config_file)
665
+ kb = KBIndex()
666
+ ensure_index()
667
+
668
+ # Expose `demo` for Hugging Face Spaces
669
+ demo = create_interface()