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

Got unsupported ScalarType BFloat16 when saving delta tuned model #80

Open
Lauriane-git opened this issue May 9, 2024 · 0 comments
Open

Comments

@Lauriane-git
Copy link

When training MiniCPM (https://huggingface.co/openbmb/MiniCPM-2B-sft-bf16/) using OpenDelta, I ran into a type conversion error when saving the model delta_model.save_finetuned("./delta_model"):

File "/opendelta/utils/model_md5.py", line 26, in gen_parameter_hash
md5.update(x.cpu().numpy().data.tobytes())
TypeError: Got unsupported ScalarType BFloat16

I fixed it locally importing torch and modifying the line to md5.update(x.cpu().to(torch.float32).numpy().data.tobytes()), but there may be other users running into this same issue

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

1 participant