Closed blurLake closed 2 years ago
My task is a generation task, so I reused run_gen.py.
Hi, if the model folder does not contain config.json
, you load the model via
from transformers import T5Config, RobertaTokenizer, T5ForConditionalGeneration
config = T5Config.from_pretrained('Salesforce/codet5-small')
model = T5ForConditionalGeneration.from_pretrained("dir_saved_model", config=config)
Or you can revise the way you save the model in run_gen.py
here like this: model.save_pretrained(output_model_file)
. Then the output_model_file
will contain config.json
.
Hi,
I fine-tuned a model using my own dataset, task and subtask. Say the task is called "own_task" and subtask is "c" since it is about c scripts. Now I have models saved in saved_models/own_task/c/codet5_small/checkpoint-best-ppl/ and checkpoint-last/ as pytorch_model.bin. Then I try to load this model using
It fails with error about missing config.json file. Is this the correct way to load the model? Do I need to generate a config.json for the model manually, or it can be done automatically?
Thank you very much.