Remove static pretrained maps from the library's internals (#29112)
* [test_all] Remove static pretrained maps from the library's internals * Deprecate archive maps instead of removing them * Revert init changes * [test_all] Deprecate instead of removing * [test_all] PVT v2 support * [test_all] Tests should all pass * [test_all] Style * Address review comments * Update src/transformers/models/deprecated/_archive_maps.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * Update src/transformers/models/deprecated/_archive_maps.py Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * [test_all] trigger tests * [test_all] LLAVA * [test_all] Bad rebase --------- Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
This commit is contained in:
@@ -39,7 +39,6 @@ if is_torch_available():
|
||||
Data2VecTextModel,
|
||||
)
|
||||
from transformers.models.data2vec.modeling_data2vec_text import (
|
||||
DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST,
|
||||
Data2VecTextForTextEmbeddings,
|
||||
create_position_ids_from_input_ids,
|
||||
)
|
||||
@@ -470,9 +469,9 @@ class Data2VecTextModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTes
|
||||
|
||||
@slow
|
||||
def test_model_from_pretrained(self):
|
||||
for model_name in DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
|
||||
model = Data2VecTextModel.from_pretrained(model_name)
|
||||
self.assertIsNotNone(model)
|
||||
model_name = "facebook/data2vec-text-base"
|
||||
model = Data2VecTextModel.from_pretrained(model_name)
|
||||
self.assertIsNotNone(model)
|
||||
|
||||
def test_create_position_ids_respects_padding_index(self):
|
||||
"""Ensure that the default position ids only assign a sequential . This is a regression
|
||||
|
||||
@@ -36,7 +36,6 @@ if is_torch_available():
|
||||
Data2VecVisionModel,
|
||||
)
|
||||
from transformers.models.auto.modeling_auto import MODEL_MAPPING_NAMES
|
||||
from transformers.models.data2vec.modeling_data2vec_vision import DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST
|
||||
|
||||
|
||||
if is_vision_available():
|
||||
@@ -298,9 +297,9 @@ class Data2VecVisionModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.Te
|
||||
|
||||
@slow
|
||||
def test_model_from_pretrained(self):
|
||||
for model_name in DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
|
||||
model = Data2VecVisionModel.from_pretrained(model_name)
|
||||
self.assertIsNotNone(model)
|
||||
model_name = "facebook/data2vec-vision-base-ft1k"
|
||||
model = Data2VecVisionModel.from_pretrained(model_name)
|
||||
self.assertIsNotNone(model)
|
||||
|
||||
|
||||
# We will verify our results on an image of cute cats
|
||||
|
||||
@@ -40,9 +40,6 @@ if is_tf_available():
|
||||
TFData2VecVisionModel,
|
||||
)
|
||||
from transformers.modeling_tf_utils import keras
|
||||
from transformers.models.data2vec.modeling_tf_data2vec_vision import (
|
||||
TF_DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST,
|
||||
)
|
||||
|
||||
if is_vision_available():
|
||||
from PIL import Image
|
||||
@@ -455,9 +452,9 @@ class TFData2VecVisionModelTest(TFModelTesterMixin, PipelineTesterMixin, unittes
|
||||
|
||||
@slow
|
||||
def test_model_from_pretrained(self):
|
||||
for model_name in TF_DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
|
||||
model = TFData2VecVisionModel.from_pretrained(model_name)
|
||||
self.assertIsNotNone(model)
|
||||
model_name = "facebook/data2vec-vision-base-ft1k"
|
||||
model = TFData2VecVisionModel.from_pretrained(model_name)
|
||||
self.assertIsNotNone(model)
|
||||
|
||||
|
||||
# We will verify our results on an image of cute cats
|
||||
|
||||
Reference in New Issue
Block a user