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 GenerationMixin
transformers-4.50
Suggestion: Either
- add GenerationMixin to Phi4MMModel
or - create a dummy prepare_inputs_for_generation() method under Phi4MMModel class
same
same
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