Instructions to use Alibaba-NLP/gte-Qwen1.5-7B-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Alibaba-NLP/gte-Qwen1.5-7B-instruct with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Alibaba-NLP/gte-Qwen1.5-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 Alibaba-NLP/gte-Qwen1.5-7B-instruct with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Alibaba-NLP/gte-Qwen1.5-7B-instruct", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("Alibaba-NLP/gte-Qwen1.5-7B-instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Cannot load model on TEI
During downloading model sources by TEI server I got this error:
{
"timestamp": "2025-09-21T07:23:03.381747Z",
"level": "WARN",
"message": "safetensors weights not found. Using pytorch_model.bin instead. Model loading will be significantly slower.",
"target": "text_embeddings_backend",
"filename": "backends/src/lib.rs",
"line_number": 413
}
{
"timestamp": "2025-09-21T07:23:03.381790Z",
"level": "INFO",
"message": "Downloading pytorch_model.bin",
"target": "text_embeddings_backend",
"filename": "backends/src/lib.rs",
"line_number": 414
}
Error: Could not create backend
Caused by:
Weights not found: request error: HTTP status client error (404 Not Found) for url (https://huggingface.co/Alibaba-NLP/gte-Qwen1.5-7B-instruct/resolve/main/pytorch_model.bin)