backpack-gpt2-nli / configuration_backpack_gpt2_nli.py
ErfanMoosaviMonazzah's picture
Upload model
71bb029
raw
history blame contribute delete
756 Bytes
from transformers.models.gpt2.configuration_gpt2 import GPT2Config
class BackpackGPT2NLIConfig(GPT2Config):
def __init__(self,
freeze_backpack=True,
num_labels=3,
vocab_size=50264,
num_senses=16,
sense_intermediate_scale=4,
n_positions=512,
scale_attn_by_inverse_layer_idx=True,
**kwargs,
):
self.freeze_backpack = freeze_backpack
#self.num_labels = num_labels
self.num_senses = num_senses
self.sense_intermediate_scale = sense_intermediate_scale
super().__init__(vocab_size=vocab_size, n_positions=n_positions, scale_attn_by_inverse_layer_idx=scale_attn_by_inverse_layer_idx, num_labels=num_labels, **kwargs)