File size: 563 Bytes
6c63e8b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# script.py
from model2vec.distill import distill
import os
# Set local base model path (already cloned)
LOCAL_MODEL_PATH = os.path.join(os.path.dirname(__file__), "snowflake-arctic-embed-xs")
OUTPUT_PATH = os.path.dirname(os.path.abspath(__file__))
PCA_DIMS = 256 # You can tweak this
print("Distilling Model2Vec from local model...")
# Distill model
model = distill(model_name=LOCAL_MODEL_PATH, pca_dims=PCA_DIMS)
print("Saving distilled model to:", OUTPUT_PATH)
model.save_pretrained(OUTPUT_PATH)
print("✅ Done. Distilled model saved to", OUTPUT_PATH) |