File size: 555 Bytes
fe5cad1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
import sys

# 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()