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
| { | |
| "alpha_pattern": {}, | |
| "auto_mapping": { | |
| "base_model_class": "Qwen2VLForConditionalGeneration", | |
| "parent_library": "src.model.vlm_backbone.qwen2_vl.modeling_qwen2_vl" | |
| }, | |
| "base_model_name_or_path": "Qwen/Qwen2-VL-7B-Instruct", | |
| "bias": "none", | |
| "corda_config": null, | |
| "eva_config": null, | |
| "exclude_modules": null, | |
| "fan_in_fan_out": false, | |
| "inference_mode": true, | |
| "init_lora_weights": "gaussian", | |
| "layer_replication": null, | |
| "layers_pattern": null, | |
| "layers_to_transform": null, | |
| "loftq_config": {}, | |
| "lora_alpha": 64, | |
| "lora_bias": false, | |
| "lora_dropout": 0.1, | |
| "megatron_config": null, | |
| "megatron_core": "megatron.core", | |
| "modules_to_save": null, | |
| "peft_type": "LORA", | |
| "qalora_group_size": 16, | |
| "r": 8, | |
| "rank_pattern": {}, | |
| "revision": null, | |
| "target_modules": [ | |
| "o_proj", | |
| "q_proj", | |
| "qkv_proj", | |
| "out_proj", | |
| "down_proj", | |
| "k_proj", | |
| "v_proj", | |
| "gate_up_proj" | |
| ], | |
| "target_parameters": null, | |
| "task_type": null, | |
| "trainable_token_indices": null, | |
| "use_dora": true, | |
| "use_qalora": false, | |
| "use_rslora": false | |
| } |