Instructions to use mrfoxv/snowflake_model2vec with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Model2Vec
How to use mrfoxv/snowflake_model2vec with Model2Vec:
from model2vec import StaticModel model = StaticModel.from_pretrained("mrfoxv/snowflake_model2vec") - sentence-transformers
How to use mrfoxv/snowflake_model2vec with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("mrfoxv/snowflake_model2vec") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
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) |