Skip to content

Commit

Permalink
关闭从hf下载和aistudio下载的单测. (#8198)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunnYu authored Mar 27, 2024
1 parent 4d49a3e commit acfa7f2
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/transformers/auto/test_confiugration.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ def test_community_model_class(self):
auto_config = AutoConfig.from_pretrained(tempdir)
self.assertEqual(auto_config.hidden_size, number)

@unittest.skip("skipping due to connection error!")
def test_from_hf_hub(self):
config = AutoConfig.from_pretrained("facebook/opt-66b", from_hf_hub=True)
self.assertEqual(config.hidden_size, 9216)

@unittest.skip("skipping due to connection error!")
def test_from_aistudio(self):
config = AutoConfig.from_pretrained("PaddleNLP/tiny-random-bert", from_aistudio=True)
self.assertEqual(config.hidden_size, 32)
Expand Down
2 changes: 2 additions & 0 deletions tests/transformers/auto/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ def test_model_from_pretrained_cache_dir(self):
# check against double appending model_name in cache_dir
self.assertFalse(os.path.exists(os.path.join(tempdir, model_name, model_name)))

@unittest.skip("skipping due to connection error!")
def test_from_hf_hub(self):
model = AutoModel.from_pretrained("PaddleCI/tiny-random-bert", from_hf_hub=True, convert_from_torch=False)
self.assertIsInstance(model, BertModel)

@unittest.skip("skipping due to connection error!")
def test_from_aistudio(self):
model = AutoModel.from_pretrained("PaddleNLP/tiny-random-bert", from_aistudio=True)
self.assertIsInstance(model, BertModel)
2 changes: 2 additions & 0 deletions tests/transformers/auto/test_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def test_use_faster(self):
else:
self.assertIsInstance(tokenizer, paddlenlp.transformers.BertTokenizer)

@unittest.skip("skipping due to connection error!")
def test_hf_tokenizer(self):
t1 = AutoTokenizer.from_pretrained(
"hf-internal-testing/tiny-random-BertModel", from_hf_hub=True, use_fast=True
Expand All @@ -58,6 +59,7 @@ def test_hf_tokenizer(self):
self.assertIsInstance(t1, paddlenlp.transformers.BertTokenizer)
self.assertIsInstance(t2, paddlenlp.transformers.BertTokenizer)

@unittest.skip("skipping due to connection error!")
def test_from_aistudio(self):
tokenizer = AutoTokenizer.from_pretrained("PaddleNLP/tiny-random-bert", from_aistudio=True)
self.assertIsInstance(tokenizer, paddlenlp.transformers.BertTokenizer)
Expand Down
1 change: 1 addition & 0 deletions tests/transformers/load_subfolder/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from tests.testing_utils import slow


@unittest.skip("skipping due to connection error!")
class ConfigLoadTester(unittest.TestCase):
@slow
def test_bert_config_load(self):
Expand Down
1 change: 1 addition & 0 deletions tests/transformers/load_subfolder/test_image_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from tests.testing_utils import slow


@unittest.skip("skipping due to connection error!")
class ImageProcessorLoadTester(unittest.TestCase):
@slow
def test_clip_load(self):
Expand Down
1 change: 1 addition & 0 deletions tests/transformers/load_subfolder/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from tests.testing_utils import slow


@unittest.skip("skipping due to connection error!")
class ModelLoadTester(unittest.TestCase):
@pytest.mark.skip
def test_config_diff(self, config_1, config_2):
Expand Down
1 change: 1 addition & 0 deletions tests/transformers/load_subfolder/test_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from tests.testing_utils import slow


@unittest.skip("skipping due to connection error!")
class ProcessorLoadTester(unittest.TestCase):
@slow
def test_clip_load(self):
Expand Down
1 change: 1 addition & 0 deletions tests/transformers/load_subfolder/test_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from tests.testing_utils import slow


@unittest.skip("skipping due to connection error!")
class TokenizerLoadTester(unittest.TestCase):
@slow
def test_bert_load(self):
Expand Down
1 change: 1 addition & 0 deletions tests/transformers/test_configuration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def test_from_pretrained_cache_dir(self):
# check against double appending model_name in cache_dir
self.assertFalse(os.path.exists(os.path.join(tempdir, model_id, model_id)))

@unittest.skip("skipping due to connection error!")
def test_load_from_hf(self):
"""test load config from hf"""
config = BertConfig.from_pretrained("hf-internal-testing/tiny-random-BertModel", from_hf_hub=True)
Expand Down

0 comments on commit acfa7f2

Please sign in to comment.