xlm.commands.lightning_generate
instantiate_model(cfg, datamodule, tokenizer)
Instantiate and load a model for generation.
Supports loading from full checkpoints, model-only checkpoints, or HF Hub.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
DictConfig
|
Hydra config |
required |
datamodule
|
Any
|
Datamodule |
required |
tokenizer
|
Any
|
Tokenizer |
required |
Returns:
| Type | Description |
|---|---|
Harness
|
Loaded Harness model ready for generation |