Image-Text-to-Text
PEFT
Safetensors
Transformers
qwen2_vl
lora
conversational
text-generation-inference
Instructions to use trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600 with PEFT:
Task type is invalid.
- Transformers
How to use trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600") 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("trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600") model = AutoModelForMultimodalLM.from_pretrained("trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600") 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 trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600", "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/trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600
- SGLang
How to use trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600 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 "trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600" \ --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": "trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600", "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 "trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600" \ --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": "trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600", "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 trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600 with Docker Model Runner:
docker model run hf.co/trumancai/Qwen2VL-7B-mmcoir-image-mixed-lora8-len256-ckpt-600
Add adapter_config.json
Browse files- adapter_config.json +46 -0
adapter_config.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": {
|
| 4 |
+
"base_model_class": "Qwen2VLForConditionalGeneration",
|
| 5 |
+
"parent_library": "src.model.vlm_backbone.qwen2_vl.modeling_qwen2_vl"
|
| 6 |
+
},
|
| 7 |
+
"base_model_name_or_path": "Qwen/Qwen2-VL-7B-Instruct",
|
| 8 |
+
"bias": "none",
|
| 9 |
+
"corda_config": null,
|
| 10 |
+
"eva_config": null,
|
| 11 |
+
"exclude_modules": null,
|
| 12 |
+
"fan_in_fan_out": false,
|
| 13 |
+
"inference_mode": true,
|
| 14 |
+
"init_lora_weights": "gaussian",
|
| 15 |
+
"layer_replication": null,
|
| 16 |
+
"layers_pattern": null,
|
| 17 |
+
"layers_to_transform": null,
|
| 18 |
+
"loftq_config": {},
|
| 19 |
+
"lora_alpha": 64,
|
| 20 |
+
"lora_bias": false,
|
| 21 |
+
"lora_dropout": 0.1,
|
| 22 |
+
"megatron_config": null,
|
| 23 |
+
"megatron_core": "megatron.core",
|
| 24 |
+
"modules_to_save": null,
|
| 25 |
+
"peft_type": "LORA",
|
| 26 |
+
"qalora_group_size": 16,
|
| 27 |
+
"r": 8,
|
| 28 |
+
"rank_pattern": {},
|
| 29 |
+
"revision": null,
|
| 30 |
+
"target_modules": [
|
| 31 |
+
"o_proj",
|
| 32 |
+
"q_proj",
|
| 33 |
+
"qkv_proj",
|
| 34 |
+
"out_proj",
|
| 35 |
+
"down_proj",
|
| 36 |
+
"k_proj",
|
| 37 |
+
"v_proj",
|
| 38 |
+
"gate_up_proj"
|
| 39 |
+
],
|
| 40 |
+
"target_parameters": null,
|
| 41 |
+
"task_type": null,
|
| 42 |
+
"trainable_token_indices": null,
|
| 43 |
+
"use_dora": true,
|
| 44 |
+
"use_qalora": false,
|
| 45 |
+
"use_rslora": false
|
| 46 |
+
}
|