Issues with loading the model

#2
by SpiridonSunRotator - opened

Hi, thanks for you amazing work!

When trying to generate samples with model similarly to the example from the model page

prompt = "Remove clothes from the horse"
imgs_input = ["../images/img1.jpg"]

cot_text, samples = model.generate_image(
    prompt=prompt,
    image=imgs_input,
    seed=42,
    image_size="auto",
    use_system_prompt="en_unified",
    bot_task="think_recaption",  # Use "think_recaption" for reasoning and enhancement
    infer_align_image_size=True,  # Align output image size to input image size
    diff_infer_steps=8, 
    verbose=2
)

I encounter the following error

File /usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py:120, in context_decorator.<locals>.decorate_context(*args, **kwargs)
    117 @functools.wraps(func)
    118 def decorate_context(*args, **kwargs):
    119     with ctx_factory():
--> 120         return func(*args, **kwargs)

File ~/.cache/huggingface/modules/transformers_modules/tencent/HunyuanImage_hyphen_3_dot_0_hyphen_Instruct_hyphen_Distil/2e2316791792c34dd490789f11cb9f60609174a9/modeling_hunyuan_image_3.py:3272, in HunyuanImage3ForCausalMM.generate_image(self, prompt, image, message_list, seed, image_size, use_system_prompt, system_prompt, bot_task, infer_align_image_size, use_taylor_cache, taylor_cache_interval, taylor_cache_order, taylor_cache_enable_first_enhance, taylor_cache_first_enhance_steps, taylor_cache_enable_tailing_enhance, taylor_cache_tailing_enhance_steps, taylor_cache_low_freqs_order, taylor_cache_high_freqs_order, **kwargs)
   3268 stage_transitions = []
   3270 if first_bot_task == "think" and "recaption" in bot_task:
   3271     stage_transitions.append(
-> 3272         (tkw.end_of_think_token_id, [tkw.convert_tokens_to_ids(tkw.recaption_token)])
   3273     )
   3275 if need_ratio:
   3276     answer_prefix_tokens = []

AttributeError: 'NoneType' object has no attribute 'end_of_think_token_id'

Seems like the tokenizer is set to None by default.

How can one fix this issue?

SpiridonSunRotator changed discussion status to closed

Sign up or log in to comment