Instructions to use vgarg/context_flag_model_v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use vgarg/context_flag_model_v2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("vgarg/context_flag_model_v2") 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] - setfit
How to use vgarg/context_flag_model_v2 with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("vgarg/context_flag_model_v2") preds = model.predict(["i loved the spiderman movie!", "pineapple on pizza is the worst"]) print(preds) - Notebooks
- Google Colab
- Kaggle
Download model_head.pkl from vgarg/context_flag_model_v2: direct link, hf CLI and curl.
- Browser
- Download file 9.06 kB
-
https://huggingface.co/vgarg/context_flag_model_v2/resolve/main/model_head.pkl
- Command line
-
hf download hf://vgarg/context_flag_model_v2/model_head.pkl
-
curl -L -o model_head.pkl https://huggingface.co/vgarg/context_flag_model_v2/resolve/main/model_head.pkl
9.06 kB
- Xet hash:
- 9e9a9422b5b0cb109b654005e042565f4bd5f8bcf3a084e3b1570d7e4d298e0e
- Size of remote file:
- 9.06 kB
- SHA256:
- 980d21ee1dedc61d8c31d303cebc2b859317552fdd6b1f9a2c4e35c650b207c4
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.