Spaces:
Sleeping
Sleeping
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!") | |