Views
No views yet
1from transformers import AutoProcessor, AutoModelForMultimodalLM
2
3model_id = "withstaticTai/ADOPD"
4processor = AutoProcessor.from_pretrained(model_id)
5model = AutoModelForMultimodalLM.from_pretrained(model_id, device_map="auto")
6messages = [{
7 "role": "user",
8 "content": [
9 {"type": "image", "url": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg"},
10 {"type": "text", "text": "What is the color of the label on the bottle in the background?"},
11 ],
12}]
13inputs = processor.apply_chat_template(
14 messages,
15 add_generation_prompt=True,
16 tokenize=True,
17 return_dict=True,
18 return_tensors="pt",
19).to(model.device)
20
21outputs = model.generate(**inputs, max_new_tokens=40)
22print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))1@article{he2026adopd,
2 title={ADOPD: Reference-Privileged On-Policy Distillation for MLLM-Based Industrial Anomaly Detection},
3 author={He, Jingtai and Meng, Shiyuan and Meng, Wenchao and Yang, Qinmin},
4 journal={arXiv preprint arXiv:2608.09789},
5 year={2026}
6}