Update modeling_internlm3.py (#18)

- Update modeling_internlm3.py (94cd46f35e87e1b3b2b82df73230bdb5275cd652)
- Update tokenization_internlm3.py (0f3d7019880c0b6f7a9d35b392d21cbfca07478b)
This commit is contained in:
ai-modelscope 2025-02-11 21:55:14 +08:00
parent b8f6295918
commit 2ecb8953b0
2 changed files with 3 additions and 2 deletions

View File

@ -793,7 +793,7 @@ class InternLM3Model(InternLM3PreTrainedModel):
Args: Args:
config: InternLM3Config config: InternLM3Config
""" """
_auto_class = "AutoModel"
def __init__(self, config: InternLM3Config): def __init__(self, config: InternLM3Config):
super().__init__(config) super().__init__(config)
self.padding_idx = config.pad_token_id self.padding_idx = config.pad_token_id
@ -1070,6 +1070,7 @@ class KwargsForCausalLM(FlashAttentionKwargs, LossKwargs): ...
class InternLM3ForCausalLM(InternLM3PreTrainedModel, GenerationMixin): class InternLM3ForCausalLM(InternLM3PreTrainedModel, GenerationMixin):
_auto_class = "AutoModelForCausalLM"
_tied_weights_keys = ["lm_head.weight"] _tied_weights_keys = ["lm_head.weight"]
_tp_plan = {"lm_head": "colwise_rep"} _tp_plan = {"lm_head": "colwise_rep"}

View File

@ -67,7 +67,7 @@ class InternLM3Tokenizer(PreTrainedTokenizer):
Whether or not to add an initial space to the input. This allows to treat the leading word just as any Whether or not to add an initial space to the input. This allows to treat the leading word just as any
other word. Again, this should be set with `from_slow=True` to make sure it's taken into account. other word. Again, this should be set with `from_slow=True` to make sure it's taken into account.
""" """
_auto_class = "AutoTokenizer"
vocab_files_names = VOCAB_FILES_NAMES vocab_files_names = VOCAB_FILES_NAMES
model_input_names = ["input_ids", "attention_mask"] model_input_names = ["input_ids", "attention_mask"]