UniTok icon indicating copy to clipboard operation
UniTok copied to clipboard

ValueError: The following `model_kwargs` are not used by the model: ['images', 'image_sizes']

Open an287-git opened this issue 1 year ago • 1 comments

Thank you for your awesome work! When I using the MLLM with UniTok, I met some problems: When run:

with torch.inference_mode():
                output_ids = model.generate(
                    input_ids,
                    image=image_tensor.unsqueeze(0).half().cuda(),
                    image_sizes=[image.size],
                    do_sample=True if args.temperature > 0 else False,
                    temperature=args.temperature,
                    top_p=args.top_p,
                    num_beams=args.num_beams,
                    # no_repeat_ngram_size=3,
                    max_new_tokens=1024,
                    use_cache=True)

Got: ValueError: The following model_kwargs are not used by the model: ['images', 'image_sizes'] (note: typos in the generate arguments will also show up in this list)

Could you give me some idea?Thank!

an287-git avatar Sep 24 '25 15:09 an287-git

Hi there, sorry for the late reply. You may run inference with our customized generate function, e.g., generate_mllm() as in this line.

machuofan avatar Oct 15 '25 21:10 machuofan