YAHP interface for GPT2Model.


These classes are used with yahp for YAML-based configuration.


YAHP interface for GPT2Model.

class composer.models.gpt2.gpt2_hparams.GPT2Hparams(initializers=<factory>, num_classes=None, tokenizer_name=None, pretrained_model_name=None, model_config=<factory>, use_pretrained=False, gradient_checkpointing=False)[source]#

Bases: composer.models.transformer_hparams.TransformerHparams

YAHP interface for GPT2Model.

  • pretrained_model_name (str) โ€“ Pretrained model name to pull from Hugging Face Model Hub.

  • model_config (Dict[str, JSON]) โ€“ A dictionary providing a HuggingFace model configuration.

  • tokenizer_name (Optional[str]) โ€“ The tokenizer used for this model, necessary to assert required model inputs.

  • use_pretrained (bool, optional) โ€“ Whether to initialize the model with the pretrained weights. Default: False.

  • gradient_checkpointing (bool, optional) โ€“ Use gradient checkpointing. Default: False.