From 349e1242d9551c3996f21b491d416d033e6a36fa Mon Sep 17 00:00:00 2001 From: Arthur <48595927+ArthurZucker@users.noreply.github.com> Date: Thu, 30 Mar 2023 15:36:07 +0200 Subject: [PATCH] [NLLB-MoE] `model_type` update for auto mapping (#22470) edit default model type and testing path set to hf-internal-testing --- src/transformers/models/nllb_moe/configuration_nllb_moe.py | 2 +- tests/models/nllb_moe/test_modeling_nllb_moe.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/transformers/models/nllb_moe/configuration_nllb_moe.py b/src/transformers/models/nllb_moe/configuration_nllb_moe.py index 03a37bb35d..3ff222b93c 100644 --- a/src/transformers/models/nllb_moe/configuration_nllb_moe.py +++ b/src/transformers/models/nllb_moe/configuration_nllb_moe.py @@ -125,7 +125,7 @@ class NllbMoeConfig(PretrainedConfig): >>> # Accessing the model configuration >>> configuration = model.config ```""" - model_type = "nllb_moe" + model_type = "nllb-moe" keys_to_ignore_at_inference = ["past_key_values"] attribute_map = {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"} diff --git a/tests/models/nllb_moe/test_modeling_nllb_moe.py b/tests/models/nllb_moe/test_modeling_nllb_moe.py index 567aab56ea..76cf4c0ea4 100644 --- a/tests/models/nllb_moe/test_modeling_nllb_moe.py +++ b/tests/models/nllb_moe/test_modeling_nllb_moe.py @@ -354,14 +354,14 @@ class NllbMoeModelIntegrationTests(unittest.TestCase): @cached_property def tokenizer(self): - return NllbTokenizer.from_pretrained("ArthurZ/random-nllb-moe-2-experts") + return NllbTokenizer.from_pretrained("hf-internal-testing/random-nllb-moe-2-experts") @cached_property def big_model(self): return NllbMoeForConditionalGeneration.from_pretrained("facebook/nllb-moe-54b") def inference_no_head(self): - model = NllbMoeModel.from_pretrained("ArthurZ/random-nllb-moe-2-experts").eval() + model = NllbMoeModel.from_pretrained("hf-internal-testing/random-nllb-moe-2-experts").eval() with torch.no_grad(): output = model(**self.model_inputs) # fmt: off @@ -382,7 +382,7 @@ class NllbMoeModelIntegrationTests(unittest.TestCase): and `transformers` implementation of NLLB-MoE transformers. We only check the logits of the second sample of the batch, as it is padded. """ - model = NllbMoeForConditionalGeneration.from_pretrained("ArthurZ/random-nllb-moe-2-experts").eval() + model = NllbMoeForConditionalGeneration.from_pretrained("hf-internal-testing/random-nllb-moe-2-experts").eval() with torch.no_grad(): output = model(**self.model_inputs)