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
error with AutoModel GmeQwen2VLConfig after upgrade
Great work, but I have a question. After the latest update, the transform library is used to automatically load the model.
But when I run the latest inference code example, I get an error:
ValueError: Unrecognized configuration class <class 'transformers_modules.gme-Qwen2-VL-2B-Instruct.modeling_gme_qwen2vl.GmeQwen2VLConfig'> for this kind of AutoModel: AutoModel.
What is the reason for this error? Looking forward to your reply
same error
same error
Hi, a quick fix : Downgrade transformers<=4.51.3 and Replace "model_type": "gme_qwen2_vl", with "model_type": "qwen2_vl", in the config.json.
I will update the change soon.
same error
Hi, a quick fix : Replace
"model_type": "gme_qwen2_vl",with"model_type": "qwen2_vl",in theconfig.json.I will update the change soon.
Unrecognized video processor in Alibaba-NLP/gme-Qwen2-VL-2B-Instruct. Should have a video_processor_type key in its video_preprocessor_config.json of config.json, or one of the following model_type keys in its config.json: instructblip, instructblipvideo, internvl, llava_next_video, llava_onevision, qwen2_5_omni, qwen2_5_vl, qwen2_vl, smolvlm, video_llava
Hi, a quick fix : Replace
"model_type": "gme_qwen2_vl",with"model_type": "qwen2_vl",in theconfig.json.I will update the change soon.
Unrecognized video processor in Alibaba-NLP/gme-Qwen2-VL-2B-Instruct. Should have a
video_processor_typekey in its video_preprocessor_config.json of config.json, or one of the followingmodel_typekeys in its config.json: instructblip, instructblipvideo, internvl, llava_next_video, llava_onevision, qwen2_5_omni, qwen2_5_vl, qwen2_vl, smolvlm, video_llava
I finally downgraded transformer==4.46.0 to solve the problem
Hi all, I updated the code as a temporary solution. Do remember downgrade transformers to 4.51.3 or just use sentence_transformers.