MCPcopy Create free account

hub / github.com/OmniMMI/OpenOmniNexus / functions

Functions668 in github.com/OmniMMI/OpenOmniNexus

↓ 118 callersMethodfrom_pretrained
r""" Instantiates a new model from a pretrained model from `transformers`. The pretrained model is loaded using the `from_pretrained`
trl/models/modeling_base.py:103
↓ 68 callersFunctionrank0_print
(*args)
open_omni/utils.py:64
↓ 41 callersMethodget_model
(self)
open_omni/model/llava_arch.py:223
↓ 34 callersMethodload
(cls, model_config)
open_omni/model/speech_encoder/speech_encoder.py:16
↓ 34 callersFunctiontokenizer_image_token
(prompt, tokenizer, image_token_index=IMAGE_TOKEN_INDEX, return_tensors=None)
open_omni/mm_utils.py:341
↓ 23 callersMethodupdate
Updates running moments from batch's moments computed across ranks
trl/trainer/utils.py:473
↓ 22 callersMethodappend_message
(self, role, message)
open_omni/conversation.py:184
↓ 20 callersMethodcopy
(self)
open_omni/conversation.py:272
↓ 20 callersFunctionis_peft_available
()
trl/import_utils.py:24
↓ 20 callersMethodsave_pretrained
r""" Save the pretrained model to a directory. This method is a wrapper around `transformers.PreTrainedModel.save_pretrained`. Please
trl/models/modeling_base.py:498
↓ 19 callersMethodembed_tokens
(self, x)
open_omni/model/language_model/llava_mpt.py:35
↓ 18 callersMethodstate_dict
r""" Return the state_dict of the pretrained model.
trl/models/modeling_base.py:527
↓ 17 callersFunctionmasked_mean
Compute mean of tensor with a masked values.
trl/core.py:147
↓ 15 callersMethod__init__
(self, model_args, vision_tower)
open_omni/model/multimodal_resampler/qformer.py:1103
↓ 14 callersMethodget_prompt
(self)
open_omni/conversation.py:47
↓ 14 callersMethodtokenizer
Returns the tokenizer used for tokenizing text inputs
trl/models/modeling_sd_base.py:98
↓ 13 callersMethodget_input_embeddings
(self)
open_omni/model/multimodal_resampler/qformer.py:637
↓ 13 callersMethodprepare_inputs_labels_for_multimodal
(self, input_ids, position_ids, attention_mask, past_key_values, labels, images, modalities=["image"], image_s
open_omni/model/llava_arch.py:305
↓ 10 callersMethodget_model
(self)
open_omni/model/language_model/llava_qwen.py:93
↓ 10 callersMethodlog
Log `logs` on the various objects watching training, including stored metrics. Args: logs (`Dict[str, float]`):
trl/trainer/dpo_trainer.py:1164
↓ 9 callersMethodget_vision_tower
(self)
open_omni/model/llava_arch.py:226
↓ 8 callersMethodget_vision_tower
(self)
open_omni/model/llava_arch.py:62
↓ 8 callersMethodprepare_inputs_labels_for_multimodal_av
(self, input_ids, position_ids, attention_mask, past_key_values, labels, images, modalities=["image"], image_s
open_omni/model/llava_arch.py:537
↓ 8 callersMethodwrite
(self, buf)
open_omni/utils.py:128
↓ 7 callersMethodpost_init
r""" Post initialization method. This method is called after the model is instantiated and loaded from a checkpoint. It can be used to
trl/models/modeling_base.py:533
↓ 7 callersMethodtrain
(self, *args, **kwargs)
trl/trainer/sft_trainer.py:295
↓ 7 callersMethodtranspose_for_scores
(self, x)
open_omni/model/multimodal_resampler/qformer.py:145
↓ 6 callersFunctionload_video
( video_path, video_decode_backend='decord', clip_start_sec=0.0, clip_end_sec=
open_omni/vid_utils.py:34
↓ 5 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/trainer/dpo_trainer.py:848
↓ 5 callersFunctionexpand2square
(pil_img, background_color)
open_omni/mm_utils.py:300
↓ 5 callersFunctionget_length_grouped_indices
Return a list of indices so that each slice of `batch_size` consecutive indices correspond to elements of similar lengths. To do this, the in
open_omni/train/llava_trainer.py:165
↓ 5 callersMethodget_output_embeddings
(self)
open_omni/model/multimodal_resampler/qformer.py:878
↓ 5 callersFunctionis_xpu_available
()
trl/import_utils.py:84
↓ 5 callersMethodload_model
(self, device_map=None)
open_omni/model/multimodal_encoder/clip_encoder.py:37
↓ 5 callersMethodpad_sequence
(self, input_ids, batch_first, padding_value)
open_omni/train/train.py:1567
↓ 4 callersMethoddevice
(self)
open_omni/model/multimodal_encoder/clip_encoder.py:92
↓ 4 callersFunctionexists
(val)
open_omni/model/multimodal_resampler/perceiver.py:16
↓ 4 callersFunctionflatten_dict
Flatten dictionary and concatenate nested keys with separator.
trl/core.py:72
↓ 4 callersMethodgenerate
Generate response with the model given the query tensor. call the `generate` method of the model. Args: query_te
trl/trainer/ppo_trainer.py:406
↓ 4 callersFunctionget_length_grouped_indices_auto_single
(lengths, batch_size, world_size, generator=None)
open_omni/train/llava_trainer.py:188
↓ 4 callersFunctionis_npu_available
Checks if `torch_npu` is installed and potentially if a NPU is in the environment
trl/import_utils.py:100
↓ 4 callersFunctionis_rich_available
()
trl/import_utils.py:76
↓ 4 callersFunctionpad_to_length
(tensor: torch.Tensor, length: int, pad_value: Union[int, float], dim: int = -1)
trl/trainer/utils.py:531
↓ 4 callersMethodto_dict
(self)
trl/trainer/ppo_config.py:171
↓ 3 callersMethod_get_current_device
r""" Get the current device. For GPU, we return the local process index using the `accelerate.PartialState` object to handle corner ca
trl/models/modeling_base.py:366
↓ 3 callersMethod_get_item
(self, i)
open_omni/train/train.py:1425
↓ 3 callersFunction_left_broadcast
As opposed to the default direction of broadcasting (right to left), this function broadcasts from left to right Args: in
trl/models/modeling_sd_base.py:156
↓ 3 callersMethod_save
(self, output_dir: Optional[str] = None, state_dict=None)
open_omni/train/llava_trainer.py:509
↓ 3 callersMethod_split_kwargs
Separate the kwargs from the arguments that we support inside `supported_args` and the ones that we don't.
trl/models/modeling_base.py:384
↓ 3 callersMethodappend_segment
Append a new segment to the history. args: text (`str`): The text of the new segment. tokens (`torch.LongTen
trl/environment/base_environment.py:88
↓ 3 callersMethodbatched_forward_pass
Calculate model outputs in multiple batches. Args: queries (`torch.LongTensor`): List of tensors contain
trl/trainer/ppo_trainer.py:899
↓ 3 callersFunctionbuild_logger
(logger_name, logger_filename)
open_omni/utils.py:72
↓ 3 callersFunctionbuild_speech_encoder
(config)
open_omni/model/speech_encoder/builder.py:4
↓ 3 callersMethodfeature_select
(self, image_forward_outs)
open_omni/model/multimodal_encoder/clip_encoder.py:48
↓ 3 callersMethodforward
( self, input_ids: torch.LongTensor = None, attention_mask: Optional[torch.Tensor] = N
open_omni/model/language_model/llava_qwen.py:96
↓ 3 callersMethodget_speech_encoder
(self)
open_omni/model/llava_arch.py:133
↓ 3 callersMethodget_worker_status
(self, worker_name: str)
local_demo/controller.py:88
↓ 3 callersMethodinitialize_vision_modules
(self, model_args, fsdp=None)
open_omni/model/llava_arch.py:68
↓ 3 callersMethodinitialize_vision_tokenizer
(self, model_args, tokenizer)
open_omni/model/llava_arch.py:797
↓ 3 callersFunctionis_diffusers_available
()
trl/import_utils.py:61
↓ 3 callersFunctionis_wandb_available
()
trl/import_utils.py:80
↓ 3 callersFunctionload_data
(data_path)
open_omni/train/train_dpo.py:900
↓ 3 callersFunctionload_pretrained_model
(model_path, model_base, model_name, load_8bit=False, load_4bit=False, device_map="auto", attn_implementation=
open_omni/model/builder.py:29
↓ 3 callersFunctionlogprobs_from_logits
See: https://github.com/pytorch/pytorch/issues/563#issuecomment-330103591
trl/core.py:126
↓ 3 callersFunctionmasked_var
Compute variance of tensor with masked values.
trl/core.py:155
↓ 3 callersFunctionmaybe_zero_3
(param, ignore_status=False, name=None)
open_omni/train/train.py:206
↓ 3 callersFunctionmaybe_zero_3
(param, ignore_status=False, name=None)
open_omni/train/train_dpo.py:171
↓ 3 callersMethodnull_ref_context
Context manager for handling null reference model (that is, peft adapter manipulation).
trl/trainer/dpo_trainer.py:629
↓ 3 callersMethodpredict
(self, tgt_reps)
open_omni/model/speech_generator/speech_generator.py:106
↓ 3 callersFunctionprocess_anyres_image
Process an image with variable resolutions. Args: image (PIL.Image.Image): The input image to be processed. processor: The i
open_omni/mm_utils.py:243
↓ 3 callersFunctionprocess_highres_image
(image, processor, grid_pinpoints)
open_omni/mm_utils.py:98
↓ 3 callersFunctionprocess_highres_image_crop_split
(image, data_args, processor=None)
open_omni/mm_utils.py:87
↓ 3 callersMethodunet
Returns the 2d U-Net model used for diffusion.
trl/models/modeling_sd_base.py:84
↓ 2 callersMethod__init__
(self, *, dim, dim_head=64, heads=8)
open_omni/model/multimodal_resampler/perceiver.py:31
↓ 2 callersMethod__init__
(self, config, **kwargs)
trl/models/modeling_value_head.py:26
↓ 2 callersMethod_generate_batched
( self, model: PreTrainedModelWrapper, query_tensors: List[torch.Tensor], leng
trl/trainer/ppo_trainer.py:478
↓ 2 callersMethod_get_checkpoint_from_hub
( cls, pretrained_model, pretrained_model_name_or_path, index_filename,
trl/models/modeling_base.py:317
↓ 2 callersMethod_get_item
(self, i)
open_omni/train/train_dpo.py:1081
↓ 2 callersMethod_get_train_sampler
(self)
open_omni/train/llava_trainer.py:313
↓ 2 callersMethod_prepare_dataset
( self, dataset, tokenizer, packing, dataset_text_field, max_s
trl/trainer/sft_trainer.py:326
↓ 2 callersMethod_remove_unused_columns
(self, dataset: "Dataset")
trl/trainer/ppo_trainer.py:386
↓ 2 callersFunction_tokenize_fn
Tokenize a list of strings.
open_omni/train/train.py:345
↓ 2 callersFunction_tokenize_fn
Tokenize a list of strings.
open_omni/train/train_dpo.py:309
↓ 2 callersFunctionauto_upgrade
(config)
open_omni/model/utils.py:4
↓ 2 callersMethodautocast
Returns the autocast context manager
trl/models/modeling_sd_base.py:119
↓ 2 callersFunctionbuild_speech_generator
(config)
open_omni/model/speech_generator/builder.py:6
↓ 2 callersFunctionbuild_speech_projector
(config)
open_omni/model/speech_projector/builder.py:4
↓ 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)):]`.
trl/trainer/dpo_trainer.py:455
↓ 2 callersFunctionbuild_vision_projector
(config, delay_load=False, **kwargs)
open_omni/model/multimodal_projector/builder.py:32
↓ 2 callersFunctionbuild_vision_resampler
(model_args, delay_load=False, **kwargs)
open_omni/model/multimodal_resampler/builder.py:21
↓ 2 callersFunctionbuild_vision_tower
(vision_tower_cfg, **kwargs)
open_omni/model/multimodal_encoder/builder.py:9
↓ 2 callersMethodcomplete
Mark the history as completed.
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 DPO specific dataset.
trl/trainer/dpo_trainer.py:638
↓ 2 callersMethodcompute_rewards
Compute per token rewards from scores and KL-penalty. Args: scores (`torch.FloatTensor`): Scores from th
trl/trainer/ppo_trainer.py:1031
↓ 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/extras/dataset_formatting.py:16
↓ 2 callersFunctioncreate_reference_model
Creates a static reference copy of a model. Note that model will be in `.eval()` mode. Args: model (`PreTrainedModelWrapper`): The m
trl/models/modeling_base.py:572
↓ 2 callersFunctiondisable_dropout_in_model
(model: torch.nn.Module)
trl/trainer/utils.py:549
↓ 2 callersMethodencode_multimodals
(self, videos_or_images, video_idx_in_batch, split_sizes=None)
open_omni/model/llava_arch.py:255
↓ 2 callersMethodencode_speech
(self, speech, speech_lengths)
open_omni/model/llava_arch.py:278
↓ 2 callersFunctionextract_patches
(image, patch_size, overlap_ratio)
open_omni/mm_utils.py:63
next →1–100 of 668, ranked by callers