pyvene.models.backpack_gpt2.modelings_backpack_gpt2#
Classes
|
|
|
This is the configuration class to store the configuration of a [GPT2Model] or a [TFGPT2Model]. It is used to instantiate a Backpack GPT-2 model according to the specified arguments, defining the model architecture. Configuration objects inherit from [GPT2Config] and can be used to control the model outputs. Read the documentation from [GPT2Config] for more information. Args: num_senses (int, optional, defaults to 16): The number of sense vectors to define for each word. sense_intermediate_scale (int, optional, defaults ot 4): The hidden dimensionality of the sense vector network. Example: ```python >>> from transformers import BackpackGPT2Config, BackpackGPT2Model >>> # Initializing a GPT2 configuration >>> configuration = BackpackGPT2Config() >>> # Initializing a model (with random weights) from the configuration >>> model = BackpackGPT2Model(configuration) >>> # Accessing the model configuration >>> configuration = model.config. |
|
|
|
|
|
|
|
An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models. |
|
|
|
|
|
|
|