remove commented out
Browse files- modeling_myolmoe.py +0 -38
modeling_myolmoe.py
CHANGED
|
@@ -607,41 +607,3 @@ class MyOLMoEForCausalLM(MyOLMoEPreTrainedModel):
|
|
| 607 |
router_logits=outputs.router_logits,
|
| 608 |
)
|
| 609 |
|
| 610 |
-
# def prepare_inputs_for_generation(
|
| 611 |
-
# self,
|
| 612 |
-
# input_ids,
|
| 613 |
-
# past_key_values=None,
|
| 614 |
-
# attention_mask=None,
|
| 615 |
-
# inputs_embeds=None,
|
| 616 |
-
# **kwargs,
|
| 617 |
-
# ):
|
| 618 |
-
# # Same as original implementation
|
| 619 |
-
# if past_key_values is not None:
|
| 620 |
-
# past_length = past_key_values[0][0].shape[2]
|
| 621 |
-
|
| 622 |
-
# if input_ids.shape[1] > past_length:
|
| 623 |
-
# remove_prefix_length = past_length
|
| 624 |
-
# else:
|
| 625 |
-
# remove_prefix_length = input_ids.shape[1] - 1
|
| 626 |
-
|
| 627 |
-
# input_ids = input_ids[:, remove_prefix_length:]
|
| 628 |
-
|
| 629 |
-
# position_ids = kwargs.get("position_ids", None)
|
| 630 |
-
# if attention_mask is not None and position_ids is None:
|
| 631 |
-
# position_ids = attention_mask.long().cumsum(-1) - 1
|
| 632 |
-
# position_ids.masked_fill_(attention_mask == 0, 1)
|
| 633 |
-
# if past_key_values:
|
| 634 |
-
# position_ids = position_ids[:, -input_ids.shape[1] :]
|
| 635 |
-
|
| 636 |
-
# if inputs_embeds is not None and past_key_values is None:
|
| 637 |
-
# model_inputs = {"inputs_embeds": inputs_embeds}
|
| 638 |
-
# else:
|
| 639 |
-
# model_inputs = {"input_ids": input_ids}
|
| 640 |
-
|
| 641 |
-
# model_inputs.update({
|
| 642 |
-
# "position_ids": position_ids,
|
| 643 |
-
# "past_key_values": past_key_values,
|
| 644 |
-
# "use_cache": kwargs.get("use_cache"),
|
| 645 |
-
# "attention_mask": attention_mask,
|
| 646 |
-
# })
|
| 647 |
-
# return model_inputs
|
|
|
|
| 607 |
router_logits=outputs.router_logits,
|
| 608 |
)
|
| 609 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|