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
Update README.md
Browse files
README.md
CHANGED
|
@@ -3693,6 +3693,7 @@ The `GME` models support three types of input: **text**, **image**, and **image-
|
|
| 3693 |
|
| 3694 |
## Usage
|
| 3695 |
**Use with sentence_transformers**
|
|
|
|
| 3696 |
The `encode` function accept `str` or `dict` with key(s) in `{'text', 'image', 'prompt'}`.
|
| 3697 |
|
| 3698 |
**Do not pass `prompt` as the argument to `encode`**, pass as the input as a `dict` with a `prompt` key.
|
|
|
|
| 3693 |
|
| 3694 |
## Usage
|
| 3695 |
**Use with sentence_transformers**
|
| 3696 |
+
|
| 3697 |
The `encode` function accept `str` or `dict` with key(s) in `{'text', 'image', 'prompt'}`.
|
| 3698 |
|
| 3699 |
**Do not pass `prompt` as the argument to `encode`**, pass as the input as a `dict` with a `prompt` key.
|