MCPcopy Index your code

hub / github.com/2U1/Llama3.2-Vision-Finetune / functions

Functions51 in github.com/2U1/Llama3.2-Vision-Finetune

↓ 5 callersFunctionpad_sequence
Pad a list of sequences to the same length. sequences: list of tensors in [seq_len, *] shape
src/train/data.py:84
↓ 4 callersFunctionget_peft_state_non_lora_maybe_zero_3
(named_params, require_grad_only=True)
src/train/train_utils.py:46
↓ 3 callersFunctionset_requires_grad
(parameters, requires_grad)
src/train/train_sft.py:37
↓ 3 callersFunctionset_requires_grad
(parameters, requires_grad)
src/train/train_dpo.py:37
↓ 2 callersFunction_pad_nm
(tensors, fill, is_bool=False)
src/train/data.py:44
↓ 2 callersFunctionencode_video
(video_path, max_num_frames=10)
src/train/data.py:69
↓ 2 callersFunctionget_peft_state_maybe_zero_3
(named_params, bias)
src/train/train_utils.py:21
↓ 2 callersFunctionmaybe_zero_3
(param, ignore_status=False, name=None)
src/train/train_utils.py:7
↓ 2 callersFunctionpad_cross_attention_mask
(cross_attention_masks)
src/train/data.py:103
↓ 2 callersFunctionpad_visual_batch
( batch_pixel_values, batch_aspect_ratio_ids, batch_aspect_ratio_mask, max_num_images=None,
src/train/data.py:16
↓ 2 callersFunctionrank0_print
(*args)
src/train/train_sft.py:16
↓ 2 callersFunctionrank0_print
(*args)
src/train/train_dpo.py:16
↓ 2 callersFunctionreplace_image_tokens
(input_string, start_count=0)
src/train/data.py:524
↓ 2 callersFunctionsafe_save_model_for_hf_trainer
Collects the state dict and dump to disk.
src/train/train_utils.py:53
↓ 2 callersFunctionvideo_to_image_tokens
(input_string, num_frames)
src/train/data.py:537
↓ 1 callersMethod__init__
( self, data_path: str | list, processor: transformers.ProcessorMixin, data_ar
src/train/data.py:327
↓ 1 callersMethodconcatenated_inputs
( batch: dict[str, Union[list, torch.LongTensor]], padding_value: int )
src/train/dpo_trainer.py:56
↓ 1 callersFunctionconfigure_llm
(model, training_args)
src/train/train_sft.py:54
↓ 1 callersFunctionconfigure_llm
(model, training_args)
src/train/train_dpo.py:54
↓ 1 callersFunctionconfigure_vision_tower
(model, training_args, compute_dtype, device)
src/train/train_sft.py:41
↓ 1 callersFunctionconfigure_vision_tower
(model, training_args, compute_dtype, device)
src/train/train_dpo.py:41
↓ 1 callersFunctionfind_target_linear_names
(model, num_lora_modules=-1, lora_namespan_exclude=[], verbose=True)
src/train/train_sft.py:20
↓ 1 callersFunctionfind_target_linear_names
(model, num_lora_modules=-1, lora_namespan_exclude=[], verbose=True)
src/train/train_dpo.py:20
↓ 1 callersFunctionget_model_name_from_path
(model_path)
src/utils.py:77
↓ 1 callersFunctionllava_to_openai
(conversations, is_video=False, num_frames=None)
src/train/data.py:542
↓ 1 callersFunctionload_pretrained_model
(model_path, model_base, model_name, load_8bit=False, load_4bit=False, device_map="
src/utils.py:16
↓ 1 callersFunctionmake_dpo_data_module
Make dataset and collator for DPO fine-tuning.
src/train/data.py:577
↓ 1 callersFunctionmake_supervised_data_module
Make dataset and collator for supervised fine-tuning.
src/train/data.py:566
↓ 1 callersFunctionmerge_lora
(args)
src/merge_lora_weights.py:3
↓ 1 callersFunctiontrain
()
src/train/train_sft.py:58
↓ 1 callersFunctiontrain
()
src/train/train_dpo.py:58
↓ 1 callersFunctionuniform_sample
(l, n)
src/train/data.py:70
Method__call__
(self, examples)
src/train/data.py:270
Method__call__
(self, examples)
src/train/data.py:460
Method__getitem__
(self, i)
src/train/data.py:146
Method__getitem__
(self, i)
src/train/data.py:349
Method__init__
(self, *args, **kwargs)
src/train/dpo_trainer.py:43
Method__init__
( self, data_path: str | list, processor: transformers.ProcessorMixin, data_ar
src/train/data.py:124
Method__init__
(self, pad_token_id: int, processor: transformers.ProcessorMixin)
src/train/data.py:266
Method__init__
(self, pad_token_id: int, processor: transformers.ProcessorMixin)
src/train/data.py:456
Method__init__
(self, *args, **kwargs)
src/train/trainer.py:39
Method__len__
(self)
src/train/data.py:143
Method__len__
(self)
src/train/data.py:346
Method_prepare_dataset
( self, dataset, processing_class, args, dataset_name )
src/train/dpo_trainer.py:46
Method_save_checkpoint
(self, model, trial)
src/train/dpo_trainer.py:178
Method_save_checkpoint
(self, model, trial)
src/train/trainer.py:120
Methodconcatenated_forward
(self, model: nn.Module, batch: dict[str, Union[list, torch.LongTensor]])
src/train/dpo_trainer.py:87
Methodcreate_optimizer
Setup the optimizer. We provide a reasonable default that works well. If you want to use something else, you can pass a tuple in the
src/train/trainer.py:42
Functiondisable_torch_init
Disable the redundant torch default initialization to accelerate model creation.
src/utils.py:8
Functionmaybe_zero_3
(param, ignore_status=False, name=None)
src/train/dpo_trainer.py:27
Functionmaybe_zero_3
(param, ignore_status=False, name=None)
src/train/trainer.py:23