FuturesonyAi / app.py
Futuresony's picture
Update app.py
5b8d85d verified
raw
history blame
555 Bytes
import faiss
import os
# πŸ”Ή Define FAISS File Path
FAISS_FILE = "asa_faiss.index" # This should be inside your space files
LOCAL_FAISS_PATH = os.path.join(os.getcwd(), FAISS_FILE)
# πŸ”Ή Check if FAISS File Exists
if not os.path.exists(LOCAL_FAISS_PATH):
raise FileNotFoundError(f"❌ FAISS index file '{FAISS_FILE}' not found! Make sure it's uploaded to your Space.")
# πŸ”Ή Load FAISS Index
print(f"Loading FAISS index from {LOCAL_FAISS_PATH}...")
faiss_index = faiss.read_index(LOCAL_FAISS_PATH)
print("βœ… FAISS index loaded successfully!")