Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

导入checkpoint #141

Open
renyingxuan opened this issue Dec 12, 2024 · 1 comment
Open

导入checkpoint #141

renyingxuan opened this issue Dec 12, 2024 · 1 comment

Comments

@renyingxuan
Copy link

你好,我在预训练结束后尝试导入checkpoint的时候,会报这个错误
Traceback (most recent call last):
File "/root/miniconda3/envs/bunny/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 1048, in from_pretrained
config_class = CONFIG_MAPPING[config_dict["model_type"]]
File "/root/miniconda3/envs/bunny/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 750, in getitem
raise KeyError(key)
KeyError: 'bunny-phi'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/autodl-tmp/Bunny-main/script/val.py", line 26, in
config = BunnyPhiConfig.from_pretrained(model_name)
File "/root/miniconda3/envs/bunny/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 1050, in from_pretrained
raise ValueError(
ValueError: The checkpoint you are trying to load has model type bunny-phi but Transformers does not recognize this architecture. This could be because of an issue with the checkpoint, or because your version of Transformers is out of date.

@Isaachhh
Copy link
Collaborator

If you have intsalled Bunny, it shouldn't be like that.

The snippet in Quickstart is used for Bunny-v1.0-3B (SigLIP + Phi-2) and so on. We manually combine some configuration code into a single file for users' convenience. Also, you can check modeling_bunny_phi.py and configuration_bunny_phi.py and their related parts in the source code of Bunny to see the difference.

For other models including models trained by yourself, we currently only support loading them with installing source code of Bunny. Or you can copy modeling_bunny_phi.py and configuration_bunny_phi.py into your model and edit config.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants