pyvene.models.gpt2.modelings_intervenable_gpt2

pyvene.models.gpt2.modelings_intervenable_gpt2#

Each modeling file in this library is a mapping between abstract naming of intervention anchor points and actual model module defined in the huggingface library.

We also want to let the intervention library know how to config the dimensions of intervention based on model config defined in the huggingface library.

Module Attributes

gpt2_type_to_dimension_mapping

gpt2 model with LM head

gpt2_lm_type_to_dimension_mapping

gpt2 model with classifier head

Functions

create_gpt2([name, cache_dir])

Creates a GPT2 model, config, and tokenizer from the given name and revision

create_gpt2_classifier([name, config, cache_dir])

Creates a GPT2ForSequenceClassification, config, and tokenizer from the given name and revision

create_gpt2_lm([name, config, cache_dir])

Creates a GPT2 LM, config, and tokenizer from the given name and revision