Update README.md
Browse files
README.md
CHANGED
@@ -3696,8 +3696,7 @@ The `GME` models support three types of input: **text**, **image**, and **image-
|
|
3696 |
|
3697 |
```python
|
3698 |
# You can find the script gme_inference.py in https://huggingface.co/Alibaba-NLP/gme-Qwen2-VL-2B-Instruct/blob/main/gme_inference.py
|
3699 |
-
from
|
3700 |
-
|
3701 |
texts = [
|
3702 |
"What kind of car is this?",
|
3703 |
"The Tesla Cybertruck is a battery electric pickup truck built by Tesla, Inc. since 2023."
|
@@ -3707,7 +3706,7 @@ images = [
|
|
3707 |
'https://en.wikipedia.org/wiki/File:2024_Tesla_Cybertruck_Foundation_Series,_front_left_(Greenwich).jpg',
|
3708 |
]
|
3709 |
|
3710 |
-
gme =
|
3711 |
|
3712 |
# Single-modal embedding
|
3713 |
e_text = gme.get_text_embeddings(texts=texts)
|
|
|
3696 |
|
3697 |
```python
|
3698 |
# You can find the script gme_inference.py in https://huggingface.co/Alibaba-NLP/gme-Qwen2-VL-2B-Instruct/blob/main/gme_inference.py
|
3699 |
+
from transformers import AutoModel
|
|
|
3700 |
texts = [
|
3701 |
"What kind of car is this?",
|
3702 |
"The Tesla Cybertruck is a battery electric pickup truck built by Tesla, Inc. since 2023."
|
|
|
3706 |
'https://en.wikipedia.org/wiki/File:2024_Tesla_Cybertruck_Foundation_Series,_front_left_(Greenwich).jpg',
|
3707 |
]
|
3708 |
|
3709 |
+
gme = AutoModel("Alibaba-NLP/gme-Qwen2-VL-2B-Instruct", trust_remote_code=True)
|
3710 |
|
3711 |
# Single-modal embedding
|
3712 |
e_text = gme.get_text_embeddings(texts=texts)
|