composer.models.gpt2.gpt2_hparams#

YAHP interface for GPT2Model.

Hparams

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

GPT2Hparams

YAHP interface for GPT2Model.

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

Bases: composer.models.model_hparams.ModelHparams

YAHP interface for GPT2Model.

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

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

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

  • tokenizer_name (str, optional) โ€“ The tokenizer used for this model, necessary to assert required model inputs. Default None.

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