ivanzhouyq
commited on
Commit
•
fb88855
1
Parent(s):
8de19fe
Update model name in auto_map
Browse files- backpack_model.py +1 -1
- config.json +1 -1
backpack_model.py
CHANGED
@@ -148,7 +148,7 @@ class BackpackGPT2Model(BackpackGPT2PreTrainedModel):
|
|
148 |
def get_sense_network(self):
|
149 |
return self.sense_network
|
150 |
|
151 |
-
def forward(self, input_ids, position_ids):
|
152 |
# Compute senses
|
153 |
sense_input_embeds = self.word_embeddings(input_ids)
|
154 |
senses = self.sense_network(sense_input_embeds) # (bs, nv, s, d)
|
|
|
148 |
def get_sense_network(self):
|
149 |
return self.sense_network
|
150 |
|
151 |
+
def forward(self, input_ids, position_ids: Optional[torch.LongTensor] = None):
|
152 |
# Compute senses
|
153 |
sense_input_embeds = self.word_embeddings(input_ids)
|
154 |
senses = self.sense_network(sense_input_embeds) # (bs, nv, s, d)
|
config.json
CHANGED
@@ -76,7 +76,7 @@
|
|
76 |
"sense_intermediate_scale": 4,
|
77 |
"auto_map": {
|
78 |
"AutoConfig": "backpack_config.BackpackGPT2Config",
|
79 |
-
"AutoModelForCausalLM": "backpack_model.
|
80 |
},
|
81 |
"model_type": "backpack-gpt2"
|
82 |
}
|
|
|
76 |
"sense_intermediate_scale": 4,
|
77 |
"auto_map": {
|
78 |
"AutoConfig": "backpack_config.BackpackGPT2Config",
|
79 |
+
"AutoModelForCausalLM": "backpack_model.BackpackGPT2LMHeadModel"
|
80 |
},
|
81 |
"model_type": "backpack-gpt2"
|
82 |
}
|