Task Preference Optimization: Improving Multimodal Large Language Models with Vision Task Alignment
Paper β’ 2412.19326 β’ Published β’ 18
Run OpenGVLab/VideoChat-TPO 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:
Use HF Jobs to fine-tune https://huggingface.co/OpenGVLab/VideoChat-TPO. 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.
Use HF Jobs to run batch inference with https://huggingface.co/OpenGVLab/VideoChat-TPO 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.
How to use OpenGVLab/VideoChat-TPO with Transformers:
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("OpenGVLab/VideoChat-TPO", trust_remote_code=True, device_map="auto")This model is based on the paper Task Preference Optimization: Improving Multimodal Large Language Models with Vision Task Alignment.
pip install -r requirements.txt
python app.py
from transformers import AutoModel, AutoTokenizer
from tokenizer import MultimodalLlamaTokenizer
model_path = "OpenGVLab/VideoChat-TPO"
tokenizer = AutoTokenizer.from_pretrained(model_path,
trust_remote_code=True,
use_fast=False,)
model = AutoModel.from_pretrained(model_path, trust_remote_code=True, _tokenizer=self.tokenizer).eval()
Base model
mistralai/Mistral-7B-Instruct-v0.2
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("OpenGVLab/VideoChat-TPO", trust_remote_code=True, device_map="auto")