koulsahil commited on
Commit
67fca8e
·
verified ·
1 Parent(s): 7b96403

Create download_model.py

Browse files
Files changed (1) hide show
  1. src/download_model.py +10 -0
src/download_model.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # download_model.py - run this during build
2
+ from sentence_transformers import SentenceTransformer
3
+ import os
4
+
5
+ # Set cache to a location that will be included in the build
6
+ cache_dir = "./models"
7
+ os.makedirs(cache_dir, exist_ok=True)
8
+
9
+ model = SentenceTransformer('all-MiniLM-L6-v2', cache_folder=cache_dir)
10
+ print("Model downloaded successfully!")