Test3 / main.py
ohalkhateeb's picture
Update main.py
29f3797 verified
raw
history blame
584 Bytes
import os
import sys
print("Running main.py app")
# Ensure preprocess.py is in the same directory
sys.path.append(os.path.dirname(__file__))
# Import preprocess function
from preprocess import preprocess
# Check if precomputed files exist and run preprocessing if needed
if not (os.path.exists("chunks.pkl") and os.path.exists("index.faiss")):
print("Precomputed files missing. Running preprocess.py...")
preprocess()
else:
print("Precomputed files found. Skipping preprocessing.")
# Import and run app.py
print("Starting app.py...")
from app import demo
demo.launch()