File tree Expand file tree Collapse file tree 5 files changed +11
-5
lines changed Expand file tree Collapse file tree 5 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 25
25
from paddleformers .transformers .bert .configuration import BertConfig
26
26
from paddleformers .utils .download import DownloadSource
27
27
from paddleformers .utils .env import CONFIG_NAME
28
- from tests .testing_utils import set_proxy
28
+ from tests .testing_utils import set_proxy , skip_for_none_ce_case
29
29
30
30
from ...utils .test_module .custom_configuration import CustomConfig
31
31
@@ -60,6 +60,7 @@ def test_community_model_class(self):
60
60
auto_config = AutoConfig .from_pretrained (tempdir )
61
61
self .assertEqual (auto_config .hidden_size , number )
62
62
63
+ @skip_for_none_ce_case
63
64
@set_proxy (DownloadSource .HUGGINGFACE )
64
65
def test_from_hf_hub (self ):
65
66
config = AutoConfig .from_pretrained ("dfargveazd/tiny-random-llama-paddle-safe" , download_hub = "huggingface" )
Original file line number Diff line number Diff line change 35
35
from paddleformers .transformers .auto .modeling import MODEL_MAPPING
36
36
from paddleformers .utils .download import DownloadSource
37
37
from paddleformers .utils .env import CONFIG_NAME , PADDLE_WEIGHTS_NAME
38
- from tests .testing_utils import set_proxy
38
+ from tests .testing_utils import set_proxy , skip_for_none_ce_case
39
39
40
40
from ...utils .test_module .custom_configuration import CustomConfig
41
41
from ...utils .test_module .custom_model import CustomModel
@@ -76,6 +76,7 @@ def test_model_from_pretrained_cache_dir(self):
76
76
self .assertFalse (os .path .exists (os .path .join (tempdir , model_name , model_name )))
77
77
78
78
# @unittest.skip("skipping due to connection error!")
79
+ @skip_for_none_ce_case
79
80
@set_proxy (DownloadSource .HUGGINGFACE )
80
81
def test_from_hf_hub (self ):
81
82
model = AutoModel .from_pretrained (
Original file line number Diff line number Diff line change 27
27
from paddleformers .utils import CONFIG_NAME
28
28
from paddleformers .utils .download import DownloadSource
29
29
from paddleformers .utils .env import LEGACY_CONFIG_NAME
30
- from tests .testing_utils import set_proxy
30
+ from tests .testing_utils import set_proxy , skip_for_none_ce_case
31
31
32
32
33
33
class FakeSimplePretrainedModelConfig (PretrainedConfig ):
@@ -154,6 +154,7 @@ def test_from_pretrained_cache_dir(self):
154
154
# check against double appending model_name in cache_dir
155
155
self .assertFalse (os .path .exists (os .path .join (tempdir , model_id , model_id )))
156
156
157
+ @skip_for_none_ce_case
157
158
@set_proxy (DownloadSource .HUGGINGFACE )
158
159
def test_load_from_hf (self ):
159
160
"""test load config from hf"""
Original file line number Diff line number Diff line change 18
18
19
19
from paddleformers .transformers import AutoTokenizer , Qwen2Tokenizer
20
20
from paddleformers .utils .download import DownloadSource
21
- from tests .testing_utils import set_proxy
21
+ from tests .testing_utils import set_proxy , skip_for_none_ce_case
22
22
23
23
24
24
class TestHFMultiSourceTokenizer (unittest .TestCase ):
@@ -42,6 +42,7 @@ def test_model_scope(self):
42
42
tokenizer = Qwen2Tokenizer .from_pretrained ("Qwen/Qwen2.5-7B-Instruct" , download_hub = "modelscope" )
43
43
self .encode (tokenizer )
44
44
45
+ @skip_for_none_ce_case
45
46
@set_proxy (DownloadSource .HUGGINGFACE )
46
47
def test_hf_hub (self ):
47
48
tokenizer = AutoTokenizer .from_pretrained ("Qwen/Qwen2.5-7B-Instruct" , download_hub = "huggingface" )
@@ -55,6 +56,7 @@ def test_default(self):
55
56
tokenizer = Qwen2Tokenizer .from_pretrained ("Qwen/Qwen2.5-7B-Instruct" )
56
57
self .encode (tokenizer )
57
58
59
+ @skip_for_none_ce_case
58
60
@set_proxy (DownloadSource .HUGGINGFACE )
59
61
def test_ernie_4_5_tokenizer (self ):
60
62
tokenizer = AutoTokenizer .from_pretrained ("baidu/ERNIE-4.5-21B-A3B-PT" , download_hub = "huggingface" )
Original file line number Diff line number Diff line change 39
39
from paddleformers .transformers .model_utils import PretrainedModel
40
40
from paddleformers .utils .env import CONFIG_NAME , LEGACY_CONFIG_NAME # MODEL_HOME,
41
41
42
- from ..testing_utils import slow
42
+ from ..testing_utils import skip_for_none_ce_case , slow
43
43
44
44
45
45
def _config_zero_init (config ):
@@ -785,6 +785,7 @@ class ModelTesterPretrainedMixin:
785
785
786
786
# Download from HF doesn't work in CI yet
787
787
@slow
788
+ @skip_for_none_ce_case
788
789
def test_model_from_pretrained_hf_hub (self ):
789
790
if self .hf_remote_test_model_path is None or self .base_model_class is None :
790
791
return
You can’t perform that action at this time.
0 commit comments