← Về thư mục
verl/utils/model.py
- LambdaLayer · class · L28-L35 — class LambdaLayer(nn.Module)
- init · method · L30-L32 — def init(self, fn)
- forward · method · L34-L35 — def forward(self, args, *kwargs)
- squeeze · function · L38-L39 — def squeeze(x)
- update_model_config · function · L42-L44 — def update_model_config(module_config, override_config_kwargs)
- get_huggingface_actor_config · function · L47-L55 — def get_huggingface_actor_config(model_name: str, override_config_kwargs=None, trust_remote_code=False) -> Dict
- create_huggingface_actor · function · L58-L78 — def create_huggingface_actor(model_name: str, override_config_kwargs=None, automodel_kwargs=None) -> nn.Module
- create_huggingface_critic · function · L81-L99 — def create_huggingface_critic(model_name: str, override_config_kwargs=None, automodel_kwargs=None) -> nn.Module
- get_model_size · function · L102-L126 — def get_model_size(model: nn.Module, scale='auto')
- print_model_size · function · L129-L133 — def print_model_size(model: nn.Module, name: str = None)
- create_random_mask · function · L136-L174 — def create_random_mask(input_ids: torch.Tensor, max_ratio_of_valid_token: float, max_ratio_of_left_padding: float, min_ratio_of_valid_token: float = 0)
- compute_position_id_with_mask · function · L177-L178 — def compute_position_id_with_mask(mask)
- normalize_pp_vpp_params · function · L181-L231 — def normalize_pp_vpp_params(params, num_hidden_layers, layer_name='layers')
- normalize_model_name · function · L192-L220 — def normalize_model_name(name, pp_rank, vpp_rank, pp_size, vpp_size, num_layers)
- get_parallel_model_from_config · function · L234-L240 — def get_parallel_model_from_config(config, megatron_config, pre_process=None, post_process=None, value=False)
- _get_parallel_model_architecture_from_config · function · L243-L250 — def _get_parallel_model_architecture_from_config(config: PretrainedConfig, value=False) -> Type[nn.Module]
- load_megatron_model_weights · function · L253-L295 — def load_megatron_model_weights(config, model_config, parallel_model, params_dtype, is_value_model=False, local_cache_path='~/.cache/verl/rlhf')
- pad_packed_inputs · function · L299-L332 — def pad_packed_inputs(unpad_tokens: torch.Tensor, cu_seqlens, max_seqlen_in_batch, size)