Upload modeling_mplug_owl2.py with huggingface_hub
Browse files- modeling_mplug_owl2.py +2 -1
modeling_mplug_owl2.py
CHANGED
@@ -257,10 +257,11 @@ class MPLUGOwl2LlamaForCausalLM(LlamaForCausalLM, MPLUGOwl2MetaForCausalLM):
|
|
257 |
|
258 |
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
|
259 |
self.preferential_ids_ = [id_[1] for id_ in self.tokenizer(["excellent","good","fair","poor","bad"])["input_ids"]]
|
260 |
-
self.weight_tensor = torch.Tensor([5.,4.,3.,2.,1.]).half().to(self.device)
|
261 |
|
262 |
# Initialize weights and apply final processing
|
263 |
self.post_init()
|
|
|
|
|
264 |
|
265 |
def get_model(self):
|
266 |
return self.model
|
|
|
257 |
|
258 |
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
|
259 |
self.preferential_ids_ = [id_[1] for id_ in self.tokenizer(["excellent","good","fair","poor","bad"])["input_ids"]]
|
|
|
260 |
|
261 |
# Initialize weights and apply final processing
|
262 |
self.post_init()
|
263 |
+
|
264 |
+
self.weight_tensor = torch.Tensor([5.,4.,3.,2.,1.]).half().to(self.device)
|
265 |
|
266 |
def get_model(self):
|
267 |
return self.model
|