-
Notifications
You must be signed in to change notification settings - Fork 527
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
How to load ckpt files generated bytorchtune.utils.FullModelHFCheckpointer
into hf models
#878
Comments
I've figure it out. I post my understanding here if anyone has same question. First of all,
{
"metadata": {
"total_size": 32121044992
},
"weight_map": {
"lm_head.weight": "hf_model_0007_0.pt",
"model.embed_tokens.weight": "hf_model_0001_0.pt",
"model.layers.0.input_layernorm.weight": "hf_model_0001_0.pt"
...
I hope these help! |
@BMPixel absolutely spot on! Thanks so much for the detailed comment on this - all of this makes sense to me. You can simply rename the Did you need any other changes? Or is the json change worked? |
When using
torchtune.utils.FullModelHFCheckpointer
to load huggingface models, it reads *.safetensor files, while it instead outputs *.pt as ckpt files. The *.pt can not be load withfrom_pretrained
function.Is there a way to convert *.pt ckpt files into something like
pytorch_model.bin
or*.safetensors
?This issue is similar to #832 , which seem focus on converting meta ckpt files like
consolidated.xx.pth
. I am wondering will it be good to have a cli tool to convert ckpts between meta, pytorch and huggingface formats? That will be helpful.The text was updated successfully, but these errors were encountered: