MCPcopy Create free account

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

Functions947 in github.com/AMAP-ML/EMF

↓ 3 callersMethodlog
Log `logs` on the various objects watching training, including stored metrics. Args: logs (`dict[str, float]`):
trl/trl/trainer/dpo_trainer.py:1901
↓ 3 callersMethodnull_ref_context
Context manager for handling null reference model (that is, peft adapter manipulation).
trl/trl/trainer/kto_trainer.py:810
↓ 3 callersMethodnull_ref_context
Context manager for handling null reference model (that is, peft adapter manipulation).
trl/trl/trainer/bco_trainer.py:874
↓ 3 callersMethodpost_process
(self, x)
tok/mm_autoencoder.py:31
↓ 3 callersFunctionprint_rich_table
(df: pd.DataFrame)
trl/trl/trainer/utils.py:667
↓ 3 callersFunctionrandn_tensor
A helper function to create random tensors on the desired `device` with the desired `dtype`. When passing a list of generators, you can seed each
trl/trl/core.py:113
↓ 3 callersMethodremove
(self, val)
trl/trl/data_utils.py:465
↓ 3 callersFunctionscheduler_step
Predict the sample at the previous timestep by reversing the SDE. Core function to propagate the diffusion process from the learned model ou
trl/trl/models/modeling_sd_base.py:189
↓ 3 callersMethodsearch
(self, val)
trl/trl/data_utils.py:475
↓ 3 callersMethodset_progress_bar_config
Sets the progress bar config for the pipeline
trl/trl/models/modeling_sd_base.py:127
↓ 2 callersMethod__init__
(self, config, **kwargs)
trl/trl/models/modeling_value_head.py:27
↓ 2 callersMethod_create_model_from_path
Creates a model from a path or model identifier.
trl/trl/trainer/dpo_trainer.py:516
↓ 2 callersMethod_generate_and_score_completions
( self, inputs: list[dict[str, Union[torch.Tensor, Any]]] )
trl/trl/trainer/grpo_trainer.py:1400
↓ 2 callersMethod_get_checkpoint_from_hub
( cls, pretrained_model, pretrained_model_name_or_path, index_filename,
trl/trl/models/modeling_base.py:337
↓ 2 callersMethod_get_module
(self, module_name: str)
trl/trl/import_utils.py:142
↓ 2 callersMethod_get_sample_prompt_embeddings
Sample instances from dataset and get prompt embeddings. Used for density ratio classifier training.
trl/trl/trainer/bco_trainer.py:813
↓ 2 callersMethod_merge_and_maybe_push
(self, output_dir, global_step, model)
trl/trl/trainer/callbacks.py:553
↓ 2 callersMethod_prepare_gradient_checkpointing
Prepare the gradienting checkpointing for the model.
trl/trl/trainer/dpo_trainer.py:596
↓ 2 callersMethod_save_checkpoint
(self, model, trial)
trl/trl/trainer/rloo_trainer.py:645
↓ 2 callersMethod_save_checkpoint
(self, model, trial)
trl/trl/trainer/ppo_trainer.py:752
↓ 2 callersMethod_sync_fsdp1_params_to_vllm
Memory-efficient post-order traversal of FSDP modules to extract full parameters and sync with vLLM.
trl/trl/trainer/grpo_trainer.py:1174
↓ 2 callersMethod_sync_fsdp2_params_to_vllm
(self, module: nn.Module)
trl/trl/trainer/grpo_trainer.py:1201
↓ 2 callersMethod_sync_target_model
(model, target_model, alpha)
trl/trl/trainer/callbacks.py:107
↓ 2 callersMethod_vectorize_prompt
Replaces processing_class.pad_token_id to embedding_tokenizer.pad_token_id and applies self.embedding_func
trl/trl/trainer/bco_trainer.py:774
↓ 2 callersFunctionadd_bos_token_if_needed
( bos_token_id: Optional[int], prompt_len_input_ids: int, prompt_tokens: dict[str, list[int]],
trl/trl/trainer/utils.py:1130
↓ 2 callersFunctionadd_eos_token_if_needed
( eos_token_id: int, chosen_tokens: dict[str, list[int]], rejected_tokens: dict[str, list[int]] )
trl/trl/trainer/utils.py:1152
↓ 2 callersFunctionapply_chat_template
r""" Apply a chat template to a conversational example along with the schema for a list of functions in `tools`. For more details, see [`mayb
trl/trl/data_utils.py:72
↓ 2 callersMethodar_sample
(self, x, args)
tok/mm_autoencoder.py:20
↓ 2 callersFunctionbuild_sana
(vision_tower_cfg, **kwargs)
blip3o/model/multimodal_decoder/builder.py:9
↓ 2 callersMethodbuild_tokenized_answer
Llama tokenizer does satisfy `enc(a + b) = enc(a) + enc(b)`. It does ensure `enc(a + b) = enc(a) + enc(a + b)[len(enc(a)):]`. Referen
trl/trl/trainer/orpo_trainer.py:362
↓ 2 callersMethodbuild_tokenized_answer
Llama tokenizer does satisfy `enc(a + b) = enc(a) + enc(b)`. It does ensure `enc(a + b) = enc(a) + enc(a + b)[len(enc(a)):]`. Referen
trl/trl/trainer/cpo_trainer.py:382
↓ 2 callersFunctionbuild_vae
(vision_tower_cfg, **kwargs)
blip3o/model/multimodal_decoder/builder.py:15
↓ 2 callersFunctionbuild_vision_tower
(vision_tower_cfg, **kwargs)
blip3o/model/multimodal_encoder/builder.py:4
↓ 2 callersFunctioncap_exp
(value, cap=-1)
trl/trl/trainer/utils.py:661
↓ 2 callersMethodclip_embedding
(self, x)
tok/ar_dtok/ar_model.py:391
↓ 2 callersFunctionclone_chat_template
Clones a chat template from a source tokenizer to the target tokenizer and updates the model accordingly. This function: - Copies the ch
trl/trl/models/utils.py:147
↓ 2 callersMethodcomplete
Mark the history as completed.
trl/trl/environment/base_environment.py:116
↓ 2 callersMethodcompute_reference_log_probs
Computes log probabilities of the reference model for a single padded batch of a KTO specific dataset.
trl/trl/trainer/kto_trainer.py:922
↓ 2 callersMethodcompute_reference_log_probs
Computes log probabilities of the reference model for a single padded batch of a BCO specific dataset.
trl/trl/trainer/bco_trainer.py:967
↓ 2 callersMethodconcatenated_inputs
Concatenate the `chosen` and `rejected` inputs from the batch into a single tensor for both the prompt and completion sequences.
trl/trl/trainer/dpo_trainer.py:917
↓ 2 callersFunctionconversations_formatting_function
r""" return a callable function that takes in a "messages" dataset and returns a formatted dataset, based on the tokenizer apply chat template
trl/trl/extras/dataset_formatting.py:38
↓ 2 callersFunctionconvert_state_dict_to_diffusers
r""" Converts a state dict to new diffusers format. The state dict can be from previous diffusers format (`OLD_DIFFUSERS`), or PEFT format (`P
trl/trl/models/sd_utils.py:105
↓ 2 callersMethodcreate_model_card
Creates a draft of a model card using the information available to the `Trainer`. Args: model_name (`str` or `None`, *op
trl/trl/trainer/ddpo_trainer.py:611
↓ 2 callersMethodcreate_model_card
Creates a draft of a model card using the information available to the `Trainer`. Args: model_name (`str` or `None`, *op
trl/trl/trainer/alignprop_trainer.py:409
↓ 2 callersFunctiondecode_and_strip_padding
Decodes the input tensor and strips the padding tokens. Args: inputs (`torch.Tensor`): The input tensor to be decoded.
trl/trl/trainer/utils.py:1211
↓ 2 callersMethodencode_images
(self, images, modalities, pool_scale=None)
blip3o/model/blip3o_arch.py:169
↓ 2 callersFunctionfind_multiple
(n: int, k: int)
tok/ar_dtok/ar_model.py:15
↓ 2 callersFunctionflatten_dict
Flatten dictionary and concatenate nested keys with separator.
trl/trl/core.py:26
↓ 2 callersFunctionflush_right
Shift non-zero elements in the mask and corresponding tensors to the right. See `flush_left` for details.
trl/trl/trainer/utils.py:1399
↓ 2 callersMethodgenerate
Generate responses for a list of histories.
trl/trl/environment/base_environment.py:385
↓ 2 callersMethodgenerate_on_policy_outputs
(model, inputs, generation_config, pad_token_id=None)
trl/trl/trainer/gkd_trainer.py:255
↓ 2 callersMethodget_batch_logps
Compute the log probabilities of the given labels under the given logits. Args: logits: Logits of the model (unnormalized). Shape
trl/trl/trainer/bco_trainer.py:1011
↓ 2 callersMethodget_batch_loss_metrics
Compute the KTO loss and other metrics for the given batch of inputs for train or test.
trl/trl/trainer/kto_trainer.py:1342
↓ 2 callersMethodget_batch_loss_metrics
Compute the ORPO loss and other metrics for the given batch of inputs for train or test.
trl/trl/trainer/orpo_trainer.py:790
↓ 2 callersMethodget_batch_loss_metrics
Compute the BCO loss and other metrics for the given batch of inputs for train or test.
trl/trl/trainer/bco_trainer.py:1168
↓ 2 callersMethodget_batch_loss_metrics
Compute the DPO loss and other metrics for the given batch of inputs for train or test.
trl/trl/trainer/dpo_trainer.py:1645
↓ 2 callersMethodget_batch_loss_metrics
Compute the CPO loss and other metrics for the given batch of inputs for train or test.
trl/trl/trainer/cpo_trainer.py:815
↓ 2 callersMethodget_sana
(self)
blip3o/model/blip3o_arch.py:68
↓ 2 callersMethodget_sana_vae
(self)
blip3o/model/blip3o_arch.py:76
↓ 2 callersFunctionget_stack_exchange_paired
Load the stack-exchange-paired dataset from Hugging Face and convert it to the necessary format. The dataset is converted to a dictionary with th
trl/examples/research_projects/stack_llama_2/scripts/dpo_llama2.py:103
↓ 2 callersMethodget_trainable_layers
Returns the trainable parameters of the pipeline
trl/trl/models/modeling_sd_base.py:139
↓ 2 callersMethodget_vision_tower
(self)
blip3o/model/blip3o_arch.py:166
↓ 2 callersMethodinit_communicator
Initializes the weight update group in a distributed setup for model synchronization. Args: device (`torch.device`, `str
trl/trl/extras/vllm_client.py:247
↓ 2 callersFunctionis_fastapi_available
()
trl/trl/import_utils.py:51
↓ 2 callersMethodis_image_file
(self, filename)
blip3o/conversation.py:172
↓ 2 callersFunctionis_joblib_available
()
trl/trl/import_utils.py:91
↓ 2 callersFunctionis_pydantic_available
()
trl/trl/import_utils.py:67
↓ 2 callersFunctionis_requests_available
()
trl/trl/import_utils.py:71
↓ 2 callersFunctionis_uvicorn_available
()
trl/trl/import_utils.py:79
↓ 2 callersFunctionis_vllm_ascend_available
()
trl/trl/import_utils.py:87
↓ 2 callersMethodload_checkpoint
Light wrapper around accelerate's register_lad_state_pre_hook which is run before loading state
trl/trl/models/modeling_sd_base.py:151
↓ 2 callersFunctionmasked_whiten
Whiten values with masked values.
trl/trl/core.py:70
↓ 2 callersFunctionmaybe_unpair_preference_dataset
r""" Unpair a preference dataset if it is paired. Args: dataset (`Dataset` or `DatasetDict`): Preference dataset to unpai
trl/trl/data_utils.py:281
↓ 2 callersMethodon_step_end
(self, args, state, control, **kwargs)
trl/trl/trainer/callbacks.py:125
↓ 2 callersMethodon_train_begin
(self, args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs)
trl/trl/trainer/callbacks.py:286
↓ 2 callersMethodon_train_end
(self, args, state, control, model=None, **kwargs)
trl/trl/trainer/callbacks.py:570
↓ 2 callersMethodpad_sequence
(self, input_ids, batch_first, padding_value)
blip3o/data/dataset.py:360
↓ 2 callersFunctionprepare_dataset
pre-tokenize the dataset before training; only collate during training
trl/examples/scripts/rloo/rloo.py:105
↓ 2 callersFunctionprepare_dataset
pre-tokenize the dataset before training; only collate during training
trl/examples/scripts/rloo/rloo_tldr.py:103
↓ 2 callersFunctionprepare_dataset
pre-tokenize the dataset before training; only collate during training
trl/examples/scripts/ppo/ppo_tldr.py:136
↓ 2 callersFunctionprepare_dataset
pre-tokenize the dataset before training; only collate during training
trl/examples/scripts/ppo/ppo.py:133
↓ 2 callersFunctionprepare_fsdp
(model, accelerator)
trl/trl/models/utils.py:372
↓ 2 callersFunctionprint_env
()
trl/trl/scripts/env.py:41
↓ 2 callersMethodprocess_image
(self, image, image_process_mode, return_pil=False, image_format="PNG")
blip3o/conversation.py:111
↓ 2 callersFunctionprocess_vision_info
(messages: list[dict])
trl/examples/scripts/sft_vlm_gemma3.py:80
↓ 2 callersMethodproject_out
(self, z_cat)
tok/ar_dtok/bottleneck.py:48
↓ 2 callersMethodreset_prefix_cache
Resets the prefix cache for the model.
trl/trl/extras/vllm_client.py:328
↓ 2 callersFunctionsample
(logits, temperature: float=1.0, top_k: int=0, top_p: float=1.0, sample_logits=True)
tok/ar_dtok/generate.py:55
↓ 2 callersMethodsave_checkpoint
Light wrapper around accelerate's register_save_state_pre_hook which is run before saving state
trl/trl/models/modeling_sd_base.py:145
↓ 2 callersMethodsave_pretrained
Saves all of the model weights
trl/trl/models/modeling_sd_base.py:133
↓ 2 callersMethodset_eval_deterministic
(self, deterministic=True)
tok/ar_dtok/bottleneck.py:103
↓ 2 callersMethodshow_colour_legend
Print the colour legend.
trl/trl/environment/base_environment.py:192
↓ 2 callersFunctionsplit_to_even_chunks
Split a list of indices into `chunks` chunks of roughly equal lengths.
blip3o/train/blip3o_trainer.py:52
↓ 2 callersMethodstate_dict
r""" Returns the state dictionary of the model. We add the state dictionary of the value head to the state dictionary of the wrapped m
trl/trl/models/modeling_value_head.py:199
↓ 2 callersMethodstore_metrics
(self, metrics: dict[str, float], train_eval: Literal["train", "eval"] = "train")
trl/trl/trainer/kto_trainer.py:1478
↓ 2 callersMethodstore_metrics
(self, metrics: dict[str, float], train_eval: Literal["train", "eval"] = "train")
trl/trl/trainer/orpo_trainer.py:934
↓ 2 callersMethodstore_metrics
(self, metrics: dict[str, float], train_eval: Literal["train", "eval"] = "train")
trl/trl/trainer/bco_trainer.py:1286
↓ 2 callersMethodstore_metrics
(self, metrics: dict[str, float], train_eval: Literal["train", "eval"] = "train")
trl/trl/trainer/dpo_trainer.py:1841
↓ 2 callersMethodstore_metrics
(self, metrics: dict[str, float], train_eval: Literal["train", "eval"] = "train")
trl/trl/trainer/cpo_trainer.py:950
↓ 2 callersMethodtask_end_check
Check if the current generation sequence has finished.
trl/trl/environment/base_environment.py:411
← previousnext →101–200 of 947, ranked by callers