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-7B-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-7B-Instruct with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Alibaba-NLP/gme-Qwen2-VL-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/gme-Qwen2-VL-7B-Instruct with Transformers:
# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Alibaba-NLP/gme-Qwen2-VL-7B-Instruct", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("Alibaba-NLP/gme-Qwen2-VL-7B-Instruct", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -3698,7 +3698,19 @@ The `GME` models support three types of input: **text**, **image**, and **image-
|
|
| 3698 |
|
| 3699 |
**Transformers**
|
| 3700 |
|
|
|
|
|
|
|
| 3701 |
```python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3702 |
t2i_prompt = 'Find an image that matches the given text.'
|
| 3703 |
texts = [
|
| 3704 |
"The Tesla Cybertruck is a battery electric pickup truck built by Tesla, Inc. since 2023.",
|
|
|
|
| 3698 |
|
| 3699 |
**Transformers**
|
| 3700 |
|
| 3701 |
+
The remote code has some issues with `transformers>=4.52.0`, please downgrade or use `sentence_transformers`
|
| 3702 |
+
|
| 3703 |
```python
|
| 3704 |
+
from transformers import AutoModel
|
| 3705 |
+
from transformers.utils.versions import require_version
|
| 3706 |
+
|
| 3707 |
+
|
| 3708 |
+
require_version(
|
| 3709 |
+
"transformers<4.52.0",
|
| 3710 |
+
"The remote code has some issues with transformers>=4.52.0, please downgrade: pip install transformers==4.51.3"
|
| 3711 |
+
)
|
| 3712 |
+
|
| 3713 |
+
|
| 3714 |
t2i_prompt = 'Find an image that matches the given text.'
|
| 3715 |
texts = [
|
| 3716 |
"The Tesla Cybertruck is a battery electric pickup truck built by Tesla, Inc. since 2023.",
|