Image-Text-to-Text
Transformers
Safetensors
qwen2_vl
Generated from Trainer
R1-V
trl
sft
conversational
text-generation-inference
Instructions to use bluuluu/Qwen2-VL-2B-Instruct-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bluuluu/Qwen2-VL-2B-Instruct-SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="bluuluu/Qwen2-VL-2B-Instruct-SFT") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("bluuluu/Qwen2-VL-2B-Instruct-SFT") model = AutoModelForMultimodalLM.from_pretrained("bluuluu/Qwen2-VL-2B-Instruct-SFT", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bluuluu/Qwen2-VL-2B-Instruct-SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bluuluu/Qwen2-VL-2B-Instruct-SFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bluuluu/Qwen2-VL-2B-Instruct-SFT", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/bluuluu/Qwen2-VL-2B-Instruct-SFT
- SGLang
How to use bluuluu/Qwen2-VL-2B-Instruct-SFT with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "bluuluu/Qwen2-VL-2B-Instruct-SFT" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bluuluu/Qwen2-VL-2B-Instruct-SFT", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "bluuluu/Qwen2-VL-2B-Instruct-SFT" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bluuluu/Qwen2-VL-2B-Instruct-SFT", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use bluuluu/Qwen2-VL-2B-Instruct-SFT with Docker Model Runner:
docker model run hf.co/bluuluu/Qwen2-VL-2B-Instruct-SFT
Training in progress, epoch 1
Browse files- config.json +1 -1
- model.safetensors +1 -1
- tokenizer.json +2 -2
- tokenizer_config.json +0 -1
- training_args.bin +2 -2
config.json
CHANGED
|
@@ -31,7 +31,7 @@
|
|
| 31 |
"tie_word_embeddings": true,
|
| 32 |
"torch_dtype": "bfloat16",
|
| 33 |
"transformers_version": "4.51.1",
|
| 34 |
-
"use_cache":
|
| 35 |
"use_sliding_window": false,
|
| 36 |
"video_token_id": 151656,
|
| 37 |
"vision_config": {
|
|
|
|
| 31 |
"tie_word_embeddings": true,
|
| 32 |
"torch_dtype": "bfloat16",
|
| 33 |
"transformers_version": "4.51.1",
|
| 34 |
+
"use_cache": false,
|
| 35 |
"use_sliding_window": false,
|
| 36 |
"video_token_id": 151656,
|
| 37 |
"vision_config": {
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4418050848
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0226e13e09ba5b6f9fde2d8c2d39ee779221531533c73f44c1e1a493d9fe6d17
|
| 3 |
size 4418050848
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:88a3a6fcb80132f76da8aa40cdc3fccd7e5d8468ef15421f5b0c2715e85217d2
|
| 3 |
+
size 11420538
|
tokenizer_config.json
CHANGED
|
@@ -138,7 +138,6 @@
|
|
| 138 |
"model_max_length": 32768,
|
| 139 |
"pad_token": "<|endoftext|>",
|
| 140 |
"padding_side": "left",
|
| 141 |
-
"processor_class": "Qwen2VLProcessor",
|
| 142 |
"split_special_tokens": false,
|
| 143 |
"tokenizer_class": "Qwen2Tokenizer",
|
| 144 |
"unk_token": null
|
|
|
|
| 138 |
"model_max_length": 32768,
|
| 139 |
"pad_token": "<|endoftext|>",
|
| 140 |
"padding_side": "left",
|
|
|
|
| 141 |
"split_special_tokens": false,
|
| 142 |
"tokenizer_class": "Qwen2Tokenizer",
|
| 143 |
"unk_token": null
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d98d616a3c3618345915671a1aca9cfbe746b75e826905c403d6f0739ab42f05
|
| 3 |
+
size 7224
|