Spaces:
Sleeping
Sleeping
File size: 555 Bytes
c4efeea 5b8d85d 416c352 5b8d85d f0e607c 5b8d85d 0ec21e2 5b8d85d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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!")
|