transformers-4.50 or higher

#75
by mqpham - opened

model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-4-multimodal-instruct", trust_remote_code=True)
breaks with this error

AttributeError: 'Phi4MMModel' object has no attribute 'prepare_inputs_for_generation'

it's normal since prepare_inputs_for_generation() is from GenerationMixin and PreTrainedModel will NOT inherit from GenerationMixintransformers-4.50

Suggestion: Either

  • add GenerationMixin to Phi4MMModel
    or
  • create a dummy prepare_inputs_for_generation() method under Phi4MMModel class

same .plz fix it.

I created a fork where I fixed the issue by adding a dummy function prepare_inputs_for_generation() as suggested by @mqpham : https://huggingface.co/Lexius/Phi-4-multimodal-instruct

Sign up or log in to comment