huggingface / transformers

🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://huggingface.co/transformers
Apache License 2.0
128.62k stars 25.51k forks source link

from transformers import Phi3VModel, Phi3VConfig. Phi3 Vision config not added to transformers. #31073

Closed sankydesai closed 6 hours ago

sankydesai commented 1 month ago

System Info

from transformers import Phi3VModel, Phi3VConfig. Fails with error: ImportError: cannot import name 'Phi3VModel' from 'transformers' (/usr/local/lib/python3.10/dist-packages/transformers/init.py)

Note: Installed Transformers from source.

Who can help?

No response

Information

Tasks

Reproduction

!pip install -U git+https://github.com/huggingface/transformers from transformers import Phi3VModel, Phi3VConfig

Expected behavior

No Error.

shauray8 commented 1 month ago

Hey @sankydesai, I don't think you can really import Phi3VModel or Phi3VForCausalLM directly from transformers

The configuration for the Phi3 Vision model includes an auto_map field, which indicates the appropriate classes to use for loading the model.

"auto_map": {
    "AutoConfig": "configuration_phi3_v.Phi3VConfig",
    "AutoModelForCausalLM": "modeling_phi3_v.Phi3VForCausalLM"
}

Which is uploaded on the hub itself

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.