Image-Text-to-Text
Transformers
Safetensors
qwen3_5
multimodal
visual-token-compression
on-policy-distillation
conversational
Run this model with HF Jobs
Run yyy051007/LT-OPD on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/yyy051007/LT-OPD. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/yyy051007/LT-OPD on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/yyy051007/LT-OPD. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/yyy051007/LT-OPD. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
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
Simplify model introduction and usage
Browse files9 unmodified lines101112131415161718192021222324252627282930313233343518 unmodified lines54555657589 unmodified lines- arxiv:2609.32353---# LT-OPD 路 Learnable Node Aggregation[Paper](https://arxiv.org/abs/2609.32353) 路 [Code](https://github.com/Yrxxxxxxxx1007/LT-OPD/tree/747524cd00106cdc66581a0372e2b34d0011a843/src/learnable_merge)LT-OPD adapts Qwen3.5-4B to compressed visual inputs through on-policy self-distillation with a frozen full-token teacher. This version combines CDPruner with learnable residual aggregation: discarded visual nodes contribute to their nearest retained nodes, preserving the retained nodes' original positions without adding tokens.## UsageFollow the environment setup in [LT-OPD](https://github.com/Yrxxxxxxxx1007/LT-OPD), then select the implementation in `src/learnable_merge`:```bashgit clone https://github.com/Yrxxxxxxxx1007/LT-OPD.gitcd LT-OPDgit checkout 747524cd00106cdc66581a0372e2b34d0011a843export PYTHONPATH="$PWD/src/learnable_merge:$PWD/src${PYTHONPATH:+:$PYTHONPATH}"hf download yyy051007/LT-OPD-learnable-merge \--local-dir models/LT-OPD-learnable-merge``````pythonimport torchfrom evaluation.runtime import build_route_query18 unmodified lines)print(output["decoded_predictions"][0])```The compression runtime loads the learned aggregation weights and the visual-token configuration packaged with this checkpoint.9 unmodified lines10111213141516171819202122232425262728293031323334353618 unmodified lines5556579 unmodified lines- arxiv:2609.32353---# LT-OPD[Paper](https://arxiv.org/abs/2609.32353) 路 [GitHub](https://github.com/Yrxxxxxxxx1007/LT-OPD/tree/learnable-merge/src/learnable_merge)LT-OPD trains vision-language models with fewer visual tokens through on-policy self-distillation. This Qwen3.5-4B model combines CDPruner with an MLP that aggregates discarded tokens into their nearest retained tokens, preserving their original positions without adding tokens.## Quick StartUse Python 3.12 and the CUDA environment in the [installation guide](https://github.com/Yrxxxxxxxx1007/LT-OPD/tree/learnable-merge#setup).```bashgit clone --branch learnable-merge --depth 1 https://github.com/Yrxxxxxxxx1007/LT-OPD.gitcd LT-OPDexport PYTHONPATH="$PWD/src/learnable_merge:$PWD/src${PYTHONPATH:+:$PYTHONPATH}"hf download yyy051007/LT-OPD-learnable-merge \--local-dir models/LT-OPD-learnable-merge```Load the model with LT-OPD's visual-token compression runtime:```pythonimport torchfrom evaluation.runtime import build_route_query18 unmodified lines)print(output["decoded_predictions"][0])```
README.md+8-9