Sentence Similarity
sentence-transformers
Safetensors
Transformers
English
Chinese
qwen2_vl
image-text-to-text
mteb
Qwen2-VL
vidore
custom_code
Eval Results (legacy)
Instructions to use Alibaba-NLP/gme-Qwen2-VL-2B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Alibaba-NLP/gme-Qwen2-VL-2B-Instruct with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Alibaba-NLP/gme-Qwen2-VL-2B-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/gme-Qwen2-VL-2B-Instruct with Transformers:
# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Alibaba-NLP/gme-Qwen2-VL-2B-Instruct", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("Alibaba-NLP/gme-Qwen2-VL-2B-Instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Environment requirements
#4
by lcxrocks - opened
Hi, could you please provide the version of your python environment?
I used the following versions:
- python 3.8 / 3.11
- torch 2.5.1+cu118
- transformers 4.45.0.dev0 / transformers 4.46.3
I noticed that my inference results differ from the ones mentioned in your comment:
- My results: tensor([0.2747, 0.5591], dtype=torch.float16) vs. Comment: tensor([0.2281, 0.6001], dtype=torch.float16)
- My results: tensor([0.3040, 0.6646], dtype=torch.float16) vs. Comment: tensor([0.2433, 0.7051], dtype=torch.float16)
- My results: tensor(0.6606, dtype=torch.float16) vs. Comment: tensor(0.6108, dtype=torch.float16)
I’m concerned that there may be an error due to the discrepancies between my results and the ones you provided. Do you have any suggestions?
Hi, sorry for the late reply.
- python 3.11
- torch 2.5.1+cu121
- transformers 4.47.1
Thank you very much!
lcxrocks changed discussion status to closed