4343from ....common .vlm .transformers .model_outputs import (
4444 BaseModelOutputWithPastAndCrossAttentions ,
4545)
46- from ._config import PPOCRVLConfig
46+ from ._config import PaddleOCRVLConfig
4747from ._distributed import (
4848 AllGatherVarlenOp ,
4949 ColumnParallelLinear ,
@@ -76,7 +76,7 @@ def calc_lm_head_logits(
7676 handling sequence parallelism and tensor parallelism configurations.
7777
7878 Args:
79- config (PPOCRVLConfig ): Model configuration.
79+ config (PaddleOCRVLConfig ): Model configuration.
8080 hidden_states (Tensor): Hidden states from the transformer layers
8181 weight (Tensor): Weight matrix for the language model head
8282 bias (Tensor): Bias vector for the language model head
@@ -263,7 +263,7 @@ def __init__(self, config):
263263 Initialize RMSNorm layer.
264264
265265 Args:
266- config (PPOCRVLConfig ): Model configuration.
266+ config (PaddleOCRVLConfig ): Model configuration.
267267 """
268268 super ().__init__ ()
269269 self .hidden_size = config .hidden_size
@@ -324,7 +324,7 @@ def __init__(self, config):
324324 Initialize LayerNorm with configuration.
325325
326326 Args:
327- config (PPOCRVLConfig ): Model configuration contains normalization parameters and flags.
327+ config (PaddleOCRVLConfig ): Model configuration contains normalization parameters and flags.
328328 """
329329 super ().__init__ (config .hidden_size , epsilon = config .rms_norm_eps )
330330 self .config = config
@@ -334,7 +334,7 @@ def __init__(self, config):
334334
335335
336336class KeyeRotaryEmbedding (nn .Layer ):
337- def __init__ (self , config : PPOCRVLConfig , device = None ):
337+ def __init__ (self , config : PaddleOCRVLConfig , device = None ):
338338 super ().__init__ ()
339339 self .rope_kwargs = {}
340340 if config is None :
@@ -408,7 +408,7 @@ def __init__(self, config, layer_idx=0):
408408 Initialize the MLP module with configuration options.
409409
410410 Args:
411- config (PPOCRVLConfig ): Model configurations.
411+ config (PaddleOCRVLConfig ): Model configurations.
412412 layer_idx (int): Index of current layer (default: 0)
413413 """
414414 super ().__init__ ()
@@ -507,7 +507,7 @@ def __init__(self, config, layer_idx=0):
507507 """Initialize the attention layer.
508508
509509 Args:
510- config (PPOCRVLConfig ): Model configuration.
510+ config (PaddleOCRVLConfig ): Model configuration.
511511 layer_idx (int, optional): Index in transformer stack. Defaults to 0.
512512 """
513513 super ().__init__ ()
@@ -1223,7 +1223,7 @@ def __init__(self, config, return_tuple=True):
12231223 """Initialize the pretraining criterion.
12241224
12251225 Args:
1226- config (PPOCRVLConfig ): Model configuration.
1226+ config (PaddleOCRVLConfig ): Model configuration.
12271227 return_tuple (bool): Whether to return loss as tuple (loss, loss_sum). Defaults to True.
12281228 """
12291229 super (ErniePretrainingCriterion , self ).__init__ ()
@@ -1516,7 +1516,7 @@ def __init__(self, config):
15161516 """Initialize the language model head.
15171517
15181518 Args:
1519- config (PPOCRVLConfig ): Model configuration containing:
1519+ config (PaddleOCRVLConfig ): Model configuration containing:
15201520 - vocab_size: Size of vocabulary
15211521 - hidden_size: Dimension of hidden states
15221522 - tensor_parallel_degree: Degree of tensor parallelism
@@ -1632,7 +1632,7 @@ def __init__(self, config, layer_idx):
16321632 """Initialize the decoder layer.
16331633
16341634 Args:
1635- config (PPOCRVLConfig ): Model configuration.
1635+ config (PaddleOCRVLConfig ): Model configuration.
16361636 layer_idx (int): Index of this layer in the transformer stack
16371637 """
16381638 super ().__init__ ()
@@ -1776,15 +1776,15 @@ def model_parallel_dropout(self):
17761776class Ernie4_5PretrainedModel (PretrainedModel ):
17771777 """Base class for ERNIE pretrained models."""
17781778
1779- config_class = PPOCRVLConfig
1779+ config_class = PaddleOCRVLConfig
17801780 base_model_prefix = "ernie"
17811781
17821782 @classmethod
17831783 def _get_tensor_parallel_mappings (cls , config , is_split = True ):
17841784 """Generate tensor parallel mappings for model conversion.
17851785
17861786 Args:
1787- config (PPOCRVLConfig ): Model configuration.
1787+ config (PaddleOCRVLConfig ): Model configuration.
17881788 is_split (bool): Whether to generate split mappings (True)
17891789 or merge mappings (False). Defaults to True.
17901790
@@ -2005,11 +2005,11 @@ def get_tensor_parallel_split_mappings(num_hidden_layers):
20052005class Ernie4_5Model (Ernie4_5PretrainedModel ):
20062006 """The core ERNIE transformer model"""
20072007
2008- def __init__ (self , config : PPOCRVLConfig ):
2008+ def __init__ (self , config : PaddleOCRVLConfig ):
20092009 """Initialize the ERNIE model architecture.
20102010
20112011 Args:
2012- config (PPOCRVLConfig ): Model configuration.
2012+ config (PaddleOCRVLConfig ): Model configuration.
20132013 """
20142014 super ().__init__ (config )
20152015 self .padding_idx = config .pad_token_id
0 commit comments