Sentence Similarity
sentence-transformers
ONNX
Safetensors
Transformers.js
bert
feature-extraction
mteb
arctic
snowflake-arctic-embed
Eval Results (legacy)
text-embeddings-inference
Run this model with HF Jobs
Run Snowflake/snowflake-arctic-embed-l on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Snowflake/snowflake-arctic-embed-l. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Snowflake/snowflake-arctic-embed-l on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Snowflake/snowflake-arctic-embed-l with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Snowflake/snowflake-arctic-embed-l with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Snowflake/snowflake-arctic-embed-l") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers.js
How to use Snowflake/snowflake-arctic-embed-l with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('feature-extraction', 'Snowflake/snowflake-arctic-embed-l'); - Inference
- Notebooks
- Google Colab
- Kaggle
Sentence Transformers integration
#2
by tomaarsen HF Staff - opened
Files changed (5)
- 1_Pooling/config.jsonAdded+10
- README.md+34
- config_sentence_transformers.jsonAdded+11
- modules.jsonAdded+20
- sentence_bert_config.jsonAdded+4
12345678910{ "word_embedding_dimension": 1024, "pooling_mode_cls_token": true, "pooling_mode_mean_tokens": false, "pooling_mode_max_tokens": false, "pooling_mode_mean_sqrt_len_tokens": false, "pooling_mode_weightedmean_tokens": false, "pooling_mode_lasttoken": false, "include_prompt": true}2935 unmodified lines2936293729382939294029412935 unmodified lines## Usage### Using Huggingface transformers2935 unmodified lines29362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752935 unmodified lines## Usage### Using Sentence TransformersYou can use the sentence-transformers package to use an snowflake-arctic-embed model, as shown below.```pythonfrom sentence_transformers import SentenceTransformermodel = SentenceTransformer("Snowflake/snowflake-arctic-embed-l")queries = ['what is snowflake?', 'Where can I get the best tacos?']documents = ['The Data Cloud!', 'Mexico City of Course!']query_embeddings = model.encode(queries, prompt_name="query")document_embeddings = model.encode(documents)scores = query_embeddings @ document_embeddings.Tfor query, query_scores in zip(queries, scores):doc_score_pairs = list(zip(documents, query_scores))doc_score_pairs = sorted(doc_score_pairs, key=lambda x: x[1], reverse=True)# Output passages & scoresprint("Query:", query)for document, score in doc_score_pairs:print(score, document)``````Query: what is snowflake?0.28976774 The Data Cloud!0.19071159 Mexico City of Course!Query: Where can I get the best tacos?0.38650584 Mexico City of Course!0.25145516 The Data Cloud!```### Using Huggingface transformers
1234567891011{ "__version__": { "sentence_transformers": "2.7.0.dev0", "transformers": "4.39.3", "pytorch": "2.1.0+cu121" }, "prompts": { "query": "Represent this sentence for searching relevant passages: " }, "default_prompt_name": null}1234567891011121314151617181920[ { "idx": 0, "name": "0", "path": "", "type": "sentence_transformers.models.Transformer" }, { "idx": 1, "name": "1", "path": "1_Pooling", "type": "sentence_transformers.models.Pooling" }, { "idx": 2, "name": "2", "path": "2_Normalize", "type": "sentence_transformers.models.Normalize" }]1234{ "max_seq_length": 512, "do_lower_case": false}1_Pooling/config.jsonAdded+10
README.md+34
config_sentence_transformers.jsonAdded+11
modules.jsonAdded+20
sentence_bert_config.jsonAdded+4