recon / preload.py
MukulRay's picture
Fix HF Spaces: tmp paths for cache and model, preload model at build
27c6634
raw
history blame contribute delete
215 Bytes
# Forces model download during build so startup is instant
from sentence_transformers import SentenceTransformer
print("Downloading all-MiniLM-L6-v2...")
SentenceTransformer("all-MiniLM-L6-v2")
print("Model ready.")