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!")