File size: 756 Bytes
71bb029
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)