OpenDelta
OpenDelta copied to clipboard
Got unsupported ScalarType BFloat16 when saving delta tuned model
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