MCPcopy Create free account

hub / github.com/AMAP-ML/EMF / functions

Functions947 in github.com/AMAP-ML/EMF

↓ 2 callersMethodtasks_end_check
Check if the current generation sequences have finished.
trl/trl/environment/base_environment.py:400
↓ 2 callersMethodtokenize
(example, processing_class, dataset_text_field, assistant_only_loss)
trl/trl/trainer/sft_trainer.py:750
↓ 2 callersMethodtokenize_row
r""" Tokenize a row of the dataset. Args: features (`dict[str, str]`): Row of the dataset, should contain
trl/trl/trainer/prm_trainer.py:212
↓ 2 callersFunctiontop_k_top_p_filtering
Filter a distribution of logits using top-k and/or nucleus (top-p) filtering Args: logits: logits distribution shape (batch size, vocabula
tok/ar_dtok/generate.py:14
↓ 1 callersMethod__init__
(self, config: Qwen3Config)
blip3o/model/language_model/blip3o_qwen_inference.py:43
↓ 1 callersMethod__init__
(self, config: Qwen3Config)
blip3o/model/language_model/blip3o_qwen.py:26
↓ 1 callersMethod__init__
(self, config: Qwen3Config)
blip3o/model/language_model/blip3o_qwen_grpo.py:46
↓ 1 callersMethod__init__
(self)
trl/examples/scripts/ddpo.py:87
↓ 1 callersMethod__init__
( self, args: PPOConfig, processing_class: Optional[ Union[PreTrainedToken
trl/trl/trainer/ppo_trainer.py:102
↓ 1 callersMethod__init__
(self)
trl/trl/models/auxiliary_modules.py:26
↓ 1 callersMethod__init__
( self, pretrained_model=None, score_module=None, supports_rm_adapter=False, rm_adapter_name=None, **k
trl/trl/models/modeling_base.py:83
↓ 1 callersMethod__init__
(self)
trl/trl/models/activation_offloading.py:338
↓ 1 callersMethod__init__
( self, bottleneck_dim: int, input_dim: int, output_dim: int, token_nu
tok/ar_dtok/bottleneck.py:12
↓ 1 callersMethod_calculate_rewards
(self, inputs, prompts, generated_images)
trl/trl/trainer/grpo_trainer.py:1326
↓ 1 callersMethod_compute_judge
(self, model_data, ref_data, context_length)
trl/trl/trainer/xpo_trainer.py:256
↓ 1 callersMethod_compute_judge
(self, model_data, mixture_data, context_length)
trl/trl/trainer/nash_md_trainer.py:271
↓ 1 callersMethod_compute_logprobs
(self, model, model_data, ref_data, context_length)
trl/trl/trainer/xpo_trainer.py:291
↓ 1 callersMethod_compute_logprobs
(self, model, model_data, context_length)
trl/trl/trainer/nash_md_trainer.py:305
↓ 1 callersMethod_compute_loss
(self, model, inputs)
trl/trl/trainer/grpo_trainer.py:1898
↓ 1 callersMethod_compute_loss_liger
Compute the KTO loss using the Liger-Kernel's LigerFusedLinearKTOLoss. Args: model: The policy model use
trl/trl/trainer/kto_trainer.py:1204
↓ 1 callersMethod_compute_loss_liger
( self, model: nn.Module, batch: dict[str, Union[list, torch.LongTensor]] )
trl/trl/trainer/dpo_trainer.py:1193
↓ 1 callersMethod_compute_losses
( self, model_logprobs_model_data, model_logprobs_ref_data, ref_logprobs_ref_d
trl/trl/trainer/xpo_trainer.py:323
↓ 1 callersMethod_compute_losses
( self, model_logprobs_model_data, ref_logprobs_model_data, probability, )
trl/trl/trainer/nash_md_trainer.py:330
↓ 1 callersMethod_compute_rewards
(self, model_data, ref_data, context_length)
trl/trl/trainer/xpo_trainer.py:238
↓ 1 callersMethod_compute_rewards
(self, model_data, mixture_data, context_length)
trl/trl/trainer/nash_md_trainer.py:253
↓ 1 callersMethod_config_check
(self)
trl/trl/trainer/ddpo_trainer.py:561
↓ 1 callersMethod_convert_seq_lengths_to_position_ids
(batch_seq_lengths: list[list[int]])
trl/trl/trainer/sft_trainer.py:253
↓ 1 callersMethod_create_model_from_path
Creates a model from a path or model identifier.
trl/trl/trainer/iterative_sft_trainer.py:191
↓ 1 callersMethod_create_model_from_path
Creates a model from a path or model identifier.
trl/trl/trainer/sft_trainer.py:568
↓ 1 callersMethod_enable_gradient_checkpointing
Enables gradient checkpointing for the model.
trl/trl/trainer/sft_trainer.py:641
↓ 1 callersMethod_enable_gradient_checkpointing
Enables gradient checkpointing for the model.
trl/trl/trainer/grpo_trainer.py:1038
↓ 1 callersMethod_generate
(self, model, prompts)
trl/trl/trainer/online_dpo_trainer.py:499
↓ 1 callersMethod_generate_batched
Generate responses for a list of query tensors. Args: query_tensors (list[torch.Tensor]): A list of query tensors to gen
trl/trl/environment/base_environment.py:433
↓ 1 callersMethod_generate_completions
(self, prompts, model)
trl/trl/trainer/xpo_trainer.py:183
↓ 1 callersMethod_generate_completions
(self, model, prompts)
trl/trl/trainer/nash_md_trainer.py:178
↓ 1 callersMethod_generate_samples
Generate samples from the model Args: iterations (int): Number of iterations to generate samples for batch_s
trl/trl/trainer/ddpo_trainer.py:438
↓ 1 callersMethod_generate_samples
Generate samples from the model Args: batch_size (int): Batch size to use for sampling with_grad (bool): Whe
trl/trl/trainer/alignprop_trainer.py:326
↓ 1 callersMethod_generate_vllm
(self, model, prompts)
trl/trl/trainer/online_dpo_trainer.py:463
↓ 1 callersMethod_get_chosen_prob
Calculates the probability if the given prompt embedding is from desirable dataset. This function calculates the probability in the p
trl/trl/trainer/bco_trainer.py:745
↓ 1 callersMethod_get_eval_sampler
(self, eval_dataset)
trl/trl/trainer/grpo_trainer.py:1030
↓ 1 callersMethod_get_last_hidden_state
( self, unwrapped_model, input_ids, attention_mask, logits_to_keep,
trl/trl/trainer/grpo_trainer.py:1061
↓ 1 callersMethod_get_prompt_embeddings
Extract embeddings from frozen embedding model
trl/trl/trainer/bco_trainer.py:792
↓ 1 callersMethod_get_train_sampler
(self, dataset: Optional[Dataset] = None)
trl/trl/trainer/kto_trainer.py:1482
↓ 1 callersMethod_get_train_sampler
(self, dataset: Optional[Dataset] = None)
trl/trl/trainer/grpo_trainer.py:994
↓ 1 callersMethod_get_udm_weight
(self, rejected_embeddings: torch.FloatTensor)
trl/trl/trainer/bco_trainer.py:1104
↓ 1 callersFunction_get_variance
(self, timestep, prev_timestep)
trl/trl/models/modeling_sd_base.py:174
↓ 1 callersMethod_has_lm_head
(self)
trl/trl/models/modeling_value_head.py:300
↓ 1 callersMethod_init_weights
r""" Initializes the weights of the value head. The default initialization strategy is random. Users can pass a different initializati
trl/trl/models/modeling_value_head.py:108
↓ 1 callersMethod_init_weights
r""" We initialize the weights of the value head.
trl/trl/models/modeling_value_head.py:382
↓ 1 callersMethod_interp_schedule
Interpolate mu, sigma and ratio given training progress in [0,1].
blip3o/model/language_model/loss_adaptive.py:42
↓ 1 callersMethod_load_models
(self)
inference.py:40
↓ 1 callersMethod_load_models
(self)
trl/inference.py:26
↓ 1 callersMethod_log_statistics
( self, model_data, ref_data, model_logprobs_model_data, model_logprob
trl/trl/trainer/xpo_trainer.py:363
↓ 1 callersMethod_log_statistics
( self, model_data, mixture_data, model_logprobs_model_data, ref_logpr
trl/trl/trainer/nash_md_trainer.py:350
↓ 1 callersMethod_maybe_log_save_evaluate
(self)
trl/trl/trainer/iterative_sft_trainer.py:410
↓ 1 callersMethod_move_model_to_vllm
(self)
trl/trl/trainer/grpo_trainer.py:1215
↓ 1 callersMethod_norm
(self, x)
tok/ar_dtok/ar_model.py:86
↓ 1 callersMethod_prepare_model_for_kbit_training
Prepares a quantized model for kbit training.
trl/trl/trainer/sft_trainer.py:632
↓ 1 callersMethod_prepare_peft_model
Prepares a model for PEFT training.
trl/trl/trainer/dpo_trainer.py:543
↓ 1 callersMethod_prepare_peft_model
Prepares a model for PEFT training.
trl/trl/trainer/sft_trainer.py:591
↓ 1 callersMethod_process_completions
(self, model_output, ref_output, prompts)
trl/trl/trainer/xpo_trainer.py:211
↓ 1 callersMethod_process_completions
(self, model_output, mixture_output, prompts)
trl/trl/trainer/nash_md_trainer.py:226
↓ 1 callersMethod_save_checkpoint
(self, model, trial)
trl/trl/trainer/online_dpo_trainer.py:776
↓ 1 callersMethod_setup_optimizer
(self, trainable_layers_parameters)
trl/trl/trainer/ddpo_trainer.py:414
↓ 1 callersMethod_setup_optimizer
(self, trainable_layers_parameters)
trl/trl/trainer/alignprop_trainer.py:302
↓ 1 callersMethod_shift_right
(self, input_ids)
trl/trl/trainer/orpo_trainer.py:1006
↓ 1 callersMethod_shift_right
(self, input_ids)
trl/trl/trainer/cpo_trainer.py:1022
↓ 1 callersMethod_step_safety_checker
Check if the input data is valid for training. Args: input_ids (list[`torch.LongTensor`]): List of tenso
trl/trl/trainer/iterative_sft_trainer.py:229
↓ 1 callersMethod_train_batched_samples
Train on a batch of samples. Main training segment Args: inner_epoch (int): The current inner epoch epoch (i
trl/trl/trainer/ddpo_trainer.py:500
↓ 1 callersMethodadd_and_load_reward_modeling_adapter
r""" Add and load a reward modeling adapter. This method can only be used if the model is a `PeftModel` and if you have initialized th
trl/trl/models/modeling_base.py:437
↓ 1 callersFunctionadd_hooks
Adds the optimizer hooks from a DeepSpeed ZeRO-3 model.
trl/trl/models/utils.py:271
↓ 1 callersFunctionaesthetic_scorer
(hub_model_id, model_filename)
trl/examples/scripts/ddpo.py:137
↓ 1 callersFunctionaesthetic_scorer
(hub_model_id, model_filename)
trl/trl/models/auxiliary_modules.py:78
↓ 1 callersMethodavg_pool
(self, z, pool_scale=1)
tok/ta_tok.py:122
↓ 1 callersMethodbco_loss
Compute the BCO loss for a batch of policy and reference model log probabilities. Args: policy_chosen_logps: Log
trl/trl/trainer/bco_trainer.py:1113
↓ 1 callersFunctionbuild_dataset
Build dataset for training. This builds the dataset from `load_dataset`, one should customize this function to train the model on its own dat
trl/examples/research_projects/toxicity/scripts/gpt-j-6b-toxicity.py:99
↓ 1 callersFunctionbuild_dataset
Build dataset for training. This builds the dataset from `load_dataset`, one should customize this function to train the model on its own dat
trl/examples/research_projects/stack_llama/scripts/rl_training.py:120
↓ 1 callersMethodcalculate_loss
Calculate the loss for a batch of an unpacked sample Args: latents (torch.Tensor): The latents sampled f
trl/trl/trainer/ddpo_trainer.py:332
↓ 1 callersMethodcalculate_loss
Calculate the loss for a batch of an unpacked sample Args: rewards (torch.Tensor): Differentiable reward
trl/trl/trainer/alignprop_trainer.py:273
↓ 1 callersFunctionchars_token_ratio
Estimate the average number of characters per token in the dataset.
trl/examples/research_projects/stack_llama/scripts/supervised_finetuning.py:68
↓ 1 callersFunctionchars_token_ratio
Estimate the average number of characters per token in the dataset.
trl/examples/research_projects/stack_llama_2/scripts/sft_llama2.py:80
↓ 1 callersMethodcheck_server
Check server availability with retries on failure, within a total timeout duration. If the server is not up after the total timeout d
trl/trl/extras/vllm_client.py:132
↓ 1 callersFunctionchunk_list
Split list `lst` into `n` evenly distributed sublists. Example: ```python >>> chunk_list([1, 2, 3, 4, 5, 6], 2) [[1, 2, 3], [4,
trl/trl/scripts/vllm_serve.py:346
↓ 1 callersFunctioncommon_start
(str1: str, str2: str)
trl/examples/datasets/hh-rlhf-helpful-base.py:50
↓ 1 callersFunctioncompute_entropy_loss
(affinity, loss_type="softmax", temperature=0.01)
tok/ar_dtok/vqvae.py:432
↓ 1 callersMethodcompute_loss
( self, model: Union[PreTrainedModel, nn.Module], inputs: dict[str, Union[torch.Tensor
trl/trl/trainer/kto_trainer.py:1454
↓ 1 callersMethodcompute_loss
( self, model: Union[PreTrainedModel, nn.Module], inputs: dict[str, Union[torch.Tensor
trl/trl/trainer/reward_trainer.py:265
↓ 1 callersMethodcompute_loss
(self, model, inputs, return_outputs=False, num_items_in_batch=None)
trl/trl/trainer/grpo_trainer.py:1888
↓ 1 callersMethodcompute_reward
Compute the reward for a list of histories.
trl/trl/environment/base_environment.py:376
↓ 1 callersMethodcompute_rewards
(self, prompt_image_pairs, is_async=False)
trl/trl/trainer/ddpo_trainer.py:205
↓ 1 callersMethodcompute_rewards
(self, prompt_image_pairs)
trl/trl/trainer/alignprop_trainer.py:193
↓ 1 callersMethodconcatenated_forward
Run the given model on the given batch of inputs, concatenating the chosen and rejected inputs together. We do this to avoid doing two forwar
trl/trl/trainer/orpo_trainer.py:709
↓ 1 callersMethodconcatenated_forward
Run the given model on the given batch of inputs, concatenating the chosen and rejected inputs together. We do this to avoid doing two forwar
trl/trl/trainer/cpo_trainer.py:740
↓ 1 callersMethodconcatenated_inputs
Concatenate the chosen and rejected inputs into a single tensor. Args: batch: A batch of data. Must contain the k
trl/trl/trainer/orpo_trainer.py:567
↓ 1 callersMethodconcatenated_inputs
Concatenate the chosen and rejected inputs into a single tensor. Args: batch: A batch of data. Must contain the k
trl/trl/trainer/cpo_trainer.py:577
↓ 1 callersFunctionconvert_state_dict
r""" Simply iterates over the state dict and replaces the patterns in `mapping` with the corresponding values. Args: state_dict (`dic
trl/trl/models/sd_utils.py:72
↓ 1 callersMethodcpo_loss
Compute the CPO loss for a batch of policy and reference model log probabilities. Args: policy_chosen_logps: Log
trl/trl/trainer/cpo_trainer.py:644
↓ 1 callersFunctioncreate_datasets
(tokenizer, args)
trl/examples/research_projects/stack_llama/scripts/supervised_finetuning.py:105
↓ 1 callersFunctioncreate_datasets
(tokenizer, args, seed=None)
trl/examples/research_projects/stack_llama_2/scripts/sft_llama2.py:117
↓ 1 callersMethodcreate_merge_config_dare_ties
Creates a merge configuration for a DARE TIES merge of two models, with specified weights and densities.
trl/trl/mergekit_utils.py:168
← previousnext →201–300 of 947, ranked by callers