Instructions to use Snowflake/snowflake-arctic-embed-m-v2.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Snowflake/snowflake-arctic-embed-m-v2.0 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Snowflake/snowflake-arctic-embed-m-v2.0", trust_remote_code=True) 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] - Transformers.js
How to use Snowflake/snowflake-arctic-embed-m-v2.0 with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('sentence-similarity', 'Snowflake/snowflake-arctic-embed-m-v2.0'); - Notebooks
- Google Colab
- Kaggle
โ ๏ธ DO NOT MERGE: feat(transformers): Add native Transformers config
What does this PR do?
โ Adds rope_parameters, so the checkpoint loads directly with AutoModel / AutoConfig in Transformers ๐ค without trust_remote_code. auto_map is left untouched, so nothing changes for anyone on an older version.
โ Transformers support is being added in https://github.com/huggingface/transformers/pull/48416
โ โ ๏ธ This PR is a draft; please do not merge it until the Transformers PR above has landed ๐ค
Produced by?
โ rope_parameters is the standardised form of the existing rope_scaling / rope_theta pair. GTE applies NTK scaling statically at construction by rescaling the base and dividing the inverse frequencies by factor ** (2 / head_dim), which is exactly a linear scaling with base rope_theta * factor, so the inverse frequencies are unchanged.
โ Outputs are reproduced against the original implementation on this checkpoint (max relative difference 1.1e-06), and the slow integration tests in the Transformers PR run against this revision.