xlm.commands.lightning_generate
instantiate_model(cfg, datamodule, tokenizer)
Supports two modes
- Load a model from full training checkpoint using
lightning_module.load_from_checkpoint(cfg.generation.ckpt_path) - Load a model from model only checkpoint using
lightning_module.model.load_state_dict(torch.load(cfg.generation.model_only_checkpoint_path))
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
DictConfig
|
Hydra config |
required |
generation_ckpt_path
|
Path to the generation checkpoint |
required | |
datamodule
|
Any
|
Datamodule |
required |