Image-Text-to-Text
Transformers
Safetensors
qwen3_5
multimodal
visual-token-compression
on-policy-distillation
conversational
Instructions to use yyy051007/LT-OPD with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yyy051007/LT-OPD with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="yyy051007/LT-OPD") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("yyy051007/LT-OPD") model = AutoModelForMultimodalLM.from_pretrained("yyy051007/LT-OPD", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yyy051007/LT-OPD with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yyy051007/LT-OPD" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yyy051007/LT-OPD", "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/yyy051007/LT-OPD
- SGLang
How to use yyy051007/LT-OPD 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 "yyy051007/LT-OPD" \ --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": "yyy051007/LT-OPD", "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 "yyy051007/LT-OPD" \ --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": "yyy051007/LT-OPD", "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 yyy051007/LT-OPD with Docker Model Runner:
docker model run hf.co/yyy051007/LT-OPD
File size: 3,024 Bytes
ddde743 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | {
"attn_implementation": "flash_attention_2",
"vision_token_compressor": {
"enabled": true,
"algorithm": "qwen35_cdpruner_v1",
"method": "cdpruner",
"paper_url": "https://arxiv.org/abs/2506.10967",
"official_repo": "Theia-4869/CDPruner",
"official_repo_revision": "9541616c40fcd5625de1cdb8ea6c33c129eb7864",
"adaptation_scope": "qwen35_single_image_post_native_merger_cdpruner_learnable_nearest_retained_merge_pre_llm",
"original_method_reproduction_claim_allowed": false,
"route_schema_version": "vision_opd_cdpruner_learnable_merge_zero_residual_curriculum_route_v1",
"transport_key": "dart_merge_routes",
"placement": "post_native_merger_pre_llm",
"budget_policy": "per_image_min_N_max_32_ceil_active_optimizer_step_retention_bps_N_v1",
"retention_ratio": 0.05,
"minimum_tokens_per_image": 32,
"distance": null,
"distance_chunk_tokens": null,
"routing_autograd": "detached_no_grad_fp32",
"knn_k": null,
"center_score": null,
"assignment": "greedy_conditional_dpp_stable_original_index_tie",
"reduction": "differentiable_fp32_zero_init_signed_residual",
"position_policy": "selected_original_mrope",
"query_conditioned": true,
"attention_conditioned": false,
"bbox_conditioned": false,
"persistent_n_by_n_matrix_forbidden": true,
"kernel_jitter": 1e-06,
"relevance_epsilon": 1e-06,
"residual_epsilon": 1e-12,
"selector_dtype": "float32",
"merge": "learnable_nearest_retained_zero_init_residual",
"query_policy": "user_question_options_only_excluding_special_and_image_tokens",
"relevance_fraction": null,
"candidate_multiplier": null,
"query_weight": null,
"attention_weight": null,
"bbox_weight": null,
"deterministic": true,
"data_manifest_path": null,
"data_manifest_schema": null,
"conditional_objective": "instruction_relevance_weighted_visual_diversity_greedy_dpp_matrix_free_fp32",
"assignment_chunk_tokens": 2048,
"query_route_schema_version": "vision_opd_route_query_v2",
"summary": {
"enabled": false
},
"curriculum": {
"enabled": true,
"schema_version": "vision_opd_v8_visual_token_curriculum_v2",
"driver": "completed_optimizer_steps_before_current_update",
"schedule_type": "warmup_hold_raised_cosine_frozen_bps",
"total_optimizer_steps": 188,
"start_retention_bps": 2500,
"final_retention_bps": 500,
"warmup_hold_optimizer_steps": 14,
"final_plateau_start_completed_steps": 100,
"rounding_mode": "round_half_up",
"minimum_tokens_per_image": 32
},
"learnable_merge": {
"enabled": true,
"aggregation": "zero_init_signed_residual_v1",
"initialization": "pretrained_mlp_gate_rows_zero_output_v1",
"input_hidden_size": 2560,
"hidden_size": 64,
"temperature": 1.0,
"assignment": "cosine_nearest_retained_original_index_tie",
"activation_checkpointing": true,
"chunk_tokens": 1024
}
}
}
|