LLMZoo icon indicating copy to clipboard operation
LLMZoo copied to clipboard

Load checkpoint in inference

Open fitexmage opened this issue 2 years ago • 5 comments

I trained the model and save the checkpoint successfully. After that, how could I load the checkpoint in inference? I tried to use the checkpoint path as the model path but get "does not appear to have a file named config.json."

fitexmage avatar Jun 02 '23 13:06 fitexmage

Dear @fitexmage,

Could you provide more details, e.g., the Transformers version? Is there any config.json in the specified path?

Note that the path should be the directory to the checkpoint instead of the ".bin" path.

Best, Zhihong

zhjohnchan avatar Jun 04 '23 11:06 zhjohnchan

Hi @zhjohnchan, Thanks for your response. After posting my issue, I tried to install a lower version of transformers (4.28.0) and it works! Transformers higher than 4.29 seems not have a loadable output.

fitexmage avatar Jun 05 '23 03:06 fitexmage

Same error!

jianliu-ml avatar Jun 16 '23 01:06 jianliu-ml

Hi @zhjohnchan, Thanks for your response. After posting my issue, I tried to install a lower version of transformers (4.28.0) and it works! Transformers higher than 4.29 seems not have a loadable output.

Hi, how you solve it? A lower version of transformers does not work.

jianliu-ml avatar Jun 16 '23 10:06 jianliu-ml

Hi @zhjohnchan, Thanks for your response. After posting my issue, I tried to install a lower version of transformers (4.28.0) and it works! Transformers higher than 4.29 seems not have a loadable output.

Hi, how you solve it? A lower version of transformers does not work.

Hi, after saving the model, I just change the model path to the checkpoint and it works, like python -m llmzoo.deploy.cli --model-path checkpoints/phoenix_7b/. "config.json" should occurred in the checkpoint if transformers is 4.28.0.

fitexmage avatar Jun 16 '23 14:06 fitexmage