can we use ckpt model file generated after finetuning the pre-trained models on custom dataset
Hi Team,

I have fine tuned pegasus huggingface wikihow model with my own custom dataset and end up with below files:

model.ckpt-1000.data-00000-of-00001
model.ckpt-1000.index
model.ckpt-1000.meta
events.out.tfevents.1608192436.ip-xxx-xx-x-xx
events.out.tfevents.1608192510.ip-xxx-xx-x-xx.v2

When I am running below code, it is taking pytorch_model.bin file automatically for generating summary. Where as I want to use ckpt model file for generating summary which I got after training.

**Code I am using is :**

model_path ='local-pegasus-wikihow'

torch_device = 'cuda' if torch.cuda.is_available() else 'cpu'
tokenizer = PegasusTokenizer.from_pretrained(model_path)

model = PegasusForConditionalGeneration.from_pretrained(model_path).to(torch_device)

batch = tokenizer.prepare_seq2seq_batch(src_text, truncation=True, padding='longest', return_tensors="pt").to(torch_device)
translated = model.generate(**batch)
tgt_text = tokenizer.batch_decode(translated, skip_special_tokens=True)
print(tgt_text[0])

Do I need to change code here so that it will take ckpt model file for generating summary instead of searching for pre-trained pytorch_model.bin or .h5 file?
hi @SagarPalyal  not sure what you mean here. by ckpt file do you mean a saved checkpoint ?<|||||>Yes you are right. This is saved checkpoint file only.<|||||>One thing to note: `pytorch_model.bin` is the name of the weights file, and every torch HF model will have that file.

To load the checkpoint simply pass the path for the checkpoint instead  of `model_path`<|||||>Hey, @SagarPalyal did you solve the problem? I met the same problem. 'from_pretrained' function needs pytorch model file, not tensorflow model file. I don't know how to convert a costumed pegasus tensorflow model to pytorch model. Anyone knows??? <|||||>I am not able to figure out how to convert .ckpt file to pytorch model file but in your case if you have tensorflow model file then you can use parameter from_tf=True<|||||>This issue has been automatically marked as stale and been closed because it has not had recent activity. Thank you for your contributions.

If you think this still needs to be addressed please comment on this thread.<|||||>After fine-tuning Stable diffusion model in Huggingface, I got checkpoint files like pytorch_model.bin and scheduler.bin.
To get model.ckpt file from this directory, I needed to use CheckPoint Merger in AUTOMATIC1111.
Still finding if there is other checkpoint merger app, but no result. :(