from unsloth import FastVisionModelfrom peft import PeftModel base, processor = FastVisionModel.from_pretrained("Qwen/Qwen3.5-4B", load_in_4bit=True)FastVisionModel.for_inference(base)model = PeftModel.from_pretrained(base, "hxcsa/qwen35-4b-docvqa-lora")FastVisionModel.for_inference(model) # Qwen3.5 is a thinking-style model — disable thinking for concise answerstext = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=False, enable_thinking=False, # ← essential)inputs = processor(images=image, text=text, add_special_tokens=False, return_tensors="pt").to("cuda")out = model.generate(**inputs, max_new_tokens=64, do_sample=False)answer = processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True).strip()