Sentence Similarity
sentence-transformers
Safetensors
Transformers
qwen2
text-generation
mteb
Qwen2
custom_code
Eval Results (legacy)
text-embeddings-inference
Instructions to use starsy/gte-Qwen2-7B-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use starsy/gte-Qwen2-7B-instruct with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("starsy/gte-Qwen2-7B-instruct", trust_remote_code=True) 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
How to use starsy/gte-Qwen2-7B-instruct with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("starsy/gte-Qwen2-7B-instruct", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("starsy/gte-Qwen2-7B-instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download special_tokens_map.json from starsy/gte-Qwen2-7B-instruct: direct link, hf CLI and curl.
- Browser
- Download file 370 Bytes
-
https://huggingface.co/starsy/gte-Qwen2-7B-instruct/resolve/main/special_tokens_map.json
- Command line
-
hf download hf://starsy/gte-Qwen2-7B-instruct/special_tokens_map.json
-
curl -L -o special_tokens_map.json https://huggingface.co/starsy/gte-Qwen2-7B-instruct/resolve/main/special_tokens_map.json
370 Bytes
| { | |
| "additional_special_tokens": [ | |
| "<|im_start|>", | |
| "<|im_end|>" | |
| ], | |
| "eos_token": { | |
| "content": "<|endoftext|>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false | |
| }, | |
| "pad_token": { | |
| "content": "<|endoftext|>", | |
| "lstrip": false, | |
| "normalized": false, | |
| "rstrip": false, | |
| "single_word": false | |
| } | |
| } | |