File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
paddlenlp/transformers/gpt Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 18
18
19
19
from paddlenlp .transformers .configuration_utils import PretrainedConfig
20
20
21
- __all__ = ["GPT_PRETRAINED_INIT_CONFIGURATION" , "GPTConfig" ]
21
+ __all__ = ["GPT_PRETRAINED_INIT_CONFIGURATION" , "GPTConfig" , "GPT_PRETRAINED_RESOURCE_FILES_MAP" ]
22
22
23
23
GPT_PRETRAINED_INIT_CONFIGURATION = {
24
24
"gpt-cpm-large-cn" : { # 2.6B
147
147
},
148
148
}
149
149
150
+ GPT_PRETRAINED_RESOURCE_FILES_MAP = {
151
+ "model_state" : {
152
+ "gpt-cpm-large-cn" : "https://bj.bcebos.com/paddlenlp/models/transformers/gpt/gpt-cpm-large-cn.pdparams" ,
153
+ "gpt-cpm-small-cn-distill" : "https://bj.bcebos.com/paddlenlp/models/transformers/gpt/gpt-cpm-small-cn-distill.pdparams" ,
154
+ "gpt2-en" : "https://bj.bcebos.com/paddlenlp/models/transformers/gpt/gpt2-en.pdparams" ,
155
+ "gpt2-medium-en" : "https://bj.bcebos.com/paddlenlp/models/transformers/gpt/gpt2-medium-en.pdparams" ,
156
+ "gpt2-large-en" : "https://bj.bcebos.com/paddlenlp/models/transformers/gpt/gpt2-large-en.pdparams" ,
157
+ "gpt2-xl-en" : "https://bj.bcebos.com/paddlenlp/models/transformers/gpt/gpt2-xl-en.pdparams" ,
158
+ }
159
+ }
160
+
150
161
151
162
class GPTConfig (PretrainedConfig ):
152
163
r"""
Original file line number Diff line number Diff line change 49
49
TokenClassifierOutput ,
50
50
)
51
51
from ..model_utils import dy2st_nocheck_guard_context
52
- from .configuration import GPT_PRETRAINED_INIT_CONFIGURATION , GPTConfig
52
+ from .configuration import (
53
+ GPT_PRETRAINED_INIT_CONFIGURATION ,
54
+ GPT_PRETRAINED_RESOURCE_FILES_MAP ,
55
+ GPTConfig ,
56
+ )
53
57
54
58
try :
55
59
from paddle .nn .functional .flash_attention import flash_attention
@@ -787,6 +791,7 @@ class GPTPretrainedModel(PretrainedModel):
787
791
base_model_prefix = "gpt"
788
792
config_class = GPTConfig
789
793
pretrained_init_configuration = GPT_PRETRAINED_INIT_CONFIGURATION
794
+ pretrained_resource_files_map = GPT_PRETRAINED_RESOURCE_FILES_MAP
790
795
791
796
@classmethod
792
797
def _get_tensor_parallel_mappings (cls , config , is_split = True ):
You can’t perform that action at this time.
0 commit comments