SYMBOL INDEX (4565 symbols across 509 files) FILE: llava-train_videochat/llava/conversation.py class SeparatorStyle (line 11) | class SeparatorStyle(Enum): class Conversation (line 26) | class Conversation: method get_prompt (line 47) | def get_prompt(self): method append_message (line 178) | def append_message(self, role, message): method process_image (line 181) | def process_image(self, image, image_process_mode, return_pil=False, i... method get_images (line 227) | def get_images(self, return_pil=False, return_path=False): method is_image_file (line 242) | def is_image_file(self, filename): method is_video_file (line 246) | def is_video_file(self, filename): method to_gradio_chatbot (line 250) | def to_gradio_chatbot(self): method copy (line 288) | def copy(self): method dict (line 291) | def dict(self): FILE: llava-train_videochat/llava/dist_utils.py function get_rank (line 16) | def get_rank() -> int: function get_world_size (line 23) | def get_world_size() -> int: function setup_for_distributed (line 30) | def setup_for_distributed(is_master): function init_distributed_mode (line 44) | def init_distributed_mode(use_dynamic_port: bool = True): FILE: llava-train_videochat/llava/mm_utils.py function resize_and_center_crop (line 12) | def resize_and_center_crop(image, shortest_edge_length): function auto_pad_images (line 33) | def auto_pad_images(image, grid_params): function extract_patches (line 63) | def extract_patches(image, patch_size, overlap_ratio): function process_highres_image_crop_split (line 87) | def process_highres_image_crop_split(image, data_args, processor=None): function process_highres_image (line 98) | def process_highres_image(image, processor, grid_pinpoints): function select_best_resolution (line 119) | def select_best_resolution(original_size, possible_resolutions, max_reso... function resize_and_pad_image (line 157) | def resize_and_pad_image(image, target_resolution): function divide_to_patches (line 196) | def divide_to_patches(image, patch_size): function get_anyres_image_grid_shape (line 218) | def get_anyres_image_grid_shape(image_size, grid_pinpoints, patch_size, ... function process_anyres_image (line 251) | def process_anyres_image(image, processor, grid_pinpoints): function process_anyres_image_nopad (line 306) | def process_anyres_image_nopad(image, processor, grid_pinpoints): function process_anyres_video_nopad (line 365) | def process_anyres_video_nopad(video, processor, grid_pinpoints, max_res... function load_image_from_base64 (line 410) | def load_image_from_base64(image): function expand2square (line 414) | def expand2square(pil_img, background_color): function process_images (line 428) | def process_images(images, image_processor, model_cfg): function tokenizer_image_token (line 460) | def tokenizer_image_token(prompt, tokenizer, image_token_index=IMAGE_TOK... function get_model_name_from_path (line 482) | def get_model_name_from_path(model_path): class KeywordsStoppingCriteria (line 491) | class KeywordsStoppingCriteria(StoppingCriteria): method __init__ (line 492) | def __init__(self, keywords, tokenizer, input_ids): method __call__ (line 503) | def __call__(self, output_ids: torch.LongTensor, scores: torch.FloatTe... FILE: llava-train_videochat/llava/model/apply_delta.py function apply_delta (line 14) | def apply_delta(base_model_path, target_model_path, delta_path): FILE: llava-train_videochat/llava/model/builder.py function load_pretrained_model (line 27) | def load_pretrained_model(model_path, model_base, model_name, load_8bit=... FILE: llava-train_videochat/llava/model/consolidate.py function consolidate_ckpt (line 14) | def consolidate_ckpt(src_path, dst_path): FILE: llava-train_videochat/llava/model/language_model/llava_qwen.py class LlavaQwenConfig (line 35) | class LlavaQwenConfig(Qwen2Config): class LlavaQwenModel (line 39) | class LlavaQwenModel(LlavaMetaModel, Qwen2Model): method __init__ (line 42) | def __init__(self, config: Qwen2Config): class LlavaQwenForCausalLM (line 46) | class LlavaQwenForCausalLM(Qwen2ForCausalLM, LlavaMetaForCausalLM): method __init__ (line 49) | def __init__(self, config): method get_model (line 60) | def get_model(self): method forward (line 63) | def forward( method generate (line 119) | def generate( method prepare_inputs_for_generation (line 139) | def prepare_inputs_for_generation(self, input_ids, past_key_values=Non... FILE: llava-train_videochat/llava/model/language_model/llava_qwen_flash.py class LlavaQwenConfig_Flash (line 35) | class LlavaQwenConfig_Flash(Qwen2Config): class LlavaQwenModel_Flash (line 39) | class LlavaQwenModel_Flash(LlavaMetaModel, Qwen2Model_Flash): method __init__ (line 42) | def __init__(self, config: Qwen2Config): class LlavaQwenForCausalLM_Flash (line 46) | class LlavaQwenForCausalLM_Flash(Qwen2ForCausalLM_Flash, LlavaMetaForCau... method __init__ (line 49) | def __init__(self, config): method get_model (line 60) | def get_model(self): method forward (line 63) | def forward( method generate (line 120) | def generate( method prepare_inputs_for_generation (line 143) | def prepare_inputs_for_generation(self, input_ids, past_key_values=Non... FILE: llava-train_videochat/llava/model/language_model/modeling_qwen2_flash.py function _get_unpad_data (line 70) | def _get_unpad_data(attention_mask): class Qwen2RMSNorm (line 83) | class Qwen2RMSNorm(nn.Module): method __init__ (line 84) | def __init__(self, hidden_size, eps=1e-6): method forward (line 92) | def forward(self, hidden_states): class Qwen2RotaryEmbedding (line 101) | class Qwen2RotaryEmbedding(nn.Module): method __init__ (line 102) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method _set_cos_sin_cache (line 116) | def _set_cos_sin_cache(self, seq_len, device, dtype): method forward (line 126) | def forward(self, x, seq_len=None): function rotate_half (line 138) | def rotate_half(x): function apply_rotary_pos_emb (line 146) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids, unsqueeze_dim=1): class Qwen2MLP (line 175) | class Qwen2MLP(nn.Module): method __init__ (line 176) | def __init__(self, config): method forward (line 186) | def forward(self, x): function repeat_kv (line 191) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class Qwen2Attention (line 203) | class Qwen2Attention(nn.Module): method __init__ (line 209) | def __init__(self, config: Qwen2Config, layer_idx: Optional[int] = None): method forward (line 246) | def forward( class Qwen2FlashAttention2 (line 328) | class Qwen2FlashAttention2(Qwen2Attention): method __init__ (line 338) | def __init__(self, *args, **kwargs): method forward (line 346) | def forward( method _flash_attention_forward (line 482) | def _flash_attention_forward( method _upad_input (line 587) | def _upad_input(self, query_layer, key_layer, value_layer, attention_m... class Qwen2SdpaAttention (line 631) | class Qwen2SdpaAttention(Qwen2Attention): method forward (line 639) | def forward( class Qwen2DecoderLayer (line 725) | class Qwen2DecoderLayer(nn.Module): method __init__ (line 726) | def __init__(self, config: Qwen2Config, layer_idx: int): method forward (line 741) | def forward( class Qwen2PreTrainedModel (line 823) | class Qwen2PreTrainedModel(PreTrainedModel): method _init_weights (line 833) | def _init_weights(self, module): class Qwen2Model_Flash (line 919) | class Qwen2Model_Flash(Qwen2PreTrainedModel): method __init__ (line 927) | def __init__(self, config: Qwen2Config): method get_input_embeddings (line 944) | def get_input_embeddings(self): method set_input_embeddings (line 947) | def set_input_embeddings(self, value): method forward (line 951) | def forward( method flash_rank_drop (line 1159) | def flash_rank_drop( class Qwen2ForCausalLM_Flash (line 1382) | class Qwen2ForCausalLM_Flash(Qwen2PreTrainedModel): method __init__ (line 1385) | def __init__(self, config): method get_input_embeddings (line 1394) | def get_input_embeddings(self): method set_input_embeddings (line 1397) | def set_input_embeddings(self, value): method get_output_embeddings (line 1400) | def get_output_embeddings(self): method set_output_embeddings (line 1403) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 1406) | def set_decoder(self, decoder): method get_decoder (line 1409) | def get_decoder(self): method forward (line 1414) | def forward( method prepare_inputs_for_generation (line 1502) | def prepare_inputs_for_generation( method _reorder_cache (line 1560) | def _reorder_cache(past_key_values, beam_idx): FILE: llava-train_videochat/llava/model/llava_arch.py class LlavaMetaModel (line 35) | class LlavaMetaModel: method __init__ (line 37) | def __init__(self, config): method get_vision_tower (line 50) | def get_vision_tower(self): method initialize_vision_modules (line 56) | def initialize_vision_modules(self, model_args, fsdp=None): function unpad_image (line 116) | def unpad_image(tensor, original_size, is_frame=False): class LlavaMetaForCausalLM (line 160) | class LlavaMetaForCausalLM(ABC): method get_model (line 163) | def get_model(self): method get_vision_tower (line 166) | def get_vision_tower(self): method get_4dPool (line 169) | def get_4dPool(self, image_feature): method get_2dPool (line 194) | def get_2dPool(self, image_feature): method encode_image (line 220) | def encode_image(self, images_list): method encode_image_video (line 230) | def encode_image_video(self, images_list, video_idx_in_batch): method encode_video (line 255) | def encode_video(self, images_list, video_idx_in_batch): method encode_video_image (line 309) | def encode_video_image(self, images_list, video_idx_in_batch): method add_token_per_frame (line 364) | def add_token_per_frame(self, image_feature): method add_different_token_per_frame (line 373) | def add_different_token_per_frame(self, image_feature): method prepare_inputs_labels_for_multimodal (line 377) | def prepare_inputs_labels_for_multimodal(self, input_ids, position_ids... method initialize_vision_tokenizer (line 801) | def initialize_vision_tokenizer(self, model_args, tokenizer): FILE: llava-train_videochat/llava/model/make_delta.py function make_delta (line 14) | def make_delta(base_model_path, target_model_path, delta_path, hub_repo_... FILE: llava-train_videochat/llava/model/multimodal_encoder/builder.py function build_vision_tower (line 11) | def build_vision_tower(vision_tower_cfg, **kwargs): FILE: llava-train_videochat/llava/model/multimodal_encoder/clip_encoder.py class CLIPVisionTower (line 12) | class CLIPVisionTower(nn.Module): method __init__ (line 13) | def __init__(self, vision_tower, args, delay_load=False): method load_model (line 35) | def load_model(self, device_map=None): method feature_select (line 46) | def feature_select(self, image_forward_outs): method forward (line 68) | def forward(self, images): method dummy_feature (line 82) | def dummy_feature(self): method dtype (line 86) | def dtype(self): method device (line 90) | def device(self): method config (line 94) | def config(self): method hidden_size (line 101) | def hidden_size(self): method num_patches_per_side (line 110) | def num_patches_per_side(self): method num_patches (line 114) | def num_patches(self): method image_size (line 121) | def image_size(self): class CLIPVisionTowerS2 (line 125) | class CLIPVisionTowerS2(CLIPVisionTower): method __init__ (line 126) | def __init__(self, vision_tower, args, delay_load=False): method load_model (line 141) | def load_model(self, device_map=None): method forward_feature (line 155) | def forward_feature(self, images): method forward (line 160) | def forward(self, images): method hidden_size (line 172) | def hidden_size(self): FILE: llava-train_videochat/llava/model/multimodal_encoder/internvideo2/flash_attention_class.py class FlashAttention (line 10) | class FlashAttention(nn.Module): method __init__ (line 21) | def __init__(self, softmax_scale=None, attention_dropout=0.0, device=N... method forward (line 26) | def forward(self, qkv, key_padding_mask=None, causal=False, cu_seqlens... FILE: llava-train_videochat/llava/model/multimodal_encoder/internvideo2/pos_embed.py function get_3d_sincos_pos_embed (line 12) | def get_3d_sincos_pos_embed(embed_dim, grid_size, t_size, cls_token=False): function get_2d_sincos_pos_embed (line 66) | def get_2d_sincos_pos_embed(embed_dim, grid_size, cls_token=False): function get_1d_sincos_pos_embed (line 86) | def get_1d_sincos_pos_embed(embed_dim, t_size, cls_token=False): function get_2d_sincos_pos_embed_from_grid (line 101) | def get_2d_sincos_pos_embed_from_grid(embed_dim, grid): function get_1d_sincos_pos_embed_from_grid (line 116) | def get_1d_sincos_pos_embed_from_grid(embed_dim, pos): function interpolate_pos_embed_internvideo2 (line 137) | def interpolate_pos_embed_internvideo2(checkpoint_model, model, orig_t_s... function interpolate_pos_embed_internvideo2_new (line 227) | def interpolate_pos_embed_internvideo2_new(checkpoint_model, model, orig... FILE: llava-train_videochat/llava/model/multimodal_encoder/internvideo2/vit_scale_clean.py class CrossAttention (line 20) | class CrossAttention(nn.Module): method __init__ (line 21) | def __init__( method forward (line 52) | def forward(self, x, k=None, v=None): class AttentiveBlock (line 85) | class AttentiveBlock(nn.Module): method __init__ (line 87) | def __init__(self, dim, num_heads, qkv_bias=False, qk_scale=None, drop... method forward (line 100) | def forward(self, x_q, x_kv, pos_q, pos_k, bool_masked_pos, rel_pos_bi... class AttentionPoolingBlock (line 109) | class AttentionPoolingBlock(AttentiveBlock): method forward (line 111) | def forward(self, x): class RMSNorm (line 119) | class RMSNorm(nn.Module): method __init__ (line 120) | def __init__(self, hidden_size, eps=1e-6): method forward (line 125) | def forward(self, hidden_states): class LayerScale (line 133) | class LayerScale(nn.Module): method __init__ (line 134) | def __init__(self, dim, init_values=1e-5, inplace=False, force_fp32=Fa... method forward (line 141) | def forward(self, x): class Attention (line 151) | class Attention(nn.Module): method __init__ (line 152) | def __init__(self, dim, num_heads=8, qkv_bias=False, attn_drop=0., pro... method _naive_attn (line 175) | def _naive_attn(self, x): method _flash_attn (line 197) | def _flash_attn(self, x, key_padding_mask=None, need_weights=False): method forward (line 219) | def forward(self, x): class Mlp (line 224) | class Mlp(nn.Module): method __init__ (line 228) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 242) | def forward(self, x): class Block (line 251) | class Block(nn.Module): method __init__ (line 253) | def __init__( method forward (line 284) | def forward(self, x, residual=None): class PatchEmbed (line 306) | class PatchEmbed(nn.Module): method __init__ (line 310) | def __init__( method forward (line 334) | def forward(self, x): class PretrainVisionTransformer_clean (line 343) | class PretrainVisionTransformer_clean(nn.Module): method __init__ (line 344) | def __init__( method init_pos_embed (line 453) | def init_pos_embed(self): method _init_weights (line 476) | def _init_weights(self, m): method fix_init_weight (line 485) | def fix_init_weight(self): method dtype (line 494) | def dtype(self): method get_num_layers (line 497) | def get_num_layers(self): method no_weight_decay (line 501) | def no_weight_decay(self): method forward (line 512) | def forward(self, x, mask=None, use_image=False): function pretrain_internvideo2_giant_patch14_224_clean (line 572) | def pretrain_internvideo2_giant_patch14_224_clean(config): function pretrain_internvideo2_6b_patch14_224_clean (line 608) | def pretrain_internvideo2_6b_patch14_224_clean(config): FILE: llava-train_videochat/llava/model/multimodal_encoder/internvideo2_encoder.py class InternVideo2ImageProcessor (line 30) | class InternVideo2ImageProcessor: method __init__ (line 31) | def __init__(self, image_mean=(0.485, 0.456, 0.406), image_std=(0.229,... method preprocess (line 43) | def preprocess(self, images, return_tensors, target_size=None): class InternVideo2VisionConfig (line 69) | class InternVideo2VisionConfig: method __init__ (line 72) | def __init__( function build_vit (line 101) | def build_vit(config, pt_type='origin'): class InternVideo2VisionTower (line 145) | class InternVideo2VisionTower(nn.Module): method __init__ (line 146) | def __init__(self, vision_tower, vision_tower_cfg, delay_load=False, p... method load_model (line 172) | def load_model(self, device_map=None): method forward (line 182) | def forward(self, images): method dummy_feature (line 195) | def dummy_feature(self): method dtype (line 199) | def dtype(self): method device (line 204) | def device(self): method hidden_size (line 209) | def hidden_size(self): method num_patches (line 213) | def num_patches(self): method num_patches_per_side (line 217) | def num_patches_per_side(self): method image_size (line 222) | def image_size(self): FILE: llava-train_videochat/llava/model/multimodal_encoder/siglip_encoder.py class SigLipImageProcessor (line 34) | class SigLipImageProcessor: method __init__ (line 35) | def __init__(self, image_mean=(0.5, 0.5, 0.5), image_std=(0.5, 0.5, 0.... method preprocess (line 47) | def preprocess(self, images, return_tensors): class SigLipVisionConfig (line 70) | class SigLipVisionConfig(PretrainedConfig): method __init__ (line 73) | def __init__( method from_pretrained (line 103) | def from_pretrained(cls, pretrained_model_name_or_path: Union[str, os.... class SigLipVisionModelOutput (line 120) | class SigLipVisionModelOutput(ModelOutput): class SigLipVisionEmbeddings (line 148) | class SigLipVisionEmbeddings(nn.Module): method __init__ (line 149) | def __init__(self, config: SigLipVisionConfig): method forward (line 169) | def forward(self, pixel_values: torch.FloatTensor) -> torch.Tensor: class SigLipAttention (line 177) | class SigLipAttention(nn.Module): method __init__ (line 181) | def __init__(self, config): method forward (line 197) | def forward( class SigLipMLP (line 243) | class SigLipMLP(nn.Module): method __init__ (line 244) | def __init__(self, config): method forward (line 251) | def forward(self, hidden_states: torch.Tensor) -> torch.Tensor: class SigLipEncoderLayer (line 259) | class SigLipEncoderLayer(nn.Module): method __init__ (line 260) | def __init__(self, config: SigLipVisionConfig): method forward (line 269) | def forward( class SigLipPreTrainedModel (line 308) | class SigLipPreTrainedModel(PreTrainedModel): method _init_weights (line 318) | def _init_weights(self, module): class SigLipEncoder (line 324) | class SigLipEncoder(nn.Module): method __init__ (line 333) | def __init__(self, config: SigLipVisionConfig): method forward (line 340) | def forward( class SigLipVisionTransformer (line 408) | class SigLipVisionTransformer(nn.Module): method __init__ (line 409) | def __init__(self, config: SigLipVisionConfig): method forward (line 419) | def forward( class SigLipMultiheadAttentionPoolingHead (line 459) | class SigLipMultiheadAttentionPoolingHead(nn.Module): method __init__ (line 462) | def __init__(self, config: SigLipVisionConfig): method forward (line 470) | def forward(self, hidden_state): class SigLipVisionModel (line 483) | class SigLipVisionModel(SigLipPreTrainedModel): method __init__ (line 488) | def __init__(self, config: SigLipVisionConfig): method get_input_embeddings (line 496) | def get_input_embeddings(self) -> nn.Module: method forward (line 499) | def forward( class SigLipVisionTower (line 538) | class SigLipVisionTower(nn.Module): method __init__ (line 539) | def __init__(self, vision_tower, vision_tower_cfg, delay_load=False): method load_model (line 563) | def load_model(self, device_map=None): method forward (line 576) | def forward(self, images): method dummy_feature (line 592) | def dummy_feature(self): method dtype (line 596) | def dtype(self): method device (line 601) | def device(self): method hidden_size (line 606) | def hidden_size(self): method num_patches (line 610) | def num_patches(self): method num_patches_per_side (line 614) | def num_patches_per_side(self): method image_size (line 619) | def image_size(self): FILE: llava-train_videochat/llava/model/multimodal_encoder/umt/vit.py class DropPath (line 19) | class DropPath(nn.Module): method __init__ (line 22) | def __init__(self, drop_prob=None): method forward (line 26) | def forward(self, x): method extra_repr (line 29) | def extra_repr(self) -> str: class Mlp (line 33) | class Mlp(nn.Module): method __init__ (line 34) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 43) | def forward(self, x): class Attention (line 51) | class Attention(nn.Module): method __init__ (line 52) | def __init__( method forward (line 85) | def forward(self, x): class Block (line 117) | class Block(nn.Module): method __init__ (line 118) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 138) | def forward(self, x): class PatchEmbed (line 148) | class PatchEmbed(nn.Module): method __init__ (line 151) | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=... method forward (line 167) | def forward(self, x, **kwargs): function get_sinusoid_encoding_table (line 177) | def get_sinusoid_encoding_table(n_position, d_hid, ckpt_num_frame=-1, cu... function get_sinusoid_encoding_table2 (line 211) | def get_sinusoid_encoding_table2(n_position=784, d_hid=1024, cur_frame=8... class PretrainVisionTransformerEncoder (line 258) | class PretrainVisionTransformerEncoder(nn.Module): method __init__ (line 261) | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=... method no_weight_decay (line 312) | def no_weight_decay(self): method forward_features (line 315) | def forward_features(self, x, use_image=False): method forward (line 336) | def forward(self, x, use_image=False): class PretrainVisionTransformer (line 341) | class PretrainVisionTransformer(nn.Module): method __init__ (line 344) | def __init__(self, method _init_weights (line 400) | def _init_weights(self, m): method no_weight_decay (line 410) | def no_weight_decay(self): method forward (line 413) | def forward(self, x, use_image=False): FILE: llava-train_videochat/llava/model/multimodal_encoder/umt_encoder.py class UMTImageProcessor (line 30) | class UMTImageProcessor: method __init__ (line 31) | def __init__(self, image_mean=(0.485, 0.456, 0.406), image_std=(0.229,... method preprocess (line 43) | def preprocess(self, images, return_tensors, target_size=None): class UMTVisionConfig (line 69) | class UMTVisionConfig: method __init__ (line 72) | def __init__( function build_vit (line 95) | def build_vit(config, pt_type='origin'): class UMTVisionTower (line 134) | class UMTVisionTower(nn.Module): method __init__ (line 135) | def __init__(self, vision_tower, vision_tower_cfg, delay_load=False, p... method load_model (line 160) | def load_model(self, device_map=None): method forward (line 170) | def forward(self, images): method dummy_feature (line 185) | def dummy_feature(self): method dtype (line 189) | def dtype(self): method device (line 194) | def device(self): method hidden_size (line 199) | def hidden_size(self): method num_patches (line 203) | def num_patches(self): method num_patches_per_side (line 207) | def num_patches_per_side(self): method image_size (line 212) | def image_size(self): FILE: llava-train_videochat/llava/model/multimodal_projector/builder.py class IdentityMap (line 7) | class IdentityMap(nn.Module): method __init__ (line 8) | def __init__(self): method forward (line 11) | def forward(self, x, *args, **kwargs): method config (line 15) | def config(self): class SimpleResBlock (line 19) | class SimpleResBlock(nn.Module): method __init__ (line 20) | def __init__(self, channels): method forward (line 25) | def forward(self, x): function build_vision_projector (line 30) | def build_vision_projector(config, delay_load=False, **kwargs): FILE: llava-train_videochat/llava/model/multimodal_projector/tome16_mlp_hd64.py function bipartite_soft_matching (line 16) | def bipartite_soft_matching( function merge_wavg (line 72) | def merge_wavg( class ToMe16_mlp_hd64 (line 91) | class ToMe16_mlp_hd64(nn.Module): method __init__ (line 92) | def __init__(self, config, vision_cfg): method merge_tokens (line 107) | def merge_tokens(self, x, target_num_token): method forward (line 143) | def forward(self, x, compress=False, local_num_frames=-1): method config (line 169) | def config(self): FILE: llava-train_videochat/llava/model/utils.py function auto_upgrade (line 4) | def auto_upgrade(config): FILE: llava-train_videochat/llava/serialize_utils.py function get_world_size (line 25) | def get_world_size() -> int: function get_rank (line 33) | def get_rank() -> int: function get_rank (line 40) | def get_rank() -> int: function get_local_rank (line 47) | def get_local_rank() -> int: function get_local_size (line 62) | def get_local_size() -> int: function _get_global_gloo_group (line 67) | def _get_global_gloo_group(): function all_gather (line 78) | def all_gather(data, group=None): class NumpySerializedList (line 105) | class NumpySerializedList: method __init__ (line 106) | def __init__(self, lst: list): method __len__ (line 122) | def __len__(self): method __getitem__ (line 125) | def __getitem__(self, idx): class TorchSerializedList (line 132) | class TorchSerializedList(NumpySerializedList): method __init__ (line 133) | def __init__(self, lst: list): method __getitem__ (line 138) | def __getitem__(self, idx): function local_scatter (line 145) | def local_scatter(array: Optional[List[Any]]): class TorchShmSerializedList (line 167) | class TorchShmSerializedList(TorchSerializedList): method __init__ (line 168) | def __init__(self, lst: list): function local_broadcast_process_authkey (line 194) | def local_broadcast_process_authkey(): FILE: llava-train_videochat/llava/train/llava_trainer.py function maybe_zero_3 (line 27) | def maybe_zero_3(param, ignore_status=False, name=None): function get_mm_adapter_state_maybe_zero_3 (line 42) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function split_to_even_chunks (line 48) | def split_to_even_chunks(indices, lengths, num_chunks): function get_variable_length_grouped_indices (line 70) | def get_variable_length_grouped_indices(lengths, batch_size, world_size,... function get_modality_length_grouped_indices (line 86) | def get_modality_length_grouped_indices(lengths, batch_size, world_size,... function get_length_grouped_indices (line 126) | def get_length_grouped_indices(lengths, batch_size, world_size, generato... function get_length_grouped_indices_auto_single (line 149) | def get_length_grouped_indices_auto_single(lengths, batch_size, world_si... function get_modality_length_grouped_indices_auto (line 164) | def get_modality_length_grouped_indices_auto(lengths, batch_size, world_... class LengthGroupedSampler (line 193) | class LengthGroupedSampler(Sampler): method __init__ (line 199) | def __init__( method __len__ (line 220) | def __len__(self): method __iter__ (line 223) | def __iter__(self): class LLaVATrainer (line 237) | class LLaVATrainer(Trainer): method create_accelerator_and_postprocess (line 239) | def create_accelerator_and_postprocess(self): method _get_train_sampler (line 270) | def _get_train_sampler(self) -> Optional[torch.utils.data.Sampler]: method get_train_dataloader (line 316) | def get_train_dataloader(self) -> DataLoader: method create_optimizer (line 353) | def create_optimizer(self): method _save_checkpoint (line 432) | def _save_checkpoint(self, model, trial, metrics=None): method _save (line 456) | def _save(self, output_dir: Optional[str] = None, state_dict=None): FILE: llava-train_videochat/llava/train/llava_trainer_eval.py class LLaVAEvalTrainer (line 7) | class LLaVAEvalTrainer(LLaVATrainer): method evaluate (line 8) | def evaluate(self, evaluate_args): FILE: llava-train_videochat/llava/train/train.py class ModelArguments (line 64) | class ModelArguments: class DataArguments (line 135) | class DataArguments: class TrainingArguments (line 159) | class TrainingArguments(transformers.TrainingArguments): function maybe_zero_3 (line 208) | def maybe_zero_3(param, ignore_status=False, name=None): function get_peft_state_maybe_zero_3 (line 224) | def get_peft_state_maybe_zero_3(named_params, bias): function get_peft_state_non_lora_maybe_zero_3 (line 249) | def get_peft_state_non_lora_maybe_zero_3(named_params, require_grad_only... function get_mm_adapter_state_maybe_zero_3 (line 257) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function find_all_linear_names (line 263) | def find_all_linear_names(model): function safe_save_model_for_hf_trainer (line 279) | def safe_save_model_for_hf_trainer(trainer: transformers.Trainer, output... function smart_tokenizer_and_embedding_resize (line 323) | def smart_tokenizer_and_embedding_resize( function _tokenize_fn (line 346) | def _tokenize_fn(strings: Sequence[str], tokenizer: transformers.PreTrai... function _mask_targets (line 368) | def _mask_targets(target, tokenized_lens, speakers): function _add_speaker_and_signal (line 379) | def _add_speaker_and_signal(header, source, get_conversation=True): function preprocess_multimodal (line 399) | def preprocess_multimodal(sources: Sequence[str], data_args: DataArgumen... function preprocess_llama_2 (line 431) | def preprocess_llama_2(sources, tokenizer: transformers.PreTrainedTokeni... function preprocess_gemma (line 506) | def preprocess_gemma(sources: List[List[Dict[str, str]]], tokenizer: tra... function preprocess_qwen (line 585) | def preprocess_qwen(sources, tokenizer: transformers.PreTrainedTokenizer... function preprocess_internlm2 (line 665) | def preprocess_internlm2(sources, tokenizer: transformers.PreTrainedToke... function preprocess_llama3 (line 742) | def preprocess_llama3( function preprocess_v1 (line 828) | def preprocess_v1(sources, tokenizer: transformers.PreTrainedTokenizer, ... function preprocess_mpt (line 907) | def preprocess_mpt(sources, tokenizer: transformers.PreTrainedTokenizer,... function preprocess_plain (line 988) | def preprocess_plain( function preprocess (line 1010) | def preprocess(sources: Sequence[str], tokenizer: transformers.PreTraine... class LazySupervisedDataset (line 1065) | class LazySupervisedDataset(Dataset): method __init__ (line 1066) | def __init__(self, data_path: str, tokenizer: transformers.PreTrainedT... method __len__ (line 1257) | def __len__(self): method lengths (line 1261) | def lengths(self): method modality_lengths (line 1274) | def modality_lengths(self): method process_image (line 1285) | def process_image(self, image_file, overwrite_image_aspect_ratio=None): method process_video (line 1344) | def process_video(self, video_file, data_anno, data_args): method __getitem__ (line 1413) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: method _get_item (line 1448) | def _get_item(self, i) -> Dict[str, torch.Tensor]: class DataCollatorForSupervisedDataset (line 1538) | class DataCollatorForSupervisedDataset(object): method pad_sequence (line 1543) | def pad_sequence(self, input_ids, batch_first, padding_value): method __call__ (line 1551) | def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]: function make_supervised_data_module (line 1588) | def make_supervised_data_module(tokenizer: transformers.PreTrainedTokeni... function get_model (line 1595) | def get_model(model_args, training_args, bnb_model_from_pretrained_args): function train (line 1814) | def train(attn_implementation=None): FILE: llava-train_videochat/llava/utils.py function process_video_with_decord (line 25) | def process_video_with_decord(video_file, data_args): function process_video_with_pyav (line 41) | def process_video_with_pyav(video_file, data_args): function rank0_print (line 66) | def rank0_print(*args): function rank_print (line 74) | def rank_print(*args): function build_logger (line 80) | def build_logger(logger_name, logger_filename): class StreamToLogger (line 122) | class StreamToLogger(object): method __init__ (line 127) | def __init__(self, logger, log_level=logging.INFO): method __getattr__ (line 133) | def __getattr__(self, attr): method write (line 136) | def write(self, buf): method flush (line 150) | def flush(self): function disable_torch_init (line 156) | def disable_torch_init(): function violates_moderation (line 166) | def violates_moderation(text): function pretty_print_semaphore (line 188) | def pretty_print_semaphore(semaphore): FILE: llava-train_videochat/llava/video_utils.py function get_index (line 18) | def get_index(num_frames, num_segments): function lazy_load_s3video (line 27) | def lazy_load_s3video(s3path_video, num_frames, video_start, video_end, ... function pts_to_secs (line 71) | def pts_to_secs(pts: int, time_base: float, start_pts: int) -> float: function get_pyav_video_duration (line 86) | def get_pyav_video_duration(video_reader): function get_frame_indices (line 97) | def get_frame_indices(num_frames, vlen, sample='middle', fix_start=None,... function read_frames_av (line 167) | def read_frames_av(video_path, num_frames, sample='rand', client=None, f... function read_frames_gif (line 196) | def read_frames_gif( function read_frames_decord (line 248) | def read_frames_decord( function read_frames_img (line 298) | def read_frames_img( function read_frames_fake (line 400) | def read_frames_fake( FILE: lmms-eval_videochat/lmms_eval/__main__.py function _handle_non_serializable (line 30) | def _handle_non_serializable(o): function parse_eval_args (line 39) | def parse_eval_args() -> argparse.Namespace: function cli_evaluate (line 152) | def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None: function cli_evaluate_single (line 228) | def cli_evaluate_single(args: Union[argparse.Namespace, None] = None) ->... function print_results (line 345) | def print_results(args, results): FILE: lmms-eval_videochat/lmms_eval/api/filter.py class Filter (line 8) | class Filter: method __init__ (line 17) | def __init__(self, *args, **kwargs) -> None: method apply (line 22) | def apply(self, resps, docs): class FilterEnsemble (line 33) | class FilterEnsemble: method apply (line 44) | def apply(self, instances: List[Instance], docs: List[Dataset]) -> None: FILE: lmms-eval_videochat/lmms_eval/api/instance.py class Instance (line 6) | class Instance: method __post_init__ (line 20) | def __post_init__(self) -> None: method args (line 25) | def args(self): FILE: lmms-eval_videochat/lmms_eval/api/metrics.py function bypass_agg (line 17) | def bypass_agg(arr): function mean (line 22) | def mean(arr): function median (line 27) | def median(arr): function perplexity (line 34) | def perplexity(items): function weighted_perplexity (line 41) | def weighted_perplexity(items): function bits_per_byte (line 46) | def bits_per_byte(items): function f1_score (line 51) | def f1_score(items): function matthews_corrcoef (line 61) | def matthews_corrcoef(items): function bleu (line 70) | def bleu(items): function chrf (line 88) | def chrf(items): function ter (line 103) | def ter(items): function acc_fn (line 124) | def acc_fn(items): # This is a passthrough function function acc_norm_fn (line 134) | def acc_norm_fn(items): # This is a passthrough function function acc_mutual_info_fn (line 144) | def acc_mutual_info_fn(items): # This is a passthrough function function exact_match_fn (line 156) | def exact_match_fn(**kwargs): function perplexity_fn (line 166) | def perplexity_fn(items): # This is a passthrough function function levenshtein_distance (line 170) | def levenshtein_distance(s1, s2): function anls (line 192) | def anls( function pop_stddev (line 216) | def pop_stddev(arr): function sample_stddev (line 221) | def sample_stddev(arr): function mean_stderr (line 226) | def mean_stderr(arr): function bypass (line 236) | def bypass(items): function mcc_fn (line 246) | def mcc_fn(items): # This is a passthrough function function f1_fn (line 256) | def f1_fn(items): # This is a passthrough function function bleu_fn (line 266) | def bleu_fn(items): # This is a passthrough function function chrf_fn (line 276) | def chrf_fn(items): # This is a passthrough function function ter_fn (line 286) | def ter_fn(items): # This is a passthrough function function acc_all (line 296) | def acc_all(items): function acc_all_stderr (line 315) | def acc_all_stderr(items): function metric_max_over_ground_truths (line 333) | def metric_max_over_ground_truths(metric_fn, prediction, ground_truths): function weighted_mean (line 342) | def weighted_mean(items): function is_non_str_iterable (line 347) | def is_non_str_iterable(obj): function _sacreformat (line 351) | def _sacreformat(refs, preds): class _bootstrap_internal (line 382) | class _bootstrap_internal: method __init__ (line 383) | def __init__(self, f, n) -> None: method __call__ (line 387) | def __call__(self, v): function bootstrap_stderr (line 397) | def bootstrap_stderr(f, xs, iters): function stderr_for_metric (line 426) | def stderr_for_metric(metric, bootstrap_iters): FILE: lmms-eval_videochat/lmms_eval/api/model.py class lmms (line 18) | class lmms(abc.ABC): method __init__ (line 19) | def __init__(self) -> None: method loglikelihood (line 31) | def loglikelihood(self, requests: List[Instance]) -> List[Tuple[float,... method generate_until (line 59) | def generate_until(self, requests) -> List[str]: method create_from_arg_string (line 78) | def create_from_arg_string(cls: Type[T], arg_string: str, additional_c... method rank (line 95) | def rank(self): method world_size (line 102) | def world_size(self): method set_cache_hook (line 108) | def set_cache_hook(self, cache_hook) -> None: function hash_args (line 113) | def hash_args(attr, args): class CacheHook (line 118) | class CacheHook: method __init__ (line 119) | def __init__(self, cachinglm) -> None: method add_partial (line 126) | def add_partial(self, attr, req, res) -> None: class CachingLMM (line 133) | class CachingLMM: method __init__ (line 134) | def __init__(self, lm, cache_db) -> None: method __getattr__ (line 151) | def __getattr__(self, attr): method get_cache_hook (line 202) | def get_cache_hook(self): FILE: lmms-eval_videochat/lmms_eval/api/registry.py function register_model (line 11) | def register_model(*names): function get_model (line 27) | def get_model(model_name): function register_task (line 41) | def register_task(name): function register_group (line 53) | def register_group(name): function register_metric (line 82) | def register_metric(**args): function get_metric (line 109) | def get_metric(name: str, hf_evaluate_metric=False) -> Callable: function register_aggregation (line 125) | def register_aggregation(name): function get_aggregation (line 135) | def get_aggregation(name): function get_metric_aggregation (line 144) | def get_metric_aggregation(name): function is_higher_better (line 153) | def is_higher_better(metric_name): FILE: lmms-eval_videochat/lmms_eval/api/samplers.py class ContextSampler (line 1) | class ContextSampler: method __init__ (line 2) | def __init__(self, docs, task, fewshot_indices=None, rnd=None) -> None: method get_context (line 20) | def get_context(self, doc, num_fewshot): method sample (line 50) | def sample(self, n): class FirstNSampler (line 58) | class FirstNSampler(ContextSampler): method sample (line 59) | def sample(self, n) -> None: class BalancedSampler (line 68) | class BalancedSampler(ContextSampler): method sample (line 69) | def sample(self, n) -> None: class ManualSampler (line 78) | class ManualSampler(ContextSampler): method sample (line 79) | def sample(self, n) -> None: function get_sampler (line 90) | def get_sampler(name): FILE: lmms-eval_videochat/lmms_eval/api/task.py class TaskConfig (line 55) | class TaskConfig(dict): method __post_init__ (line 103) | def __post_init__(self) -> None: method __getitem__ (line 130) | def __getitem__(self, item): method __setitem__ (line 133) | def __setitem__(self, item, value): method to_dict (line 136) | def to_dict(self): class Task (line 157) | class Task(abc.ABC): method __init__ (line 178) | def __init__( method download (line 215) | def download(self, data_dir=None, cache_dir=None, download_mode=None) ... method config (line 268) | def config(self): method has_training_docs (line 273) | def has_training_docs(self): method has_validation_docs (line 278) | def has_validation_docs(self): method has_test_docs (line 283) | def has_test_docs(self): method training_docs (line 287) | def training_docs(self): method validation_docs (line 294) | def validation_docs(self): method test_docs (line 301) | def test_docs(self): method fewshot_docs (line 308) | def fewshot_docs(self): method _process_doc (line 322) | def _process_doc(self, doc): method instances (line 334) | def instances(self): method fewshot_examples (line 340) | def fewshot_examples(self, k, rnd): method doc_to_decontamination_query (line 346) | def doc_to_decontamination_query(self, doc) -> None: method doc_to_text (line 351) | def doc_to_text(self, doc): method doc_to_target (line 355) | def doc_to_target(self, doc): method build_all_requests (line 359) | def build_all_requests(self, limit=None, rank=None, world_size=None) -... method construct_requests (line 399) | def construct_requests(self, doc_id, ctx, **kwargs): method process_results (line 418) | def process_results(self, doc, results): method aggregation (line 431) | def aggregation(self): method higher_is_better (line 440) | def higher_is_better(self): method count_bytes (line 449) | def count_bytes(cls, doc): method fewshot_context (line 454) | def fewshot_context( method apply_filters (line 504) | def apply_filters(self): method dump_config (line 512) | def dump_config(self) -> dict: method override_metric (line 522) | def override_metric(self, metric_name: str) -> None: class ConfigurableTask (line 546) | class ConfigurableTask(Task): method __init__ (line 551) | def __init__(self, model_name) -> None: # TODO no super() call here method _prepare_model_specific_config (line 639) | def _prepare_model_specific_config(self): method _prepare_metric_and_aggregation (line 665) | def _prepare_metric_and_aggregation(self): method download (line 717) | def download(self, dataset_kwargs=None) -> None: method has_training_docs (line 915) | def has_training_docs(self) -> bool: method has_validation_docs (line 921) | def has_validation_docs(self) -> bool: method has_test_docs (line 927) | def has_test_docs(self) -> bool: method training_docs (line 933) | def training_docs(self) -> datasets.Dataset: method validation_docs (line 937) | def validation_docs(self) -> datasets.Dataset: method test_docs (line 941) | def test_docs(self) -> datasets.Dataset: method fewshot_docs (line 945) | def fewshot_docs(self): method fewshot_context (line 954) | def fewshot_context(self, doc_id, num_fewshot, split): method apply_filters (line 983) | def apply_filters(self): method should_decontaminate (line 991) | def should_decontaminate(self): method doc_to_decontamination_query (line 994) | def doc_to_decontamination_query(self, doc): method _process_doc (line 1007) | def _process_doc(self, doc): method doc_to_text (line 1018) | def doc_to_text(self, doc): method doc_to_target (line 1055) | def doc_to_target(self, doc: dict) -> Union[int, str, list]: method doc_to_visual (line 1092) | def doc_to_visual(self, doc: dict) -> Union[int, str, list]: method doc_to_choice (line 1109) | def doc_to_choice(self, doc: Any) -> List[str]: method construct_requests (line 1131) | def construct_requests(self, doc_id: int, ctx: str, **kwargs) -> Union... method process_results (line 1185) | def process_results(self, doc, results, full_docs=None): method aggregation (line 1330) | def aggregation(self): method higher_is_better (line 1333) | def higher_is_better(self): FILE: lmms-eval_videochat/lmms_eval/evaluator.py function simple_evaluate (line 35) | def simple_evaluate( function evaluate (line 169) | def evaluate( FILE: lmms-eval_videochat/lmms_eval/filters/__init__.py function get_filter (line 24) | def get_filter(filter_name): function build_filter_ensemble (line 31) | def build_filter_ensemble(filter_name, components): FILE: lmms-eval_videochat/lmms_eval/filters/decontamination.py class DecontaminationFilter (line 4) | class DecontaminationFilter(Filter): method __init__ (line 11) | def __init__(self, path) -> None: method apply (line 19) | def apply(self, resps, docs) -> None: FILE: lmms-eval_videochat/lmms_eval/filters/extraction.py class WhitespaceFilter (line 7) | class WhitespaceFilter(Filter): method __init__ (line 10) | def __init__(self) -> None: method apply (line 13) | def apply(self, resps, docs): class RegexFilter (line 29) | class RegexFilter(Filter): method __init__ (line 32) | def __init__( method apply (line 47) | def apply(self, resps, docs): class MultiChoiceRegexFilter (line 73) | class MultiChoiceRegexFilter(RegexFilter): method __init__ (line 81) | def __init__( method apply (line 104) | def apply(self, resps, docs): class ExtendedRegexFilter (line 175) | class ExtendedRegexFilter(RegexFilter): method __init__ (line 178) | def __init__( method filter_ignores (line 192) | def filter_ignores(self, st): method find_match (line 205) | def find_match(self, regex, resp, convert_dict={}): class SimpleMultiChoiceRegexFilter (line 218) | class SimpleMultiChoiceRegexFilter(ExtendedRegexFilter): method __init__ (line 219) | def __init__(self, *args, **kwargs): method apply (line 231) | def apply(self, resps, docs): FILE: lmms-eval_videochat/lmms_eval/filters/selection.py class TakeFirstFilter (line 6) | class TakeFirstFilter(Filter): method __init__ (line 7) | def __init__(self) -> None: method apply (line 12) | def apply(self, resps, docs): class TakeKFilter (line 19) | class TakeKFilter(Filter): method __init__ (line 20) | def __init__(self, *args, **kwargs) -> None: method apply (line 25) | def apply(self, resps, docs): class MajorityVoteFilter (line 31) | class MajorityVoteFilter(Filter): method __init__ (line 32) | def __init__(self) -> None: method apply (line 37) | def apply(self, resps, docs): FILE: lmms-eval_videochat/lmms_eval/filters/transformation.py class LowercaseFilter (line 4) | class LowercaseFilter(Filter): method __init__ (line 5) | def __init__(self) -> None: method apply (line 8) | def apply(self, resps, docs): class UppercaseFilter (line 15) | class UppercaseFilter(Filter): method __init__ (line 16) | def __init__(self) -> None: method apply (line 19) | def apply(self, resps, docs): class MapFilter (line 26) | class MapFilter(Filter): method __init__ (line 27) | def __init__(self, mapping_dict: dict = {}, default_value=None) -> None: method apply (line 44) | def apply(self, resps, docs): FILE: lmms-eval_videochat/lmms_eval/logging_utils.py function remove_none_pattern (line 27) | def remove_none_pattern(input_string): function _handle_non_serializable (line 40) | def _handle_non_serializable(o: Any) -> Union[int, str, list]: function get_wandb_printer (line 59) | def get_wandb_printer() -> Literal["Printer"]: class WandbLogger (line 69) | class WandbLogger: method __init__ (line 70) | def __init__(self, args): method finish (line 82) | def finish(self): method init_run (line 86) | def init_run(self): method post_init (line 100) | def post_init(self, results: Dict[str, Any]) -> None: method _get_config (line 105) | def _get_config(self) -> Dict[str, Any]: method _sanitize_results_dict (line 116) | def _sanitize_results_dict(self) -> Tuple[Dict[str, str], Dict[str, An... method _log_results_as_table (line 156) | def _log_results_as_table(self) -> None: method _log_results_as_artifact (line 216) | def _log_results_as_artifact(self) -> None: method log_eval_result (line 224) | def log_eval_result(self) -> None: method _generate_dataset (line 240) | def _generate_dataset(self, data: List[Dict[str, Any]], config: Dict[s... method _log_samples_as_artifact (line 306) | def _log_samples_as_artifact(self, data: List[Dict[str, Any]], task_na... method log_eval_samples (line 320) | def log_eval_samples(self, samples: Dict[str, List[Dict[str, Any]]]) -... FILE: lmms-eval_videochat/lmms_eval/models/videochat_flash.py class VideoChat_Flash (line 40) | class VideoChat_Flash(lmms): method __init__ (line 45) | def __init__( method config (line 128) | def config(self): method tokenizer (line 133) | def tokenizer(self): method model (line 137) | def model(self): method eot_token_id (line 145) | def eot_token_id(self): method max_length (line 150) | def max_length(self): method batch_size (line 156) | def batch_size(self): method device (line 160) | def device(self): method rank (line 164) | def rank(self): method world_size (line 168) | def world_size(self): method tok_encode (line 171) | def tok_encode(self, string: str, left_truncate_len=None, add_special_... method tok_decode (line 180) | def tok_decode(self, tokens): method loglikelihood (line 186) | def loglikelihood(self, requests: List[Instance]) -> List[Tuple[float,... method flatten (line 190) | def flatten(self, input): method generate_until (line 197) | def generate_until(self, requests: List[Instance]) -> List[str]: FILE: lmms-eval_videochat/lmms_eval/tasks/__init__.py function register_configurable_task (line 22) | def register_configurable_task(config: Dict[str, str]) -> int: function register_configurable_group (line 47) | def register_configurable_group(config: Dict[str, str]) -> int: function get_task_name_from_config (line 61) | def get_task_name_from_config(task_config: Dict[str, str]) -> str: function include_task_folder (line 68) | def include_task_folder(task_dir: str, register_task: bool = True) -> None: function include_path (line 107) | def include_path(task_dir): function initialize_tasks (line 114) | def initialize_tasks(verbosity="INFO"): function get_task (line 127) | def get_task(task_name, model_name): function get_task_name_from_object (line 136) | def get_task_name_from_object(task_object): function get_task_dict (line 147) | def get_task_dict(task_name_list: List[Union[str, Dict, Task]], model_na... FILE: lmms-eval_videochat/lmms_eval/tasks/_task_utils/file_utils.py function generate_submission_file (line 4) | def generate_submission_file(file_name, args, subpath="submissions"): FILE: lmms-eval_videochat/lmms_eval/tasks/_task_utils/video_loader.py function get_cache_dir (line 4) | def get_cache_dir(config, sub_dir="videos"): function _get_video_file (line 12) | def _get_video_file(prefix: str, video_name: str, suffix: str): function get_video (line 21) | def get_video(prefix: str, video_name: str, suffix: str = "mp4"): FILE: lmms-eval_videochat/lmms_eval/tasks/_task_utils/vqa_eval_metric.py class EvalAIAnswerProcessor (line 4) | class EvalAIAnswerProcessor: method __init__ (line 175) | def __init__(self, *args, **kwargs): method word_tokenize (line 178) | def word_tokenize(self, word): method process_punctuation (line 183) | def process_punctuation(self, in_text): method process_digit_article (line 193) | def process_digit_article(self, in_text): method __call__ (line 208) | def __call__(self, item): FILE: lmms-eval_videochat/lmms_eval/tasks/longvideobench/utils.py function timestamp_to_seconds (line 22) | def timestamp_to_seconds(timestamp): function load_video (line 30) | def load_video(video_file, duration, max_num_frames=16): function compute_frame_timestamps (line 50) | def compute_frame_timestamps(duration, max_num_frames=16): function insert_subtitles_into_frames (line 57) | def insert_subtitles_into_frames(frame_timestamps, subtitles, starting_t... function longvideobench_doc_to_text (line 119) | def longvideobench_doc_to_text(doc, lmms_eval_specific_kwargs): function longvideobench_doc_to_visual_v (line 164) | def longvideobench_doc_to_visual_v(doc): function longvideobench_doc_to_visual_i (line 180) | def longvideobench_doc_to_visual_i(doc): function get_multi_choice_info (line 197) | def get_multi_choice_info(options): function parse_multi_choice_response (line 214) | def parse_multi_choice_response(response, all_choices, index2ans): function evaluate_longvideobench (line 275) | def evaluate_longvideobench(samples): function eval_multi_choice (line 294) | def eval_multi_choice(gold_i, pred_i): function calculate_ins_level_acc (line 308) | def calculate_ins_level_acc(results): function longvideobench_process_results (line 322) | def longvideobench_process_results(doc, results): function longvideobench_aggregate_results (line 344) | def longvideobench_aggregate_results(results): function longvideobench_aggregate_results_for_submission (line 370) | def longvideobench_aggregate_results_for_submission(results, args): FILE: lmms-eval_videochat/lmms_eval/tasks/lvbench/utils.py function lvbench_mc_doc_to_visual (line 30) | def lvbench_mc_doc_to_visual(doc, lmms_eval_specific_kwargs=None): function lvbench_mc_doc_to_text (line 51) | def lvbench_mc_doc_to_text(doc, lmms_eval_specific_kwargs=None): function mcq_acc (line 63) | def mcq_acc(answer, pred): function lvbench_mc_process_results (line 115) | def lvbench_mc_process_results(doc, results): function lvbench_mc_aggregate_results (line 144) | def lvbench_mc_aggregate_results(results): FILE: lmms-eval_videochat/lmms_eval/tasks/mlvu_mc/utils.py function mlvu_mc_doc_to_visual (line 43) | def mlvu_mc_doc_to_visual(doc, lmms_eval_specific_kwargs=None): function mlvu_mc_frames_doc_to_visual (line 70) | def mlvu_mc_frames_doc_to_visual(doc, lmms_eval_specific_kwargs=None): function mlvu_mc_doc_to_text (line 96) | def mlvu_mc_doc_to_text(doc, lmms_eval_specific_kwargs=None): function mcq_acc (line 112) | def mcq_acc(answer, pred): function mlvu_mc_process_results (line 164) | def mlvu_mc_process_results(doc, results): function mlvu_mc_aggregate_results (line 193) | def mlvu_mc_aggregate_results(results): FILE: lmms-eval_videochat/lmms_eval/tasks/mvbench/utils.py function mvbench_doc_to_visual (line 56) | def mvbench_doc_to_visual(doc, lmms_eval_specific_kwargs=None): function mvbench_frames_doc_to_visual (line 82) | def mvbench_frames_doc_to_visual(doc, lmms_eval_specific_kwargs=None): function mvbench_doc_to_text (line 108) | def mvbench_doc_to_text(doc, lmms_eval_specific_kwargs=None): function mcq_acc (line 125) | def mcq_acc(answer, pred): function mvbench_process_results (line 177) | def mvbench_process_results(doc, results): function mvbench_aggregate_results (line 206) | def mvbench_aggregate_results(results): FILE: lmms-eval_videochat/lmms_eval/tasks/perceptiontest/val/utils.py function perceptiontest_val_doc_to_visual (line 35) | def perceptiontest_val_doc_to_visual(doc): function perceptiontest_val_doc_to_text (line 48) | def perceptiontest_val_doc_to_text(doc, lmms_eval_specific_kwargs=None): function perceptiontest_val_doc_to_answer (line 75) | def perceptiontest_val_doc_to_answer(doc): function perceptiontest_val_process_results_mc_ppl (line 80) | def perceptiontest_val_process_results_mc_ppl(doc, result): function perceptiontest_val_process_results_mc (line 110) | def perceptiontest_val_process_results_mc(doc, result): function perceptiontest_val_aggregate_accuracy (line 139) | def perceptiontest_val_aggregate_accuracy(results, args): function perceptiontest_val_doc_to_choice (line 152) | def perceptiontest_val_doc_to_choice(doc): FILE: lmms-eval_videochat/lmms_eval/tasks/temporal_grounding/eval_tvg.py function read_json (line 11) | def read_json(path): function write_json (line 17) | def write_json(path, data): function extract_time (line 24) | def extract_time(paragraph): function iou (line 101) | def iou(A, B): FILE: lmms-eval_videochat/lmms_eval/tasks/temporal_grounding/utils.py function temporal_grounding_doc_to_visual (line 32) | def temporal_grounding_doc_to_visual(doc, lmms_eval_specific_kwargs=None): function temporal_grounding_doc_to_text (line 45) | def temporal_grounding_doc_to_text(doc, lmms_eval_specific_kwargs=None): function temporal_grounding_doc_to_answer (line 59) | def temporal_grounding_doc_to_answer(doc): function temporal_grounding_process_results_generation (line 64) | def temporal_grounding_process_results_generation(doc, result): function temporal_grounding_aggregate_charades (line 69) | def temporal_grounding_aggregate_charades(results, args): function temporal_grounding_aggregate_submissions (line 72) | def temporal_grounding_aggregate_submissions(results, args, task): FILE: lmms-eval_videochat/lmms_eval/tasks/videomme/utils.py function parse_subtitle_time (line 97) | def parse_subtitle_time(time_str): function load_subtitles (line 103) | def load_subtitles(subtitle_path): function convert_time_to_frame (line 119) | def convert_time_to_frame(time_in_seconds, fps): function extract_subtitles (line 123) | def extract_subtitles(video_path, subtitle_path): function parse_subtitle_time (line 138) | def parse_subtitle_time(time_str): function load_subtitles (line 144) | def load_subtitles(subtitle_path): function convert_time_to_frame (line 160) | def convert_time_to_frame(time_in_seconds, fps): function extract_subtitles (line 164) | def extract_subtitles(video_path, subtitle_path): function videomme_doc_to_visual (line 179) | def videomme_doc_to_visual(doc): function videomme_doc_to_text (line 195) | def videomme_doc_to_text(doc, lmms_eval_specific_kwargs=None): function videomme_doc_to_text_subtitle (line 221) | def videomme_doc_to_text_subtitle(doc, lmms_eval_specific_kwargs=None): function extract_characters_regex (line 282) | def extract_characters_regex(s): function videomme_process_results (line 313) | def videomme_process_results(doc, results): function videomme_aggregate_results (line 334) | def videomme_aggregate_results(results): FILE: lmms-eval_videochat/lmms_eval/utils.py function is_json (line 45) | def is_json(string): function escaped_split (line 53) | def escaped_split(text, sep_char, maxsplit=-1): function handle_arg_string (line 74) | def handle_arg_string(arg): function simple_parse_args_string (line 87) | def simple_parse_args_string(args_string): function join_iters (line 111) | def join_iters(iters): function chunks (line 116) | def chunks(iter, n: int = 0, fn=None): function group (line 154) | def group(arr, fn): class MultiChoice (line 163) | class MultiChoice: method __init__ (line 164) | def __init__(self, choices) -> None: method __contains__ (line 168) | def __contains__(self, values) -> bool: method __iter__ (line 177) | def __iter__(self) -> Iterator: function pattern_match (line 184) | def pattern_match(patterns, source_list): function general_detokenize (line 195) | def general_detokenize(string): function get_rolling_token_windows (line 205) | def get_rolling_token_windows(token_list, prefix_token, max_seq_len, con... function make_disjoint_window (line 246) | def make_disjoint_window(pair): class Reorderer (line 252) | class Reorderer: method __init__ (line 253) | def __init__(self, arr: List[Any], fn: Callable) -> None: method get_reordered (line 270) | def get_reordered(self): method get_original (line 278) | def get_original(self, newarr): class Grouper (line 300) | class Grouper: method __init__ (line 307) | def __init__(self, arr, fn) -> None: method get_grouped (line 325) | def get_grouped(self): method get_original (line 336) | def get_original(self, grouped_dict): function make_table (line 358) | def make_table(result_dict, column: str = "results"): function positional_deprecated (line 434) | def positional_deprecated(fn): function find_test_root (line 450) | def find_test_root(start_path: pathlib.Path) -> pathlib.Path: function run_task_tests (line 466) | def run_task_tests(task_list: List[str]): function get_git_commit_hash (line 486) | def get_git_commit_hash(): function get_datetime_str (line 500) | def get_datetime_str(timezone="Asia/Singapore"): function import_function (line 511) | def import_function(loader, node): function load_yaml_config (line 532) | def load_yaml_config(yaml_path=None, yaml_config=None, yaml_dir=None): function regex_replace (line 571) | def regex_replace(string, pattern, repl, count: int = 0): function apply_template (line 580) | def apply_template(template: str, doc: dict) -> str: function create_iterator (line 585) | def create_iterator(raw_iterator, rank, world_size, limit=None): function pad_and_concat (line 594) | def pad_and_concat( function clear_torch_cache (line 643) | def clear_torch_cache() -> None: function get_dtype (line 648) | def get_dtype(dtype: Union[str, torch.dtype]) -> torch.dtype: class MultiTokenEOSCriteria (line 659) | class MultiTokenEOSCriteria(transformers.StoppingCriteria): method __init__ (line 662) | def __init__( method __call__ (line 683) | def __call__(self, input_ids, scores, **kwargs) -> bool: function stop_sequences_criteria (line 694) | def stop_sequences_criteria( function divide (line 708) | def divide(iterable, n) -> List[Iterator]: class Collator (line 759) | class Collator: method __init__ (line 766) | def __init__( method group_by_index (line 782) | def group_by_index(self) -> None: method get_batched (line 785) | def get_batched(self, n: int = 1, batch_fn: Optional[Callable] = None)... method _reorder (line 809) | def _reorder(self, arr: Union[List, Tuple[Tuple[int, Any], ...]]) -> L... method get_original (line 823) | def get_original(self, newarr: List) -> List: method __len__ (line 844) | def __len__(self): method group (line 848) | def group(arr: Iterable, fn: Callable, values: bool = False) -> Iterable: method get_chunks (line 878) | def get_chunks(_iter, n: int = 0, fn=None): FILE: xtuner-eval_niah/llava/conversation.py class SeparatorStyle (line 11) | class SeparatorStyle(Enum): class Conversation (line 26) | class Conversation: method get_prompt (line 47) | def get_prompt(self): method append_message (line 178) | def append_message(self, role, message): method process_image (line 181) | def process_image(self, image, image_process_mode, return_pil=False, i... method get_images (line 227) | def get_images(self, return_pil=False, return_path=False): method is_image_file (line 242) | def is_image_file(self, filename): method is_video_file (line 246) | def is_video_file(self, filename): method to_gradio_chatbot (line 250) | def to_gradio_chatbot(self): method copy (line 288) | def copy(self): method dict (line 291) | def dict(self): FILE: xtuner-eval_niah/llava/dist_utils.py function get_rank (line 16) | def get_rank() -> int: function get_world_size (line 23) | def get_world_size() -> int: function setup_for_distributed (line 30) | def setup_for_distributed(is_master): function init_distributed_mode (line 44) | def init_distributed_mode(use_dynamic_port: bool = True): FILE: xtuner-eval_niah/llava/mm_utils.py function resize_and_center_crop (line 12) | def resize_and_center_crop(image, shortest_edge_length): function auto_pad_images (line 33) | def auto_pad_images(image, grid_params): function extract_patches (line 63) | def extract_patches(image, patch_size, overlap_ratio): function process_highres_image_crop_split (line 87) | def process_highres_image_crop_split(image, data_args, processor=None): function process_highres_image (line 98) | def process_highres_image(image, processor, grid_pinpoints): function select_best_resolution (line 119) | def select_best_resolution(original_size, possible_resolutions, max_reso... function resize_and_pad_image (line 157) | def resize_and_pad_image(image, target_resolution): function divide_to_patches (line 196) | def divide_to_patches(image, patch_size): function get_anyres_image_grid_shape (line 218) | def get_anyres_image_grid_shape(image_size, grid_pinpoints, patch_size, ... function process_anyres_image (line 251) | def process_anyres_image(image, processor, grid_pinpoints): function process_anyres_image_nopad (line 306) | def process_anyres_image_nopad(image, processor, grid_pinpoints): function process_anyres_video_nopad (line 365) | def process_anyres_video_nopad(video, processor, grid_pinpoints, max_res... function load_image_from_base64 (line 410) | def load_image_from_base64(image): function expand2square (line 414) | def expand2square(pil_img, background_color): function process_images (line 428) | def process_images(images, image_processor, model_cfg): function tokenizer_image_token (line 460) | def tokenizer_image_token(prompt, tokenizer, image_token_index=IMAGE_TOK... function get_model_name_from_path (line 482) | def get_model_name_from_path(model_path): class KeywordsStoppingCriteria (line 491) | class KeywordsStoppingCriteria(StoppingCriteria): method __init__ (line 492) | def __init__(self, keywords, tokenizer, input_ids): method __call__ (line 503) | def __call__(self, output_ids: torch.LongTensor, scores: torch.FloatTe... FILE: xtuner-eval_niah/llava/model/apply_delta.py function apply_delta (line 14) | def apply_delta(base_model_path, target_model_path, delta_path): FILE: xtuner-eval_niah/llava/model/builder.py function load_pretrained_model (line 27) | def load_pretrained_model(model_path, model_base, model_name, load_8bit=... FILE: xtuner-eval_niah/llava/model/consolidate.py function consolidate_ckpt (line 14) | def consolidate_ckpt(src_path, dst_path): FILE: xtuner-eval_niah/llava/model/language_model/llava_qwen.py class LlavaQwenConfig (line 35) | class LlavaQwenConfig(Qwen2Config): class LlavaQwenModel (line 39) | class LlavaQwenModel(LlavaMetaModel, Qwen2Model): method __init__ (line 42) | def __init__(self, config: Qwen2Config): class LlavaQwenForCausalLM (line 46) | class LlavaQwenForCausalLM(Qwen2ForCausalLM, LlavaMetaForCausalLM): method __init__ (line 49) | def __init__(self, config): method get_model (line 60) | def get_model(self): method forward (line 63) | def forward( method generate (line 119) | def generate( method prepare_inputs_for_generation (line 139) | def prepare_inputs_for_generation(self, input_ids, past_key_values=Non... FILE: xtuner-eval_niah/llava/model/language_model/llava_qwen_flash.py class LlavaQwenConfig_Flash (line 35) | class LlavaQwenConfig_Flash(Qwen2Config): class LlavaQwenModel_Flash (line 39) | class LlavaQwenModel_Flash(LlavaMetaModel, Qwen2Model_Flash): method __init__ (line 42) | def __init__(self, config: Qwen2Config): class LlavaQwenForCausalLM_Flash (line 46) | class LlavaQwenForCausalLM_Flash(Qwen2ForCausalLM_Flash, LlavaMetaForCau... method __init__ (line 49) | def __init__(self, config): method get_model (line 60) | def get_model(self): method forward (line 63) | def forward( method generate (line 120) | def generate( method prepare_inputs_for_generation (line 143) | def prepare_inputs_for_generation(self, input_ids, past_key_values=Non... FILE: xtuner-eval_niah/llava/model/language_model/modeling_qwen2_flash.py function _get_unpad_data (line 70) | def _get_unpad_data(attention_mask): class Qwen2RMSNorm (line 83) | class Qwen2RMSNorm(nn.Module): method __init__ (line 84) | def __init__(self, hidden_size, eps=1e-6): method forward (line 92) | def forward(self, hidden_states): class Qwen2RotaryEmbedding (line 101) | class Qwen2RotaryEmbedding(nn.Module): method __init__ (line 102) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method _set_cos_sin_cache (line 116) | def _set_cos_sin_cache(self, seq_len, device, dtype): method forward (line 126) | def forward(self, x, seq_len=None): function rotate_half (line 138) | def rotate_half(x): function apply_rotary_pos_emb (line 146) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids, unsqueeze_dim=1): class Qwen2MLP (line 175) | class Qwen2MLP(nn.Module): method __init__ (line 176) | def __init__(self, config): method forward (line 186) | def forward(self, x): function repeat_kv (line 191) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class Qwen2Attention (line 203) | class Qwen2Attention(nn.Module): method __init__ (line 209) | def __init__(self, config: Qwen2Config, layer_idx: Optional[int] = None): method forward (line 246) | def forward( class Qwen2FlashAttention2 (line 328) | class Qwen2FlashAttention2(Qwen2Attention): method __init__ (line 338) | def __init__(self, *args, **kwargs): method forward (line 346) | def forward( method _flash_attention_forward (line 482) | def _flash_attention_forward( method _upad_input (line 587) | def _upad_input(self, query_layer, key_layer, value_layer, attention_m... class Qwen2SdpaAttention (line 631) | class Qwen2SdpaAttention(Qwen2Attention): method forward (line 639) | def forward( class Qwen2DecoderLayer (line 725) | class Qwen2DecoderLayer(nn.Module): method __init__ (line 726) | def __init__(self, config: Qwen2Config, layer_idx: int): method forward (line 741) | def forward( class Qwen2PreTrainedModel (line 823) | class Qwen2PreTrainedModel(PreTrainedModel): method _init_weights (line 833) | def _init_weights(self, module): class Qwen2Model_Flash (line 919) | class Qwen2Model_Flash(Qwen2PreTrainedModel): method __init__ (line 927) | def __init__(self, config: Qwen2Config): method get_input_embeddings (line 944) | def get_input_embeddings(self): method set_input_embeddings (line 947) | def set_input_embeddings(self, value): method forward (line 951) | def forward( method flash_rank_drop (line 1159) | def flash_rank_drop( class Qwen2ForCausalLM_Flash (line 1382) | class Qwen2ForCausalLM_Flash(Qwen2PreTrainedModel): method __init__ (line 1385) | def __init__(self, config): method get_input_embeddings (line 1394) | def get_input_embeddings(self): method set_input_embeddings (line 1397) | def set_input_embeddings(self, value): method get_output_embeddings (line 1400) | def get_output_embeddings(self): method set_output_embeddings (line 1403) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 1406) | def set_decoder(self, decoder): method get_decoder (line 1409) | def get_decoder(self): method forward (line 1414) | def forward( method prepare_inputs_for_generation (line 1502) | def prepare_inputs_for_generation( method _reorder_cache (line 1560) | def _reorder_cache(past_key_values, beam_idx): FILE: xtuner-eval_niah/llava/model/llava_arch.py class LlavaMetaModel (line 35) | class LlavaMetaModel: method __init__ (line 37) | def __init__(self, config): method get_vision_tower (line 50) | def get_vision_tower(self): method initialize_vision_modules (line 56) | def initialize_vision_modules(self, model_args, fsdp=None): function unpad_image (line 116) | def unpad_image(tensor, original_size, is_frame=False): class LlavaMetaForCausalLM (line 160) | class LlavaMetaForCausalLM(ABC): method get_model (line 163) | def get_model(self): method get_vision_tower (line 166) | def get_vision_tower(self): method get_4dPool (line 169) | def get_4dPool(self, image_feature): method get_2dPool (line 194) | def get_2dPool(self, image_feature): method encode_image (line 220) | def encode_image(self, images_list): method encode_image_video (line 230) | def encode_image_video(self, images_list, video_idx_in_batch): method encode_video (line 255) | def encode_video(self, images_list, video_idx_in_batch): method encode_video_image (line 309) | def encode_video_image(self, images_list, video_idx_in_batch): method add_token_per_frame (line 364) | def add_token_per_frame(self, image_feature): method add_different_token_per_frame (line 373) | def add_different_token_per_frame(self, image_feature): method prepare_inputs_labels_for_multimodal (line 377) | def prepare_inputs_labels_for_multimodal(self, input_ids, position_ids... method initialize_vision_tokenizer (line 801) | def initialize_vision_tokenizer(self, model_args, tokenizer): FILE: xtuner-eval_niah/llava/model/make_delta.py function make_delta (line 14) | def make_delta(base_model_path, target_model_path, delta_path, hub_repo_... FILE: xtuner-eval_niah/llava/model/multimodal_encoder/builder.py function build_vision_tower (line 11) | def build_vision_tower(vision_tower_cfg, **kwargs): FILE: xtuner-eval_niah/llava/model/multimodal_encoder/clip_encoder.py class CLIPVisionTower (line 12) | class CLIPVisionTower(nn.Module): method __init__ (line 13) | def __init__(self, vision_tower, args, delay_load=False): method load_model (line 35) | def load_model(self, device_map=None): method feature_select (line 46) | def feature_select(self, image_forward_outs): method forward (line 68) | def forward(self, images): method dummy_feature (line 82) | def dummy_feature(self): method dtype (line 86) | def dtype(self): method device (line 90) | def device(self): method config (line 94) | def config(self): method hidden_size (line 101) | def hidden_size(self): method num_patches_per_side (line 110) | def num_patches_per_side(self): method num_patches (line 114) | def num_patches(self): method image_size (line 121) | def image_size(self): class CLIPVisionTowerS2 (line 125) | class CLIPVisionTowerS2(CLIPVisionTower): method __init__ (line 126) | def __init__(self, vision_tower, args, delay_load=False): method load_model (line 141) | def load_model(self, device_map=None): method forward_feature (line 155) | def forward_feature(self, images): method forward (line 160) | def forward(self, images): method hidden_size (line 172) | def hidden_size(self): FILE: xtuner-eval_niah/llava/model/multimodal_encoder/internvideo2/flash_attention_class.py class FlashAttention (line 10) | class FlashAttention(nn.Module): method __init__ (line 21) | def __init__(self, softmax_scale=None, attention_dropout=0.0, device=N... method forward (line 26) | def forward(self, qkv, key_padding_mask=None, causal=False, cu_seqlens... FILE: xtuner-eval_niah/llava/model/multimodal_encoder/internvideo2/pos_embed.py function get_3d_sincos_pos_embed (line 12) | def get_3d_sincos_pos_embed(embed_dim, grid_size, t_size, cls_token=False): function get_2d_sincos_pos_embed (line 66) | def get_2d_sincos_pos_embed(embed_dim, grid_size, cls_token=False): function get_1d_sincos_pos_embed (line 86) | def get_1d_sincos_pos_embed(embed_dim, t_size, cls_token=False): function get_2d_sincos_pos_embed_from_grid (line 101) | def get_2d_sincos_pos_embed_from_grid(embed_dim, grid): function get_1d_sincos_pos_embed_from_grid (line 116) | def get_1d_sincos_pos_embed_from_grid(embed_dim, pos): function interpolate_pos_embed_internvideo2 (line 137) | def interpolate_pos_embed_internvideo2(checkpoint_model, model, orig_t_s... function interpolate_pos_embed_internvideo2_new (line 227) | def interpolate_pos_embed_internvideo2_new(checkpoint_model, model, orig... FILE: xtuner-eval_niah/llava/model/multimodal_encoder/internvideo2/vit_scale_clean.py class CrossAttention (line 20) | class CrossAttention(nn.Module): method __init__ (line 21) | def __init__( method forward (line 52) | def forward(self, x, k=None, v=None): class AttentiveBlock (line 85) | class AttentiveBlock(nn.Module): method __init__ (line 87) | def __init__(self, dim, num_heads, qkv_bias=False, qk_scale=None, drop... method forward (line 100) | def forward(self, x_q, x_kv, pos_q, pos_k, bool_masked_pos, rel_pos_bi... class AttentionPoolingBlock (line 109) | class AttentionPoolingBlock(AttentiveBlock): method forward (line 111) | def forward(self, x): class RMSNorm (line 119) | class RMSNorm(nn.Module): method __init__ (line 120) | def __init__(self, hidden_size, eps=1e-6): method forward (line 125) | def forward(self, hidden_states): class LayerScale (line 133) | class LayerScale(nn.Module): method __init__ (line 134) | def __init__(self, dim, init_values=1e-5, inplace=False, force_fp32=Fa... method forward (line 141) | def forward(self, x): class Attention (line 151) | class Attention(nn.Module): method __init__ (line 152) | def __init__(self, dim, num_heads=8, qkv_bias=False, attn_drop=0., pro... method _naive_attn (line 175) | def _naive_attn(self, x): method _flash_attn (line 197) | def _flash_attn(self, x, key_padding_mask=None, need_weights=False): method forward (line 219) | def forward(self, x): class Mlp (line 224) | class Mlp(nn.Module): method __init__ (line 228) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 242) | def forward(self, x): class Block (line 251) | class Block(nn.Module): method __init__ (line 253) | def __init__( method forward (line 284) | def forward(self, x, residual=None): class PatchEmbed (line 306) | class PatchEmbed(nn.Module): method __init__ (line 310) | def __init__( method forward (line 334) | def forward(self, x): class PretrainVisionTransformer_clean (line 343) | class PretrainVisionTransformer_clean(nn.Module): method __init__ (line 344) | def __init__( method init_pos_embed (line 453) | def init_pos_embed(self): method _init_weights (line 476) | def _init_weights(self, m): method fix_init_weight (line 485) | def fix_init_weight(self): method dtype (line 494) | def dtype(self): method get_num_layers (line 497) | def get_num_layers(self): method no_weight_decay (line 501) | def no_weight_decay(self): method forward (line 512) | def forward(self, x, mask=None, use_image=False): function pretrain_internvideo2_giant_patch14_224_clean (line 572) | def pretrain_internvideo2_giant_patch14_224_clean(config): function pretrain_internvideo2_6b_patch14_224_clean (line 608) | def pretrain_internvideo2_6b_patch14_224_clean(config): FILE: xtuner-eval_niah/llava/model/multimodal_encoder/internvideo2_encoder.py class InternVideo2ImageProcessor (line 30) | class InternVideo2ImageProcessor: method __init__ (line 31) | def __init__(self, image_mean=(0.485, 0.456, 0.406), image_std=(0.229,... method preprocess (line 43) | def preprocess(self, images, return_tensors, target_size=None): class InternVideo2VisionConfig (line 69) | class InternVideo2VisionConfig: method __init__ (line 72) | def __init__( function build_vit (line 101) | def build_vit(config, pt_type='origin'): class InternVideo2VisionTower (line 145) | class InternVideo2VisionTower(nn.Module): method __init__ (line 146) | def __init__(self, vision_tower, vision_tower_cfg, delay_load=False, p... method load_model (line 172) | def load_model(self, device_map=None): method forward (line 182) | def forward(self, images): method dummy_feature (line 195) | def dummy_feature(self): method dtype (line 199) | def dtype(self): method device (line 204) | def device(self): method hidden_size (line 209) | def hidden_size(self): method num_patches (line 213) | def num_patches(self): method num_patches_per_side (line 217) | def num_patches_per_side(self): method image_size (line 222) | def image_size(self): FILE: xtuner-eval_niah/llava/model/multimodal_encoder/siglip_encoder.py class SigLipImageProcessor (line 34) | class SigLipImageProcessor: method __init__ (line 35) | def __init__(self, image_mean=(0.5, 0.5, 0.5), image_std=(0.5, 0.5, 0.... method preprocess (line 47) | def preprocess(self, images, return_tensors): class SigLipVisionConfig (line 70) | class SigLipVisionConfig(PretrainedConfig): method __init__ (line 73) | def __init__( method from_pretrained (line 103) | def from_pretrained(cls, pretrained_model_name_or_path: Union[str, os.... class SigLipVisionModelOutput (line 120) | class SigLipVisionModelOutput(ModelOutput): class SigLipVisionEmbeddings (line 148) | class SigLipVisionEmbeddings(nn.Module): method __init__ (line 149) | def __init__(self, config: SigLipVisionConfig): method forward (line 169) | def forward(self, pixel_values: torch.FloatTensor) -> torch.Tensor: class SigLipAttention (line 177) | class SigLipAttention(nn.Module): method __init__ (line 181) | def __init__(self, config): method forward (line 197) | def forward( class SigLipMLP (line 243) | class SigLipMLP(nn.Module): method __init__ (line 244) | def __init__(self, config): method forward (line 251) | def forward(self, hidden_states: torch.Tensor) -> torch.Tensor: class SigLipEncoderLayer (line 259) | class SigLipEncoderLayer(nn.Module): method __init__ (line 260) | def __init__(self, config: SigLipVisionConfig): method forward (line 269) | def forward( class SigLipPreTrainedModel (line 308) | class SigLipPreTrainedModel(PreTrainedModel): method _init_weights (line 318) | def _init_weights(self, module): class SigLipEncoder (line 324) | class SigLipEncoder(nn.Module): method __init__ (line 333) | def __init__(self, config: SigLipVisionConfig): method forward (line 340) | def forward( class SigLipVisionTransformer (line 408) | class SigLipVisionTransformer(nn.Module): method __init__ (line 409) | def __init__(self, config: SigLipVisionConfig): method forward (line 419) | def forward( class SigLipMultiheadAttentionPoolingHead (line 459) | class SigLipMultiheadAttentionPoolingHead(nn.Module): method __init__ (line 462) | def __init__(self, config: SigLipVisionConfig): method forward (line 470) | def forward(self, hidden_state): class SigLipVisionModel (line 483) | class SigLipVisionModel(SigLipPreTrainedModel): method __init__ (line 488) | def __init__(self, config: SigLipVisionConfig): method get_input_embeddings (line 496) | def get_input_embeddings(self) -> nn.Module: method forward (line 499) | def forward( class SigLipVisionTower (line 538) | class SigLipVisionTower(nn.Module): method __init__ (line 539) | def __init__(self, vision_tower, vision_tower_cfg, delay_load=False): method load_model (line 563) | def load_model(self, device_map=None): method forward (line 576) | def forward(self, images): method dummy_feature (line 592) | def dummy_feature(self): method dtype (line 596) | def dtype(self): method device (line 601) | def device(self): method hidden_size (line 606) | def hidden_size(self): method num_patches (line 610) | def num_patches(self): method num_patches_per_side (line 614) | def num_patches_per_side(self): method image_size (line 619) | def image_size(self): FILE: xtuner-eval_niah/llava/model/multimodal_encoder/umt/vit.py class DropPath (line 19) | class DropPath(nn.Module): method __init__ (line 22) | def __init__(self, drop_prob=None): method forward (line 26) | def forward(self, x): method extra_repr (line 29) | def extra_repr(self) -> str: class Mlp (line 33) | class Mlp(nn.Module): method __init__ (line 34) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 43) | def forward(self, x): class Attention (line 51) | class Attention(nn.Module): method __init__ (line 52) | def __init__( method forward (line 85) | def forward(self, x): class Block (line 117) | class Block(nn.Module): method __init__ (line 118) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 138) | def forward(self, x): class PatchEmbed (line 148) | class PatchEmbed(nn.Module): method __init__ (line 151) | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=... method forward (line 167) | def forward(self, x, **kwargs): function get_sinusoid_encoding_table (line 178) | def get_sinusoid_encoding_table(n_position, d_hid, ckpt_num_frame=-1, cu... function get_sinusoid_encoding_table2 (line 212) | def get_sinusoid_encoding_table2(n_position=784, d_hid=1024, cur_frame=8... class PretrainVisionTransformerEncoder (line 259) | class PretrainVisionTransformerEncoder(nn.Module): method __init__ (line 262) | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=... method no_weight_decay (line 313) | def no_weight_decay(self): method forward_features (line 316) | def forward_features(self, x, use_image=False): method forward (line 337) | def forward(self, x, use_image=False): class PretrainVisionTransformer (line 342) | class PretrainVisionTransformer(nn.Module): method __init__ (line 345) | def __init__(self, method _init_weights (line 401) | def _init_weights(self, m): method no_weight_decay (line 411) | def no_weight_decay(self): method forward (line 414) | def forward(self, x, use_image=False): FILE: xtuner-eval_niah/llava/model/multimodal_encoder/umt_encoder.py class UMTImageProcessor (line 30) | class UMTImageProcessor: method __init__ (line 31) | def __init__(self, image_mean=(0.485, 0.456, 0.406), image_std=(0.229,... method preprocess (line 43) | def preprocess(self, images, return_tensors, target_size=None): class UMTVisionConfig (line 69) | class UMTVisionConfig: method __init__ (line 72) | def __init__( function build_vit (line 95) | def build_vit(config, pt_type='origin'): class UMTVisionTower (line 134) | class UMTVisionTower(nn.Module): method __init__ (line 135) | def __init__(self, vision_tower, vision_tower_cfg, delay_load=False, p... method load_model (line 160) | def load_model(self, device_map=None): method forward (line 170) | def forward(self, images): method dummy_feature (line 185) | def dummy_feature(self): method dtype (line 189) | def dtype(self): method device (line 194) | def device(self): method hidden_size (line 199) | def hidden_size(self): method num_patches (line 203) | def num_patches(self): method num_patches_per_side (line 207) | def num_patches_per_side(self): method image_size (line 212) | def image_size(self): FILE: xtuner-eval_niah/llava/model/multimodal_projector/builder.py class IdentityMap (line 7) | class IdentityMap(nn.Module): method __init__ (line 8) | def __init__(self): method forward (line 11) | def forward(self, x, *args, **kwargs): method config (line 15) | def config(self): class SimpleResBlock (line 19) | class SimpleResBlock(nn.Module): method __init__ (line 20) | def __init__(self, channels): method forward (line 25) | def forward(self, x): function build_vision_projector (line 30) | def build_vision_projector(config, delay_load=False, **kwargs): FILE: xtuner-eval_niah/llava/model/multimodal_projector/tome16_mlp_hd64.py function bipartite_soft_matching (line 16) | def bipartite_soft_matching( function merge_wavg (line 72) | def merge_wavg( class ToMe16_mlp_hd64 (line 91) | class ToMe16_mlp_hd64(nn.Module): method __init__ (line 92) | def __init__(self, config, vision_cfg): method merge_tokens (line 107) | def merge_tokens(self, x, target_num_token): method forward (line 143) | def forward(self, x, compress=False, local_num_frames=-1): method config (line 169) | def config(self): FILE: xtuner-eval_niah/llava/model/utils.py function auto_upgrade (line 4) | def auto_upgrade(config): FILE: xtuner-eval_niah/llava/serialize_utils.py function get_world_size (line 25) | def get_world_size() -> int: function get_rank (line 33) | def get_rank() -> int: function get_rank (line 40) | def get_rank() -> int: function get_local_rank (line 47) | def get_local_rank() -> int: function get_local_size (line 62) | def get_local_size() -> int: function _get_global_gloo_group (line 67) | def _get_global_gloo_group(): function all_gather (line 78) | def all_gather(data, group=None): class NumpySerializedList (line 105) | class NumpySerializedList: method __init__ (line 106) | def __init__(self, lst: list): method __len__ (line 122) | def __len__(self): method __getitem__ (line 125) | def __getitem__(self, idx): class TorchSerializedList (line 132) | class TorchSerializedList(NumpySerializedList): method __init__ (line 133) | def __init__(self, lst: list): method __getitem__ (line 138) | def __getitem__(self, idx): function local_scatter (line 145) | def local_scatter(array: Optional[List[Any]]): class TorchShmSerializedList (line 167) | class TorchShmSerializedList(TorchSerializedList): method __init__ (line 168) | def __init__(self, lst: list): function local_broadcast_process_authkey (line 194) | def local_broadcast_process_authkey(): FILE: xtuner-eval_niah/llava/train/llava_trainer.py function maybe_zero_3 (line 27) | def maybe_zero_3(param, ignore_status=False, name=None): function get_mm_adapter_state_maybe_zero_3 (line 42) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function split_to_even_chunks (line 48) | def split_to_even_chunks(indices, lengths, num_chunks): function get_variable_length_grouped_indices (line 70) | def get_variable_length_grouped_indices(lengths, batch_size, world_size,... function get_modality_length_grouped_indices (line 86) | def get_modality_length_grouped_indices(lengths, batch_size, world_size,... function get_length_grouped_indices (line 126) | def get_length_grouped_indices(lengths, batch_size, world_size, generato... function get_length_grouped_indices_auto_single (line 149) | def get_length_grouped_indices_auto_single(lengths, batch_size, world_si... function get_modality_length_grouped_indices_auto (line 164) | def get_modality_length_grouped_indices_auto(lengths, batch_size, world_... class LengthGroupedSampler (line 193) | class LengthGroupedSampler(Sampler): method __init__ (line 199) | def __init__( method __len__ (line 220) | def __len__(self): method __iter__ (line 223) | def __iter__(self): class LLaVATrainer (line 237) | class LLaVATrainer(Trainer): method create_accelerator_and_postprocess (line 239) | def create_accelerator_and_postprocess(self): method _get_train_sampler (line 270) | def _get_train_sampler(self) -> Optional[torch.utils.data.Sampler]: method get_train_dataloader (line 316) | def get_train_dataloader(self) -> DataLoader: method create_optimizer (line 353) | def create_optimizer(self): method _save_checkpoint (line 432) | def _save_checkpoint(self, model, trial, metrics=None): method _save (line 456) | def _save(self, output_dir: Optional[str] = None, state_dict=None): FILE: xtuner-eval_niah/llava/train/llava_trainer_eval.py class LLaVAEvalTrainer (line 7) | class LLaVAEvalTrainer(LLaVATrainer): method evaluate (line 8) | def evaluate(self, evaluate_args): FILE: xtuner-eval_niah/llava/train/train.py class ModelArguments (line 64) | class ModelArguments: class DataArguments (line 135) | class DataArguments: class TrainingArguments (line 159) | class TrainingArguments(transformers.TrainingArguments): function maybe_zero_3 (line 208) | def maybe_zero_3(param, ignore_status=False, name=None): function get_peft_state_maybe_zero_3 (line 224) | def get_peft_state_maybe_zero_3(named_params, bias): function get_peft_state_non_lora_maybe_zero_3 (line 249) | def get_peft_state_non_lora_maybe_zero_3(named_params, require_grad_only... function get_mm_adapter_state_maybe_zero_3 (line 257) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function find_all_linear_names (line 263) | def find_all_linear_names(model): function safe_save_model_for_hf_trainer (line 279) | def safe_save_model_for_hf_trainer(trainer: transformers.Trainer, output... function smart_tokenizer_and_embedding_resize (line 323) | def smart_tokenizer_and_embedding_resize( function _tokenize_fn (line 346) | def _tokenize_fn(strings: Sequence[str], tokenizer: transformers.PreTrai... function _mask_targets (line 368) | def _mask_targets(target, tokenized_lens, speakers): function _add_speaker_and_signal (line 379) | def _add_speaker_and_signal(header, source, get_conversation=True): function preprocess_multimodal (line 399) | def preprocess_multimodal(sources: Sequence[str], data_args: DataArgumen... function preprocess_llama_2 (line 431) | def preprocess_llama_2(sources, tokenizer: transformers.PreTrainedTokeni... function preprocess_gemma (line 506) | def preprocess_gemma(sources: List[List[Dict[str, str]]], tokenizer: tra... function preprocess_qwen (line 585) | def preprocess_qwen(sources, tokenizer: transformers.PreTrainedTokenizer... function preprocess_internlm2 (line 665) | def preprocess_internlm2(sources, tokenizer: transformers.PreTrainedToke... function preprocess_llama3 (line 742) | def preprocess_llama3( function preprocess_v1 (line 828) | def preprocess_v1(sources, tokenizer: transformers.PreTrainedTokenizer, ... function preprocess_mpt (line 907) | def preprocess_mpt(sources, tokenizer: transformers.PreTrainedTokenizer,... function preprocess_plain (line 988) | def preprocess_plain( function preprocess (line 1010) | def preprocess(sources: Sequence[str], tokenizer: transformers.PreTraine... class LazySupervisedDataset (line 1065) | class LazySupervisedDataset(Dataset): method __init__ (line 1066) | def __init__(self, data_path: str, tokenizer: transformers.PreTrainedT... method __len__ (line 1257) | def __len__(self): method lengths (line 1261) | def lengths(self): method modality_lengths (line 1274) | def modality_lengths(self): method process_image (line 1285) | def process_image(self, image_file, overwrite_image_aspect_ratio=None): method process_video (line 1344) | def process_video(self, video_file, data_anno, data_args): method __getitem__ (line 1413) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: method _get_item (line 1448) | def _get_item(self, i) -> Dict[str, torch.Tensor]: class DataCollatorForSupervisedDataset (line 1538) | class DataCollatorForSupervisedDataset(object): method pad_sequence (line 1543) | def pad_sequence(self, input_ids, batch_first, padding_value): method __call__ (line 1551) | def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]: function make_supervised_data_module (line 1588) | def make_supervised_data_module(tokenizer: transformers.PreTrainedTokeni... function get_model (line 1595) | def get_model(model_args, training_args, bnb_model_from_pretrained_args): function train (line 1814) | def train(attn_implementation=None): FILE: xtuner-eval_niah/llava/utils.py function process_video_with_decord (line 25) | def process_video_with_decord(video_file, data_args): function process_video_with_pyav (line 41) | def process_video_with_pyav(video_file, data_args): function rank0_print (line 66) | def rank0_print(*args): function rank_print (line 74) | def rank_print(*args): function build_logger (line 80) | def build_logger(logger_name, logger_filename): class StreamToLogger (line 122) | class StreamToLogger(object): method __init__ (line 127) | def __init__(self, logger, log_level=logging.INFO): method __getattr__ (line 133) | def __getattr__(self, attr): method write (line 136) | def write(self, buf): method flush (line 150) | def flush(self): function disable_torch_init (line 156) | def disable_torch_init(): function violates_moderation (line 166) | def violates_moderation(text): function pretty_print_semaphore (line 188) | def pretty_print_semaphore(semaphore): FILE: xtuner-eval_niah/llava/video_utils.py function get_index (line 18) | def get_index(num_frames, num_segments): function lazy_load_s3video (line 27) | def lazy_load_s3video(s3path_video, num_frames, video_start, video_end, ... function pts_to_secs (line 71) | def pts_to_secs(pts: int, time_base: float, start_pts: int) -> float: function get_pyav_video_duration (line 86) | def get_pyav_video_duration(video_reader): function get_frame_indices (line 97) | def get_frame_indices(num_frames, vlen, sample='middle', fix_start=None,... function read_frames_av (line 167) | def read_frames_av(video_path, num_frames, sample='rand', client=None, f... function read_frames_gif (line 196) | def read_frames_gif( function read_frames_decord (line 248) | def read_frames_decord( function read_frames_img (line 298) | def read_frames_img( function read_frames_fake (line 400) | def read_frames_fake( FILE: xtuner-eval_niah/longva/conversation.py class SeparatorStyle (line 11) | class SeparatorStyle(Enum): class Conversation (line 26) | class Conversation: method get_prompt (line 47) | def get_prompt(self): method append_message (line 178) | def append_message(self, role, message): method process_image (line 181) | def process_image(self, image, image_process_mode, return_pil=False, i... method get_images (line 227) | def get_images(self, return_pil=False, return_path=False): method to_gradio_chatbot (line 242) | def to_gradio_chatbot(self): method copy (line 266) | def copy(self): method dict (line 269) | def dict(self): FILE: xtuner-eval_niah/longva/mm_utils.py function resize_and_center_crop (line 12) | def resize_and_center_crop(image, shortest_edge_length): function auto_pad_images (line 33) | def auto_pad_images(image, grid_params): function extract_patches (line 63) | def extract_patches(image, patch_size, overlap_ratio): function process_highres_image_crop_split (line 87) | def process_highres_image_crop_split(image, data_args, processor=None): function process_highres_image (line 98) | def process_highres_image(image, processor, grid_pinpoints): function select_best_resolution (line 119) | def select_best_resolution(original_size, possible_resolutions): function resize_and_pad_image (line 152) | def resize_and_pad_image(image, target_resolution): function divide_to_patches (line 191) | def divide_to_patches(image, patch_size): function get_anyres_image_grid_shape (line 213) | def get_anyres_image_grid_shape(image_size, grid_pinpoints, patch_size): function process_anyres_image (line 243) | def process_anyres_image(image, processor, grid_pinpoints): function load_image_from_base64 (line 296) | def load_image_from_base64(image): function expand2square (line 300) | def expand2square(pil_img, background_color): function process_images (line 314) | def process_images(images, image_processor, model_cfg): function tokenizer_image_token (line 341) | def tokenizer_image_token(prompt, tokenizer, image_token_index=IMAGE_TOK... function get_model_name_from_path (line 363) | def get_model_name_from_path(model_path): class KeywordsStoppingCriteria (line 372) | class KeywordsStoppingCriteria(StoppingCriteria): method __init__ (line 373) | def __init__(self, keywords, tokenizer, input_ids): method __call__ (line 384) | def __call__(self, output_ids: torch.LongTensor, scores: torch.FloatTe... FILE: xtuner-eval_niah/longva/model/apply_delta.py function apply_delta (line 14) | def apply_delta(base_model_path, target_model_path, delta_path): FILE: xtuner-eval_niah/longva/model/builder.py function load_pretrained_model (line 27) | def load_pretrained_model(model_path, model_base, model_name, load_8bit=... FILE: xtuner-eval_niah/longva/model/consolidate.py function consolidate_ckpt (line 14) | def consolidate_ckpt(src_path, dst_path): FILE: xtuner-eval_niah/longva/model/language_model/llava_llama.py class LlavaConfig (line 35) | class LlavaConfig(LlamaConfig): class LlavaLlamaModel (line 44) | class LlavaLlamaModel(LlavaMetaModel, LlamaModel): method __init__ (line 47) | def __init__(self, config: LlamaConfig): class LlavaLlamaForCausalLM (line 51) | class LlavaLlamaForCausalLM(LlamaForCausalLM, LlavaMetaForCausalLM): method __init__ (line 54) | def __init__(self, config): method get_model (line 66) | def get_model(self): method forward (line 69) | def forward( method generate (line 123) | def generate( method prepare_inputs_for_generation (line 144) | def prepare_inputs_for_generation(self, input_ids, past_key_values=Non... FILE: xtuner-eval_niah/longva/model/language_model/llava_mistral.py class LlavaMistralConfig (line 30) | class LlavaMistralConfig(MistralConfig): class LlavaMistralModel (line 38) | class LlavaMistralModel(LlavaMetaModel, MistralModel): method __init__ (line 41) | def __init__(self, config: MistralConfig): class LlavaMistralForCausalLM (line 45) | class LlavaMistralForCausalLM(MistralForCausalLM, LlavaMetaForCausalLM): method __init__ (line 48) | def __init__(self, config): method get_model (line 59) | def get_model(self): method forward (line 62) | def forward( method generate (line 96) | def generate( method prepare_inputs_for_generation (line 115) | def prepare_inputs_for_generation(self, input_ids, past_key_values=Non... FILE: xtuner-eval_niah/longva/model/language_model/llava_mpt.py class LlavaMptConfig (line 24) | class LlavaMptConfig(MptConfig): class LlavaMptModel (line 28) | class LlavaMptModel(LlavaMetaModel, MptModel): method __init__ (line 31) | def __init__(self, config: MptConfig): method embed_tokens (line 35) | def embed_tokens(self, x): class LlavaMptForCausalLM (line 39) | class LlavaMptForCausalLM(MptForCausalLM, LlavaMetaForCausalLM): method __init__ (line 43) | def __init__(self, config): method get_model (line 61) | def get_model(self): method _set_gradient_checkpointing (line 64) | def _set_gradient_checkpointing(self, module, value=False): method forward (line 68) | def forward( method prepare_inputs_for_generation (line 97) | def prepare_inputs_for_generation(self, input_ids, past_key_values=Non... FILE: xtuner-eval_niah/longva/model/language_model/llava_qwen.py class LlavaQwenConfig (line 35) | class LlavaQwenConfig(Qwen2Config): class LlavaQwenModel (line 39) | class LlavaQwenModel(LlavaMetaModel, Qwen2Model): method __init__ (line 42) | def __init__(self, config: Qwen2Config): class LlavaQwenForCausalLM (line 46) | class LlavaQwenForCausalLM(Qwen2ForCausalLM, LlavaMetaForCausalLM): method __init__ (line 49) | def __init__(self, config): method get_model (line 60) | def get_model(self): method forward (line 63) | def forward( method generate (line 117) | def generate( method prepare_inputs_for_generation (line 137) | def prepare_inputs_for_generation(self, input_ids, past_key_values=Non... FILE: xtuner-eval_niah/longva/model/language_model/modeling_llama.py function _get_unpad_data (line 61) | def _get_unpad_data(attention_mask): class LlamaRMSNorm (line 73) | class LlamaRMSNorm(nn.Module): method __init__ (line 74) | def __init__(self, hidden_size, eps=1e-6): method forward (line 82) | def forward(self, hidden_states): class LlamaRotaryEmbedding (line 93) | class LlamaRotaryEmbedding(nn.Module): method __init__ (line 94) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method sin_cached (line 113) | def sin_cached(self): method cos_cached (line 118) | def cos_cached(self): method forward (line 123) | def forward(self, x, position_ids, seq_len=None): class LlamaLinearScalingRotaryEmbedding (line 142) | class LlamaLinearScalingRotaryEmbedding(LlamaRotaryEmbedding): method forward (line 145) | def forward(self, x, position_ids, seq_len=None): class LlamaDynamicNTKScalingRotaryEmbedding (line 152) | class LlamaDynamicNTKScalingRotaryEmbedding(LlamaRotaryEmbedding): method forward (line 155) | def forward(self, x, position_ids, seq_len=None): function rotate_half (line 167) | def rotate_half(x): function apply_rotary_pos_emb (line 174) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_di... class LlamaMLP (line 201) | class LlamaMLP(nn.Module): method __init__ (line 202) | def __init__(self, config): method forward (line 212) | def forward(self, x): function repeat_kv (line 231) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class LlamaAttention (line 243) | class LlamaAttention(nn.Module): method __init__ (line 246) | def __init__(self, config: LlamaConfig, layer_idx: Optional[int] = None): method _init_rope (line 276) | def _init_rope(self): method forward (line 303) | def forward( class LlamaRingFlashAttention2 (line 385) | class LlamaRingFlashAttention2(LlamaAttention): method __init__ (line 392) | def __init__(self, *args, **kwargs): method forward (line 400) | def forward( method _flash_attention_forward (line 478) | def _flash_attention_forward(self, query_states, key_states, value_sta... method _upad_input (line 535) | def _upad_input(self, query_layer, key_layer, value_layer, attention_m... class LlamaFlashAttention2 (line 566) | class LlamaFlashAttention2(LlamaAttention): method __init__ (line 573) | def __init__(self, *args, **kwargs): method forward (line 581) | def forward( method _flash_attention_forward (line 659) | def _flash_attention_forward(self, query_states, key_states, value_sta... method _upad_input (line 712) | def _upad_input(self, query_layer, key_layer, value_layer, attention_m... class LlamaSdpaAttention (line 743) | class LlamaSdpaAttention(LlamaAttention): method forward (line 751) | def forward( class LlamaDecoderLayer (line 841) | class LlamaDecoderLayer(nn.Module): method __init__ (line 842) | def __init__(self, config: LlamaConfig, layer_idx: int): method forward (line 852) | def forward( class LlamaPreTrainedModel (line 935) | class LlamaPreTrainedModel(PreTrainedModel): method _init_weights (line 945) | def _init_weights(self, module): method _setup_cache (line 956) | def _setup_cache(self, cache_cls, max_batch_size, max_cache_len: Optio... method _reset_cache (line 972) | def _reset_cache(self): class LlamaModel (line 1051) | class LlamaModel(LlamaPreTrainedModel): method __init__ (line 1059) | def __init__(self, config: LlamaConfig): method get_input_embeddings (line 1076) | def get_input_embeddings(self): method set_input_embeddings (line 1079) | def set_input_embeddings(self, value): method forward (line 1083) | def forward( method _update_causal_mask (line 1191) | def _update_causal_mask(self, attention_mask, input_tensor): class LlamaForCausalLM (line 1228) | class LlamaForCausalLM(LlamaPreTrainedModel): method __init__ (line 1231) | def __init__(self, config): method get_input_embeddings (line 1240) | def get_input_embeddings(self): method set_input_embeddings (line 1243) | def set_input_embeddings(self, value): method get_output_embeddings (line 1246) | def get_output_embeddings(self): method set_output_embeddings (line 1249) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 1252) | def set_decoder(self, decoder): method get_decoder (line 1255) | def get_decoder(self): method forward (line 1260) | def forward( method prepare_inputs_for_generation (line 1351) | def prepare_inputs_for_generation(self, input_ids, past_key_values=Non... method _reorder_cache (line 1423) | def _reorder_cache(past_key_values, beam_idx): class LlamaForSequenceClassification (line 1445) | class LlamaForSequenceClassification(LlamaPreTrainedModel): method __init__ (line 1446) | def __init__(self, config): method get_input_embeddings (line 1455) | def get_input_embeddings(self): method set_input_embeddings (line 1458) | def set_input_embeddings(self, value): method forward (line 1462) | def forward( class LlamaForQuestionAnswering (line 1560) | class LlamaForQuestionAnswering(LlamaPreTrainedModel): method __init__ (line 1564) | def __init__(self, config): method get_input_embeddings (line 1572) | def get_input_embeddings(self): method set_input_embeddings (line 1575) | def set_input_embeddings(self, value): method forward (line 1579) | def forward( FILE: xtuner-eval_niah/longva/model/llava_arch.py class LlavaMetaModel (line 34) | class LlavaMetaModel: method __init__ (line 36) | def __init__(self, config): method get_vision_tower (line 48) | def get_vision_tower(self): method initialize_vision_modules (line 54) | def initialize_vision_modules(self, model_args, fsdp=None): function unpad_image (line 119) | def unpad_image(tensor, original_size): class LlavaMetaForCausalLM (line 154) | class LlavaMetaForCausalLM(ABC): method get_model (line 157) | def get_model(self): method get_vision_tower (line 160) | def get_vision_tower(self): method get_2dPool (line 163) | def get_2dPool(self, image_feature): method encode_images (line 179) | def encode_images(self, images): method encode_multimodals (line 186) | def encode_multimodals(self, videos_or_images, video_idx_in_batch, spl... method prepare_inputs_labels_for_multimodal (line 199) | def prepare_inputs_labels_for_multimodal(self, input_ids, position_ids... method initialize_vision_tokenizer (line 409) | def initialize_vision_tokenizer(self, model_args, tokenizer): FILE: xtuner-eval_niah/longva/model/make_delta.py function make_delta (line 14) | def make_delta(base_model_path, target_model_path, delta_path, hub_repo_... FILE: xtuner-eval_niah/longva/model/multimodal_encoder/builder.py function build_vision_tower (line 9) | def build_vision_tower(vision_tower_cfg, **kwargs): FILE: xtuner-eval_niah/longva/model/multimodal_encoder/clip_encoder.py class CLIPVisionTower (line 12) | class CLIPVisionTower(nn.Module): method __init__ (line 13) | def __init__(self, vision_tower, args, delay_load=False): method load_model (line 35) | def load_model(self, device_map=None): method feature_select (line 46) | def feature_select(self, image_forward_outs): method forward (line 68) | def forward(self, images): method dummy_feature (line 82) | def dummy_feature(self): method dtype (line 86) | def dtype(self): method device (line 90) | def device(self): method config (line 94) | def config(self): method hidden_size (line 101) | def hidden_size(self): method num_patches_per_side (line 110) | def num_patches_per_side(self): method num_patches (line 114) | def num_patches(self): method image_size (line 121) | def image_size(self): class CLIPVisionTowerS2 (line 125) | class CLIPVisionTowerS2(CLIPVisionTower): method __init__ (line 126) | def __init__(self, vision_tower, args, delay_load=False): method load_model (line 141) | def load_model(self, device_map=None): method forward_feature (line 156) | def forward_feature(self, images): method forward (line 162) | def forward(self, images): method hidden_size (line 174) | def hidden_size(self): FILE: xtuner-eval_niah/longva/model/multimodal_projector/builder.py class IdentityMap (line 8) | class IdentityMap(nn.Module): method __init__ (line 9) | def __init__(self): method forward (line 12) | def forward(self, x, *args, **kwargs): method config (line 16) | def config(self): class SimpleResBlock (line 20) | class SimpleResBlock(nn.Module): method __init__ (line 21) | def __init__(self, channels): method forward (line 27) | def forward(self, x): function build_vision_projector (line 32) | def build_vision_projector(config, delay_load=False, **kwargs): FILE: xtuner-eval_niah/longva/model/multimodal_projector/pooler_projector.py class PoolerProjector (line 9) | class PoolerProjector(nn.Module): method __init__ (line 10) | def __init__(self, config, vision_cfg): method forward (line 22) | def forward(self, x, *args, **kwargs): method config (line 32) | def config(self): FILE: xtuner-eval_niah/longva/model/multimodal_resampler/builder.py class IdentityMap (line 9) | class IdentityMap(torch.nn.Module): method __init__ (line 10) | def __init__(self): method forward (line 13) | def forward(self, x, *args, **kwargs): method config (line 17) | def config(self): function build_vision_resampler (line 21) | def build_vision_resampler(model_args, delay_load=False, **kwargs): FILE: xtuner-eval_niah/longva/model/multimodal_resampler/masked_drop.py class MaskedDrop (line 7) | class MaskedDrop(nn.Module): method __init__ (line 8) | def __init__(self, model_args): method forward (line 17) | def forward(self, image_features, *args, **kwargs): method config (line 46) | def config(self): method random_masking (line 56) | def random_masking(self, x, len_keep): FILE: xtuner-eval_niah/longva/model/multimodal_resampler/perceiver.py function exists (line 16) | def exists(val): function FeedForward (line 20) | def FeedForward(dim, mult=4): class PerceiverAttention (line 30) | class PerceiverAttention(nn.Module): method __init__ (line 31) | def __init__(self, *, dim, dim_head=64, heads=8): method forward (line 44) | def forward(self, x, latents): class PerceiverResamplerModule (line 73) | class PerceiverResamplerModule(nn.Module): method __init__ (line 74) | def __init__( method forward (line 104) | def forward(self, x): class PerceiverResampler (line 130) | class PerceiverResampler(nn.Module): method __init__ (line 131) | def __init__(self, model_args, vision_tower): method forward (line 144) | def forward(self, image_features, *args, **kwargs): method config (line 148) | def config(self): FILE: xtuner-eval_niah/longva/model/multimodal_resampler/qformer.py function disabled_train (line 51) | def disabled_train(self, mode=True): class BertEmbeddings (line 57) | class BertEmbeddings(nn.Module): method __init__ (line 60) | def __init__(self, config): method forward (line 76) | def forward( class BertSelfAttention (line 107) | class BertSelfAttention(nn.Module): method __init__ (line 108) | def __init__(self, config, is_cross_attention): method save_attn_gradients (line 133) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 136) | def get_attn_gradients(self): method save_attention_map (line 139) | def save_attention_map(self, attention_map): method get_attention_map (line 142) | def get_attention_map(self): method transpose_for_scores (line 145) | def transpose_for_scores(self, x): method forward (line 153) | def forward( class BertSelfOutput (line 239) | class BertSelfOutput(nn.Module): method __init__ (line 240) | def __init__(self, config): method forward (line 246) | def forward(self, hidden_states, input_tensor): class BertAttention (line 253) | class BertAttention(nn.Module): method __init__ (line 254) | def __init__(self, config, is_cross_attention=False): method prune_heads (line 260) | def prune_heads(self, heads): method forward (line 281) | def forward( class BertIntermediate (line 306) | class BertIntermediate(nn.Module): method __init__ (line 307) | def __init__(self, config): method forward (line 315) | def forward(self, hidden_states): class BertOutput (line 321) | class BertOutput(nn.Module): method __init__ (line 322) | def __init__(self, config): method forward (line 328) | def forward(self, hidden_states, input_tensor): class BertLayer (line 335) | class BertLayer(nn.Module): method __init__ (line 336) | def __init__(self, config, layer_num): method forward (line 354) | def forward( method feed_forward_chunk (line 422) | def feed_forward_chunk(self, attention_output): method feed_forward_chunk_query (line 427) | def feed_forward_chunk_query(self, attention_output): class BertEncoder (line 433) | class BertEncoder(nn.Module): method __init__ (line 434) | def __init__(self, config): method forward (line 439) | def forward( class BertPooler (line 530) | class BertPooler(nn.Module): method __init__ (line 531) | def __init__(self, config): method forward (line 536) | def forward(self, hidden_states): class BertPredictionHeadTransform (line 545) | class BertPredictionHeadTransform(nn.Module): method __init__ (line 546) | def __init__(self, config): method forward (line 555) | def forward(self, hidden_states): class BertLMPredictionHead (line 562) | class BertLMPredictionHead(nn.Module): method __init__ (line 563) | def __init__(self, config): method forward (line 576) | def forward(self, hidden_states): class BertOnlyMLMHead (line 582) | class BertOnlyMLMHead(nn.Module): method __init__ (line 583) | def __init__(self, config): method forward (line 587) | def forward(self, sequence_output): class BertPreTrainedModel (line 592) | class BertPreTrainedModel(PreTrainedModel): method _init_weights (line 602) | def _init_weights(self, module): class BertModel (line 615) | class BertModel(BertPreTrainedModel): method __init__ (line 625) | def __init__(self, config, add_pooling_layer=False): method get_input_embeddings (line 637) | def get_input_embeddings(self): method set_input_embeddings (line 640) | def set_input_embeddings(self, value): method _prune_heads (line 643) | def _prune_heads(self, heads_to_prune): method get_extended_attention_mask (line 651) | def get_extended_attention_mask( method forward (line 731) | def forward( class BertLMHeadModel (line 865) | class BertLMHeadModel(BertPreTrainedModel): method __init__ (line 870) | def __init__(self, config): method get_output_embeddings (line 878) | def get_output_embeddings(self): method set_output_embeddings (line 881) | def set_output_embeddings(self, new_embeddings): method forward (line 884) | def forward( method prepare_inputs_for_generation (line 992) | def prepare_inputs_for_generation(self, input_ids, query_embeds, past=... method _reorder_cache (line 1013) | def _reorder_cache(self, past, beam_idx): class BertForMaskedLM (line 1020) | class BertForMaskedLM(BertPreTrainedModel): method __init__ (line 1025) | def __init__(self, config): method get_output_embeddings (line 1033) | def get_output_embeddings(self): method set_output_embeddings (line 1036) | def set_output_embeddings(self, new_embeddings): method forward (line 1039) | def forward( class Qformer (line 1102) | class Qformer(nn.Module): method __init__ (line 1103) | def __init__(self, model_args, vision_tower): method build_Qformer (line 1117) | def build_Qformer(self, vision_width, cross_attention_freq, num_query_... method forward (line 1135) | def forward(self, image_features, *args, **kwargs): method hidden_size (line 1150) | def hidden_size(self): method config (line 1154) | def config(self): FILE: xtuner-eval_niah/longva/model/multimodal_resampler/spatial_pool.py class SpatialPool (line 6) | class SpatialPool(nn.Module): method __init__ (line 7) | def __init__(self, model_args, vision_tower): method forward (line 23) | def forward(self, image_features, images, *args, **kwargs): method config (line 35) | def config(self): method hidden_size (line 44) | def hidden_size(self): FILE: xtuner-eval_niah/longva/model/utils.py function auto_upgrade (line 4) | def auto_upgrade(config): FILE: xtuner-eval_niah/longva/train/llama_flash_attn_monkey_patch.py function forward (line 16) | def forward( function _prepare_decoder_attention_mask (line 77) | def _prepare_decoder_attention_mask(self, attention_mask, input_shape, i... function replace_llama_attn_with_flash_attn (line 82) | def replace_llama_attn_with_flash_attn(): FILE: xtuner-eval_niah/longva/train/llava_trainer.py function maybe_zero_3 (line 30) | def maybe_zero_3(param, ignore_status=False, name=None): function get_mm_adapter_state_maybe_zero_3 (line 45) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function split_to_even_chunks (line 51) | def split_to_even_chunks(indices, lengths, num_chunks): function get_variable_length_grouped_indices (line 73) | def get_variable_length_grouped_indices(lengths, batch_size, world_size,... function get_modality_length_grouped_indices (line 89) | def get_modality_length_grouped_indices(lengths, batch_size, world_size,... function get_length_grouped_indices (line 129) | def get_length_grouped_indices(lengths, batch_size, world_size, generato... function get_length_grouped_indices_auto_single (line 152) | def get_length_grouped_indices_auto_single(lengths, batch_size, world_si... function get_modality_length_grouped_indices_auto (line 167) | def get_modality_length_grouped_indices_auto(lengths, batch_size, world_... class LengthGroupedSampler (line 196) | class LengthGroupedSampler(Sampler): method __init__ (line 202) | def __init__( method __len__ (line 223) | def __len__(self): method __iter__ (line 226) | def __iter__(self): class LLaVATrainer (line 240) | class LLaVATrainer(Trainer): method create_accelerator_and_postprocess (line 242) | def create_accelerator_and_postprocess(self): method _get_train_sampler (line 273) | def _get_train_sampler(self) -> Optional[torch.utils.data.Sampler]: method get_train_dataloader (line 319) | def get_train_dataloader(self) -> DataLoader: method create_optimizer (line 356) | def create_optimizer(self): method _save_checkpoint (line 435) | def _save_checkpoint(self, model, trial, metrics=None): method _save (line 459) | def _save(self, output_dir: Optional[str] = None, state_dict=None): class LLaVADPOTrainer (line 466) | class LLaVADPOTrainer(DPOTrainer): method _get_train_sampler (line 467) | def _get_train_sampler(self) -> Optional[torch.utils.data.Sampler]: method _save_checkpoint (line 483) | def _save_checkpoint(self, model, trial, metrics=None): method _save (line 523) | def _save(self, output_dir: Optional[str] = None, state_dict=None): FILE: xtuner-eval_niah/longva/train/train.py class ModelArguments (line 59) | class ModelArguments: class DataArguments (line 112) | class DataArguments: class TrainingArguments (line 128) | class TrainingArguments(transformers.TrainingArguments): function maybe_zero_3 (line 177) | def maybe_zero_3(param, ignore_status=False, name=None): function get_peft_state_maybe_zero_3 (line 193) | def get_peft_state_maybe_zero_3(named_params, bias): function get_peft_state_non_lora_maybe_zero_3 (line 218) | def get_peft_state_non_lora_maybe_zero_3(named_params, require_grad_only... function get_mm_adapter_state_maybe_zero_3 (line 226) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function find_all_linear_names (line 232) | def find_all_linear_names(model): function safe_save_model_for_hf_trainer (line 248) | def safe_save_model_for_hf_trainer(trainer: transformers.Trainer, output... function smart_tokenizer_and_embedding_resize (line 292) | def smart_tokenizer_and_embedding_resize( function _tokenize_fn (line 315) | def _tokenize_fn(strings: Sequence[str], tokenizer: transformers.PreTrai... function _mask_targets (line 337) | def _mask_targets(target, tokenized_lens, speakers): function _add_speaker_and_signal (line 348) | def _add_speaker_and_signal(header, source, get_conversation=True): function preprocess_multimodal (line 368) | def preprocess_multimodal(sources: Sequence[str], data_args: DataArgumen... function preprocess_llama_2 (line 396) | def preprocess_llama_2(sources, tokenizer: transformers.PreTrainedTokeni... function preprocess_gemma (line 471) | def preprocess_gemma(sources: List[List[Dict[str, str]]], tokenizer: tra... function preprocess_qwen (line 550) | def preprocess_qwen(sources, tokenizer: transformers.PreTrainedTokenizer... function preprocess_llama3 (line 605) | def preprocess_llama3( function preprocess_v1 (line 687) | def preprocess_v1(sources, tokenizer: transformers.PreTrainedTokenizer, ... function preprocess_mpt (line 766) | def preprocess_mpt(sources, tokenizer: transformers.PreTrainedTokenizer,... function preprocess_plain (line 847) | def preprocess_plain( function preprocess (line 869) | def preprocess(sources: Sequence[str], tokenizer: transformers.PreTraine... class LazySupervisedDataset (line 920) | class LazySupervisedDataset(Dataset): method __init__ (line 921) | def __init__(self, data_path: str, tokenizer: transformers.PreTrainedT... method __len__ (line 992) | def __len__(self): method lengths (line 996) | def lengths(self): method modality_lengths (line 1004) | def modality_lengths(self): method process_image (line 1012) | def process_image(self, image_file): method __getitem__ (line 1050) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: method _get_item (line 1083) | def _get_item(self, i) -> Dict[str, torch.Tensor]: class DataCollatorForSupervisedDataset (line 1184) | class DataCollatorForSupervisedDataset(object): method pad_sequence (line 1189) | def pad_sequence(self, input_ids, batch_first, padding_value): method __call__ (line 1197) | def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]: function make_supervised_data_module (line 1230) | def make_supervised_data_module(tokenizer: transformers.PreTrainedTokeni... function get_model (line 1237) | def get_model(model_args, training_args, bnb_model_from_pretrained_args): function train (line 1387) | def train(attn_implementation=None): FILE: xtuner-eval_niah/longva/train/train_dpo.py class ModelArguments (line 67) | class ModelArguments: class DataArguments (line 117) | class DataArguments: class TrainingArguments (line 135) | class TrainingArguments(transformers.TrainingArguments): function maybe_zero_3 (line 171) | def maybe_zero_3(param, ignore_status=False, name=None): function get_peft_state_maybe_zero_3 (line 187) | def get_peft_state_maybe_zero_3(named_params, bias): function get_peft_state_non_lora_maybe_zero_3 (line 212) | def get_peft_state_non_lora_maybe_zero_3(named_params, require_grad_only... function get_mm_adapter_state_maybe_zero_3 (line 220) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function find_all_linear_names (line 226) | def find_all_linear_names(model): function safe_save_model_for_hf_trainer (line 242) | def safe_save_model_for_hf_trainer(trainer: transformers.Trainer, output... function smart_tokenizer_and_embedding_resize (line 286) | def smart_tokenizer_and_embedding_resize( function _tokenize_fn (line 309) | def _tokenize_fn(strings: Sequence[str], tokenizer: transformers.PreTrai... function _mask_targets (line 331) | def _mask_targets(target, tokenized_lens, speakers): function _add_speaker_and_signal (line 342) | def _add_speaker_and_signal(header, source, get_conversation=True): function preprocess_multimodal (line 362) | def preprocess_multimodal(sources: Sequence[str], data_args: DataArgumen... function preprocess_multimodal_movie (line 383) | def preprocess_multimodal_movie(sources: Sequence[str], data_args: DataA... function preprocess_llama_2 (line 400) | def preprocess_llama_2(sources, tokenizer: transformers.PreTrainedTokeni... function make_conv (line 475) | def make_conv(prompt, answer): function preprocess_gemma (line 488) | def preprocess_gemma(sources: List[List[Dict[str, str]]], tokenizer: tra... function preprocess_qwen (line 567) | def preprocess_qwen(sources, tokenizer: transformers.PreTrainedTokenizer... function preprocess_llama3 (line 618) | def preprocess_llama3( function preprocess_v1 (line 667) | def preprocess_v1(sources, tokenizer: transformers.PreTrainedTokenizer, ... function preprocess_mpt (line 746) | def preprocess_mpt(sources, tokenizer: transformers.PreTrainedTokenizer,... function preprocess_plain (line 827) | def preprocess_plain( function preprocess (line 849) | def preprocess(sources: Sequence[str], tokenizer: transformers.PreTraine... function load_data (line 900) | def load_data(data_path): class DPODataset (line 908) | class DPODataset(Dataset): method __init__ (line 911) | def __init__(self, data_path: str, tokenizer: transformers.PreTrainedT... method __len__ (line 978) | def __len__(self): method lengths (line 982) | def lengths(self): method modality_lengths (line 993) | def modality_lengths(self): method process_image (line 1003) | def process_image(self, image_file): method __getitem__ (line 1041) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: method _get_item (line 1081) | def _get_item(self, i) -> Dict[str, torch.Tensor]: class DPODataCollator (line 1187) | class DPODataCollator(DPODataCollatorWithPadding): method collate (line 1192) | def collate(self, batch): method tokenize_batch_element (line 1239) | def tokenize_batch_element(self, prompt: str, chosen: str, rejected: s... method __call__ (line 1274) | def __call__(self, features: List[Dict[str, Any]]) -> Dict[str, Any]: function make_dpo_data_module (line 1308) | def make_dpo_data_module(tokenizer: transformers.PreTrainedTokenizer, da... function get_model (line 1314) | def get_model(model_args, training_args, bnb_model_from_pretrained_args): function train (line 1484) | def train(attn_implementation=None): FILE: xtuner-eval_niah/longva/utils.py function process_video_with_pyav (line 25) | def process_video_with_pyav(video_file, data_args): function rank0_print (line 49) | def rank0_print(*args): function build_logger (line 57) | def build_logger(logger_name, logger_filename): class StreamToLogger (line 99) | class StreamToLogger(object): method __init__ (line 104) | def __init__(self, logger, log_level=logging.INFO): method __getattr__ (line 110) | def __getattr__(self, attr): method write (line 113) | def write(self, buf): method flush (line 127) | def flush(self): function disable_torch_init (line 133) | def disable_torch_init(): function violates_moderation (line 143) | def violates_moderation(text): function pretty_print_semaphore (line 165) | def pretty_print_semaphore(semaphore): FILE: xtuner-eval_niah/vision_niah/multi_eval_vision_niah.py function safe_tokenize (line 67) | def safe_tokenize(tokenizer, text): function eval_forward (line 74) | def eval_forward(model, input_embeds, answer_embeds, pad_id, answer_ids,... function load_haystack (line 134) | def load_haystack(args): function load_text_embeddings (line 143) | def load_text_embeddings(str, tokenizer, model, replace_double_newline=F... function inference (line 164) | def inference(args): function plot (line 318) | def plot(args, all_accuries): function main (line 380) | def main(args): FILE: xtuner-eval_niah/vision_niah/multi_produce_needle_embedding.py function main (line 19) | def main(args): FILE: xtuner-eval_niah/vision_niah/produce_haystack_embedding.py function load_video_batches (line 12) | def load_video_batches(video_path, batch_size): function main (line 23) | def main(args): FILE: xtuner-eval_niah/vision_niah/single_eval_vision_niah.py function safe_tokenize (line 67) | def safe_tokenize(tokenizer, text): function eval_forward (line 74) | def eval_forward( model, input_embeds, answer_embeds, pad_id, answer_ids... function load_haystack (line 132) | def load_haystack(args): function load_text_embeddings (line 141) | def load_text_embeddings(str, tokenizer, model, replace_double_newline=F... function inference (line 162) | def inference(args): function plot (line 275) | def plot(args, all_accuries): function main (line 337) | def main(args): FILE: xtuner-eval_niah/vision_niah/single_produce_needle_embedding.py function main (line 18) | def main(args): FILE: xtuner-eval_niah/xtuner/_lite/__init__.py function get_logger (line 11) | def get_logger(): FILE: xtuner-eval_niah/xtuner/_lite/accelerate/dispatches/__init__.py function _dispatch_forward_fn (line 9) | def _dispatch_forward_fn(module, dispatch_fn): function dispatch_internlm_varlen_attn_forward (line 13) | def dispatch_internlm_varlen_attn_forward(module): function dispatch_llama_varlen_attn_forward (line 20) | def dispatch_llama_varlen_attn_forward(module): function dispatch_qwen2_varlen_attn_forward (line 27) | def dispatch_qwen2_varlen_attn_forward(module): function dispatch_clip_attn_forward (line 34) | def dispatch_clip_attn_forward(module): function dispatch_rms_norm_forward (line 41) | def dispatch_rms_norm_forward(module): function dispatch_internlm_mla_varlen_attn_forward (line 47) | def dispatch_internlm_mla_varlen_attn_forward(module): function dispatch_modules (line 66) | def dispatch_modules(model, use_varlen_attn=False): FILE: xtuner-eval_niah/xtuner/_lite/accelerate/dispatches/_attention.py function _get_unpad_data (line 17) | def _get_unpad_data(attention_mask): function upad_qkv (line 30) | def upad_qkv(query_layer, key_layer, value_layer, attention_mask, function flash_attn_wo_mask (line 75) | def flash_attn_wo_mask( function flash_attn_w_mask (line 96) | def flash_attn_w_mask( function varlen_flash_attn (line 128) | def varlen_flash_attn( FILE: xtuner-eval_niah/xtuner/_lite/accelerate/dispatches/_fused/layer_norm.py function layer_norm_forward (line 6) | def layer_norm_forward(self, hidden_states): FILE: xtuner-eval_niah/xtuner/_lite/accelerate/dispatches/_fused/rms_norm.py function rms_norm_forward (line 14) | def rms_norm_forward(self, hidden_states): FILE: xtuner-eval_niah/xtuner/_lite/accelerate/dispatches/_fused/rotary.py function rotary_kernel (line 11) | def rotary_kernel( function apply_rotary (line 163) | def apply_rotary( class ApplyRotaryEmb (line 265) | class ApplyRotaryEmb(torch.autograd.Function): method forward (line 268) | def forward( method backward (line 302) | def backward(ctx, do): FILE: xtuner-eval_niah/xtuner/_lite/accelerate/dispatches/clip.py function clip_flash_attn_forward (line 11) | def clip_flash_attn_forward( FILE: xtuner-eval_niah/xtuner/_lite/accelerate/dispatches/internlm2.py class InternLM2RotaryEmbedding (line 22) | class InternLM2RotaryEmbedding(torch.nn.Module): method __init__ (line 24) | def __init__(self, method forward (line 47) | def forward(self, x, seq_len): function rotate_half (line 68) | def rotate_half(x): function apply_rotary_pos_emb (line 75) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_di... function apply_rotary_pos_emb_mla (line 83) | def apply_rotary_pos_emb_mla(q, k, cos, sin, position_ids=None, unsqueez... function repeat_kv (line 113) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: function repeat_kv_bshd (line 131) | def repeat_kv_bshd(hidden_states: torch.Tensor, n_rep: int) -> torch.Ten... function _internlm2_varlen_attn_forward (line 145) | def _internlm2_varlen_attn_forward( function internlm2_attn_forward_inference (line 324) | def internlm2_attn_forward_inference( function internlm2_varlen_attn_forward (line 451) | def internlm2_varlen_attn_forward( function _internlm2_mla_varlen_attn_forward (line 478) | def _internlm2_mla_varlen_attn_forward( function internlm2_mla_varlen_attn_forward (line 596) | def internlm2_mla_varlen_attn_forward( FILE: xtuner-eval_niah/xtuner/_lite/accelerate/dispatches/llama.py class Cache (line 15) | class Cache: function repeat_kv_bshd (line 19) | def repeat_kv_bshd(hidden_states: torch.Tensor, n_rep: int) -> torch.Ten... function llama_varlen_attn_forward (line 33) | def llama_varlen_attn_forward( FILE: xtuner-eval_niah/xtuner/_lite/accelerate/dispatches/qwen2.py function qwen2_attn_forward_inference (line 32) | def qwen2_attn_forward_inference( function qwen2_varlen_attn_forward (line 148) | def qwen2_varlen_attn_forward( FILE: xtuner-eval_niah/xtuner/_lite/accelerate/packed.py function packed_sequence (line 9) | def packed_sequence(num_tokens, enable=False, sp_size=1): FILE: xtuner-eval_niah/xtuner/_lite/auto.py function download_model_from_hub (line 20) | def download_model_from_hub( class AutoModelForCausalLM (line 64) | class AutoModelForCausalLM: method from_config (line 91) | def from_config(cls, method from_pretrained (line 102) | def from_pretrained( method _flash_attn_kwargs (line 139) | def _flash_attn_kwargs(config: PretrainedConfig) -> dict: method _long_ctx_kwargs (line 162) | def _long_ctx_kwargs(config: PretrainedConfig, FILE: xtuner-eval_niah/xtuner/_lite/chat/messages/base.py class BaseMessages (line 10) | class BaseMessages(BaseModel): method add (line 13) | def add(self, role: str, content): method pop (line 17) | def pop(self): method get_prompt (line 21) | def get_prompt(self, chat_template: ChatTemplate) -> str: method tokenize (line 25) | def tokenize(self, tokenizer: PreTrainedTokenizer, method from_dict (line 30) | def from_dict(cls, item: Dict) -> 'BaseMessages': FILE: xtuner-eval_niah/xtuner/_lite/chat/messages/chat.py class TextContentItem (line 15) | class TextContentItem(BaseModel): method apply_chat_template (line 19) | def apply_chat_template(self, chat_template: HybridChatTemplate) -> str: class ImageContentItem (line 23) | class ImageContentItem(BaseModel): method apply_chat_template (line 27) | def apply_chat_template(self, chat_template: HybridChatTemplate) -> str: class ChatMsg (line 35) | class ChatMsg(BaseModel): method __init__ (line 41) | def __init__(self, *args, **kwargs): method collect_img_urls (line 53) | def collect_img_urls(self) -> List[str]: method get_prompt (line 61) | def get_prompt(self, chat_template: ChatTemplate) -> str: method tokenize (line 86) | def tokenize( class ChatMessages (line 107) | class ChatMessages(BaseMessages): method add (line 111) | def add(self, role, content, loss=False): method pop (line 114) | def pop(self): method get_prompt (line 117) | def get_prompt(self, chat_template: ChatTemplate) -> str: method tokenize (line 127) | def tokenize(self, tokenizer: PreTrainedTokenizer, method from_str (line 169) | def from_str(cls, prompt: str) -> 'ChatMessages': method from_dict (line 175) | def from_dict(cls, item: dict) -> 'ChatMessages': FILE: xtuner-eval_niah/xtuner/_lite/chat/templates/chat.py class ChatTemplate (line 6) | class ChatTemplate(BaseModel): method decorate_system (line 18) | def decorate_system(self, text: str) -> str: method decorate_assistant (line 22) | def decorate_assistant(self, text: str) -> str: method decorate_user (line 26) | def decorate_user(self, text: str) -> str: method check_system (line 31) | def check_system(cls, v: str) -> str: method check_user (line 41) | def check_user(cls, v: str) -> str: method check_assistant (line 51) | def check_assistant(cls, v: str) -> str: FILE: xtuner-eval_niah/xtuner/_lite/chat/templates/hybrid.py class HybridChatTemplate (line 6) | class HybridChatTemplate(BaseModel): method mm_token_maps (line 42) | def mm_token_maps(self) -> Dict[str, int]: method decorate_system (line 47) | def decorate_system(self, text: str) -> str: method decorate_assistant (line 51) | def decorate_assistant(self, text: str) -> str: method decorate_user (line 55) | def decorate_user(self, text: str) -> str: method decorate_files (line 59) | def decorate_files(self, text: str) -> str: method decorate_functions (line 63) | def decorate_functions(self, text: str) -> str: method decorate_function_call (line 67) | def decorate_function_call(self, text: str, func: str) -> str: method decorate_function_result (line 71) | def decorate_function_result(self, text: str) -> str: method decorate_code_interpreter (line 75) | def decorate_code_interpreter(self, text: str) -> str: method decorate_code_interpreter_call (line 79) | def decorate_code_interpreter_call(self, text: str, func: str) -> str: method decorate_code_interpreter_result (line 84) | def decorate_code_interpreter_result(self, text: str) -> str: method check_system (line 90) | def check_system(cls, v: str) -> str: method check_user (line 100) | def check_user(cls, v: str) -> str: method check_assistant (line 110) | def check_assistant(cls, v: str) -> str: method check_function_call (line 121) | def check_function_call(cls, v: str) -> str: method check_function_result (line 137) | def check_function_result(cls, v: str) -> str: method check_functions (line 148) | def check_functions(cls, v: str) -> str: method check_code_interpreter (line 159) | def check_code_interpreter(cls, v: str) -> str: method check_code_interpreter_call (line 170) | def check_code_interpreter_call(cls, v: str) -> str: method check_code_interpreter_result (line 186) | def check_code_interpreter_result(cls, v: str) -> str: FILE: xtuner-eval_niah/xtuner/_lite/datasets/cache.py class CacheDataset (line 4) | class CacheDataset(torch.utils.data.Dataset): method cached_dir (line 7) | def cached_dir(self): method cached (line 11) | def cached(self): method cache (line 14) | def cache(self, cache_dir): method load_cache (line 17) | def load_cache(self): method from_cache (line 21) | def from_cache(self, cache_dir): FILE: xtuner-eval_niah/xtuner/_lite/datasets/format.py class Alpaca2Openai (line 4) | class Alpaca2Openai(): method source_format (line 7) | def source_format(cls): method target_format (line 16) | def target_format(cls): method convert (line 32) | def convert(data): function llava_to_openai (line 50) | def llava_to_openai(data): function llava_to_openai_interleave (line 101) | def llava_to_openai_interleave(data): FILE: xtuner-eval_niah/xtuner/_lite/datasets/llava.py class LlavaTokenizeFunction (line 16) | class LlavaTokenizeFunction(): method __init__ (line 18) | def __init__(self, method __call__ (line 31) | def __call__(self, item): class LlavaTokenizedDataset (line 58) | class LlavaTokenizedDataset(TextTokenizedDataset): method __init__ (line 60) | def __init__(self, dataset, image_processor, max_length): method process_tokenized_data (line 64) | def process_tokenized_data(self, tokenized_data): method from_cache (line 87) | def from_cache(cls, cache_dir, image_processor, max_length): method __getitem__ (line 93) | def __getitem__(self, item): class LlavaRawDataset (line 112) | class LlavaRawDataset(torch.utils.data.Dataset): method __init__ (line 114) | def __init__(self, dataset, image_processor, max_length, tokenize_fn): method process_tokenized_data (line 122) | def process_tokenized_data(self, tokenized_data): method __getitem__ (line 144) | def __getitem__(self, item): class SoftPackerForLlava (line 151) | class SoftPackerForLlava(SoftPackerForText): method __init__ (line 153) | def __init__(self, method __getitem__ (line 161) | def __getitem__(self, item): method from_cache (line 230) | def from_cache(cls, cache_dir, image_processor, max_length): class LlavaCollator (line 245) | class LlavaCollator(): method __init__ (line 247) | def __init__(self, pack_batch=False): method __call__ (line 250) | def __call__(self, instances): FILE: xtuner-eval_niah/xtuner/_lite/datasets/load.py function load_json (line 22) | def load_json(file): function load_jsonl (line 28) | def load_jsonl(file): function load_bin (line 39) | def load_bin(file): function master_only_load (line 46) | def master_only_load(load_fn): function multi_thread_map (line 75) | def multi_thread_map(map_fns, dataset, desc, num_proc=8): function openai_format (line 95) | def openai_format(item): function load_hf_dataset (line 102) | def load_hf_dataset(path, function load_from_cache (line 133) | def load_from_cache(cache_dir, init_fn): function _gpu_parallel_load_local_datasets (line 174) | def _gpu_parallel_load_local_datasets(paths, function _cpu_parallel_load_local_datasets (line 361) | def _cpu_parallel_load_local_datasets(paths, function load_local_datasets (line 579) | def load_local_datasets(paths, function load_datasets (line 601) | def load_datasets(paths, function load_ms_dataset (line 721) | def load_ms_dataset(): FILE: xtuner-eval_niah/xtuner/_lite/datasets/pretrain.py class SoftPackerForPretrain (line 7) | class SoftPackerForPretrain(SoftPackerForText): method __getitem__ (line 9) | def __getitem__(self, item): FILE: xtuner-eval_niah/xtuner/_lite/datasets/text.py function sort_and_return_indices (line 21) | def sort_and_return_indices(lst): class TextTokenizeFunction (line 25) | class TextTokenizeFunction(): method __init__ (line 27) | def __init__(self, tokenizer, chat_template, raw_format='openai'): method __call__ (line 33) | def __call__(self, item): class TextTokenizedDataset (line 41) | class TextTokenizedDataset(CacheDataset): method __init__ (line 43) | def __init__(self, dataset, max_length): method cached (line 58) | def cached(self): method cached_dir (line 62) | def cached_dir(self): method cache (line 65) | def cache(self, cache_dir): method load_cache (line 76) | def load_cache(self): method from_cache (line 82) | def from_cache(cls, cache_dir, max_length): method _free (line 88) | def _free(self): method __len__ (line 91) | def __len__(self): method __getitem__ (line 94) | def __getitem__(self, item): class TextOnlineTokenizeDataset (line 119) | class TextOnlineTokenizeDataset(torch.utils.data.Dataset): method __init__ (line 121) | def __init__(self, dataset, tokenize_fn): method __len__ (line 127) | def __len__(self): method __getitem__ (line 130) | def __getitem__(self, item): class SoftPackerForText (line 151) | class SoftPackerForText(CacheDataset): method __init__ (line 153) | def __init__(self, dataset, max_length=2048, pack_info=None, seed=None): method max_length_per_pack (line 176) | def max_length_per_pack(self): method cached (line 184) | def cached(self): method cached_dir (line 188) | def cached_dir(self): method cache (line 191) | def cache(self, cache_dir): method load_cache (line 208) | def load_cache(self): method _free (line 216) | def _free(self): method __len__ (line 220) | def __len__(self): method __getitem__ (line 223) | def __getitem__(self, item): method get_pack_info (line 286) | def get_pack_info(cls, dataset, max_length, seed=None): method from_cache (line 326) | def from_cache(cls, cache_dir, max_length, seed=None): class HardPackerForText (line 342) | class HardPackerForText(SoftPackerForText): method __init__ (line 361) | def __init__(self, dataset, max_length=2048, pack_info=None): method _cal_max_length (line 367) | def _cal_max_length(cls, begin, end, shfl_item_rngs_left, method get_pack_info (line 382) | def get_pack_info(cls, dataset, max_length, seed=None): method _pack_ids_and_labels_in_range (line 426) | def _pack_ids_and_labels_in_range(self, begin: int, end: int): method __len__ (line 471) | def __len__(self): method __getitem__ (line 474) | def __getitem__(self, item): class TextCollator (line 502) | class TextCollator: method __init__ (line 504) | def __init__(self, pack_batch=False, force_div_ring=False, ring_size=1... method __call__ (line 512) | def __call__(self, instances): FILE: xtuner-eval_niah/xtuner/_lite/modelings/__init__.py function register_remote_code (line 6) | def register_remote_code(): FILE: xtuner-eval_niah/xtuner/_lite/modelings/internlm2/configuration_internlm2.py class InternLM2Config (line 27) | class InternLM2Config(PretrainedConfig): method __init__ (line 94) | def __init__( # pylint: disable=W0102 method _rope_scaling_validation (line 150) | def _rope_scaling_validation(self): FILE: xtuner-eval_niah/xtuner/_lite/modelings/internlm2/modeling_internlm2.py function _get_unpad_data (line 62) | def _get_unpad_data(attention_mask): class InternLM2RMSNorm (line 75) | class InternLM2RMSNorm(nn.Module): method __init__ (line 78) | def __init__(self, hidden_size, eps=1e-6): method forward (line 83) | def forward(self, hidden_states): class InternLM2RotaryEmbedding (line 95) | class InternLM2RotaryEmbedding(nn.Module): method __init__ (line 98) | def __init__(self, method forward (line 118) | def forward(self, x, position_ids): class InternLM2LinearScalingRotaryEmbedding (line 137) | class InternLM2LinearScalingRotaryEmbedding(InternLM2RotaryEmbedding): method forward (line 140) | def forward(self, x, position_ids): class InternLM2DynamicNTKScalingRotaryEmbedding (line 147) | class InternLM2DynamicNTKScalingRotaryEmbedding(InternLM2RotaryEmbedding): method forward (line 151) | def forward(self, x, position_ids): function rotate_half (line 171) | def rotate_half(x): function apply_rotary_pos_emb (line 178) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_di... class InternLM2MLP (line 204) | class InternLM2MLP(nn.Module): method __init__ (line 207) | def __init__(self, config): method forward (line 220) | def forward(self, x): function repeat_kv (line 226) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class InternLM2Attention (line 242) | class InternLM2Attention(nn.Module): method __init__ (line 245) | def __init__(self, method _init_rope (line 281) | def _init_rope(self): method forward (line 308) | def forward( class InternLM2FlashAttention2 (line 405) | class InternLM2FlashAttention2(InternLM2Attention): method __init__ (line 412) | def __init__(self, *args, **kwargs): method forward (line 424) | def forward( method _flash_attention_forward (line 529) | def _flash_attention_forward(self, method _upad_input (line 598) | def _upad_input(self, query_layer, key_layer, value_layer, attention_m... class InternLM2SdpaAttention (line 641) | class InternLM2SdpaAttention(InternLM2Attention): method forward (line 649) | def forward( class InternLM2DecoderLayer (line 757) | class InternLM2DecoderLayer(nn.Module): method __init__ (line 760) | def __init__(self, config: InternLM2Config, layer_idx: int): method forward (line 775) | def forward( class InternLM2PreTrainedModel (line 853) | class InternLM2PreTrainedModel(PreTrainedModel): method _init_weights (line 869) | def _init_weights(self, module): class InternLM2Model (line 948) | class InternLM2Model(InternLM2PreTrainedModel): method __init__ (line 957) | def __init__(self, config: InternLM2Config): method get_input_embeddings (line 978) | def get_input_embeddings(self): method set_input_embeddings (line 981) | def set_input_embeddings(self, value): method forward (line 985) | def forward( method _update_causal_mask (line 1106) | def _update_causal_mask( class InternLM2ForCausalLM (line 1199) | class InternLM2ForCausalLM(InternLM2PreTrainedModel): method __init__ (line 1205) | def __init__(self, config): method get_input_embeddings (line 1215) | def get_input_embeddings(self): method set_input_embeddings (line 1218) | def set_input_embeddings(self, value): method get_output_embeddings (line 1221) | def get_output_embeddings(self): method set_output_embeddings (line 1224) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 1227) | def set_decoder(self, decoder): method get_decoder (line 1230) | def get_decoder(self): method forward (line 1236) | def forward( method prepare_inputs_for_generation (line 1329) | def prepare_inputs_for_generation( method _reorder_cache (line 1413) | def _reorder_cache(past_key_values, beam_idx): method build_inputs (line 1421) | def build_inputs(self, method chat (line 1440) | def chat( method stream_chat (line 1487) | def stream_chat( class InternLM2ForSequenceClassification (line 1594) | class InternLM2ForSequenceClassification(InternLM2PreTrainedModel): method __init__ (line 1597) | def __init__(self, config): method get_input_embeddings (line 1606) | def get_input_embeddings(self): method set_input_embeddings (line 1609) | def set_input_embeddings(self, value): method forward (line 1613) | def forward( class InternLM2ForQuestionAnswering (line 1719) | class InternLM2ForQuestionAnswering(InternLM2PreTrainedModel): method __init__ (line 1724) | def __init__(self, config): method get_input_embeddings (line 1732) | def get_input_embeddings(self): method set_input_embeddings (line 1735) | def set_input_embeddings(self, value): method forward (line 1739) | def forward( class InternLM2ForTokenClassification (line 1823) | class InternLM2ForTokenClassification(InternLM2PreTrainedModel): method __init__ (line 1826) | def __init__(self, config): method get_input_embeddings (line 1842) | def get_input_embeddings(self): method set_input_embeddings (line 1845) | def set_input_embeddings(self, value): method forward (line 1849) | def forward( FILE: xtuner-eval_niah/xtuner/_lite/modelings/llava/configuration_internlm2.py class InternLM2Config (line 27) | class InternLM2Config(PretrainedConfig): method __init__ (line 94) | def __init__( # pylint: disable=W0102 method _rope_scaling_validation (line 150) | def _rope_scaling_validation(self): FILE: xtuner-eval_niah/xtuner/_lite/modelings/llava/configuration_llava.py class EnhancedLlavaConfig (line 23) | class EnhancedLlavaConfig(PretrainedConfig): method __init__ (line 76) | def __init__( method save_pretrained (line 143) | def save_pretrained(self, save_directory: Union[str, os.PathLike], pus... FILE: xtuner-eval_niah/xtuner/_lite/modelings/llava/modeling_internlm2.py function _get_unpad_data (line 62) | def _get_unpad_data(attention_mask): class InternLM2RMSNorm (line 75) | class InternLM2RMSNorm(nn.Module): method __init__ (line 78) | def __init__(self, hidden_size, eps=1e-6): method forward (line 83) | def forward(self, hidden_states): class InternLM2RotaryEmbedding (line 95) | class InternLM2RotaryEmbedding(nn.Module): method __init__ (line 98) | def __init__(self, method forward (line 118) | def forward(self, x, position_ids): class InternLM2LinearScalingRotaryEmbedding (line 137) | class InternLM2LinearScalingRotaryEmbedding(InternLM2RotaryEmbedding): method forward (line 140) | def forward(self, x, position_ids): class InternLM2DynamicNTKScalingRotaryEmbedding (line 147) | class InternLM2DynamicNTKScalingRotaryEmbedding(InternLM2RotaryEmbedding): method forward (line 151) | def forward(self, x, position_ids): function rotate_half (line 171) | def rotate_half(x): function apply_rotary_pos_emb (line 178) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_di... class InternLM2MLP (line 204) | class InternLM2MLP(nn.Module): method __init__ (line 207) | def __init__(self, config): method forward (line 220) | def forward(self, x): function repeat_kv (line 226) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class InternLM2Attention (line 242) | class InternLM2Attention(nn.Module): method __init__ (line 245) | def __init__(self, method _init_rope (line 281) | def _init_rope(self): method forward (line 308) | def forward( class InternLM2FlashAttention2 (line 405) | class InternLM2FlashAttention2(InternLM2Attention): method __init__ (line 412) | def __init__(self, *args, **kwargs): method forward (line 424) | def forward( method _flash_attention_forward (line 529) | def _flash_attention_forward(self, method _upad_input (line 598) | def _upad_input(self, query_layer, key_layer, value_layer, attention_m... class InternLM2SdpaAttention (line 641) | class InternLM2SdpaAttention(InternLM2Attention): method forward (line 649) | def forward( class InternLM2DecoderLayer (line 757) | class InternLM2DecoderLayer(nn.Module): method __init__ (line 760) | def __init__(self, config: InternLM2Config, layer_idx: int): method forward (line 775) | def forward( class InternLM2PreTrainedModel (line 853) | class InternLM2PreTrainedModel(PreTrainedModel): method _init_weights (line 869) | def _init_weights(self, module): class InternLM2Model (line 948) | class InternLM2Model(InternLM2PreTrainedModel): method __init__ (line 957) | def __init__(self, config: InternLM2Config): method get_input_embeddings (line 978) | def get_input_embeddings(self): method set_input_embeddings (line 981) | def set_input_embeddings(self, value): method forward (line 985) | def forward( method _update_causal_mask (line 1106) | def _update_causal_mask( class InternLM2ForCausalLM (line 1199) | class InternLM2ForCausalLM(InternLM2PreTrainedModel): method __init__ (line 1205) | def __init__(self, config): method get_input_embeddings (line 1215) | def get_input_embeddings(self): method set_input_embeddings (line 1218) | def set_input_embeddings(self, value): method get_output_embeddings (line 1221) | def get_output_embeddings(self): method set_output_embeddings (line 1224) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 1227) | def set_decoder(self, decoder): method get_decoder (line 1230) | def get_decoder(self): method forward (line 1236) | def forward( method prepare_inputs_for_generation (line 1329) | def prepare_inputs_for_generation( method _reorder_cache (line 1413) | def _reorder_cache(past_key_values, beam_idx): method build_inputs (line 1421) | def build_inputs(self, method chat (line 1440) | def chat( method stream_chat (line 1487) | def stream_chat( class InternLM2ForSequenceClassification (line 1594) | class InternLM2ForSequenceClassification(InternLM2PreTrainedModel): method __init__ (line 1597) | def __init__(self, config): method get_input_embeddings (line 1606) | def get_input_embeddings(self): method set_input_embeddings (line 1609) | def set_input_embeddings(self, value): method forward (line 1613) | def forward( class InternLM2ForQuestionAnswering (line 1719) | class InternLM2ForQuestionAnswering(InternLM2PreTrainedModel): method __init__ (line 1724) | def __init__(self, config): method get_input_embeddings (line 1732) | def get_input_embeddings(self): method set_input_embeddings (line 1735) | def set_input_embeddings(self, value): method forward (line 1739) | def forward( class InternLM2ForTokenClassification (line 1823) | class InternLM2ForTokenClassification(InternLM2PreTrainedModel): method __init__ (line 1826) | def __init__(self, config): method get_input_embeddings (line 1842) | def get_input_embeddings(self): method set_input_embeddings (line 1845) | def set_input_embeddings(self, value): method forward (line 1849) | def forward( FILE: xtuner-eval_niah/xtuner/_lite/modelings/llava/modeling_llava.py class LlavaCausalLMOutputWithPast (line 46) | class LlavaCausalLMOutputWithPast(ModelOutput): class LlavaMultiModalProjector (line 87) | class LlavaMultiModalProjector(nn.Module): method __init__ (line 88) | def __init__(self, config: EnhancedLlavaConfig): method forward (line 95) | def forward(self, image_features): class LlavaPreTrainedModel (line 123) | class LlavaPreTrainedModel(PreTrainedModel): method _init_weights (line 131) | def _init_weights(self, module): method _supports_sdpa (line 154) | def _supports_sdpa(self): class LlavaForConditionalGeneration (line 237) | class LlavaForConditionalGeneration(LlavaPreTrainedModel): method __init__ (line 241) | def __init__(self, config: EnhancedLlavaConfig): method get_input_embeddings (line 253) | def get_input_embeddings(self): method set_input_embeddings (line 256) | def set_input_embeddings(self, value): method get_output_embeddings (line 259) | def get_output_embeddings(self): method set_output_embeddings (line 262) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 265) | def set_decoder(self, decoder): method get_decoder (line 268) | def get_decoder(self): method tie_weights (line 271) | def tie_weights(self): method resize_token_embeddings (line 274) | def resize_token_embeddings(self, new_num_tokens: Optional[int] = None... method _merge_input_ids_with_image_features (line 281) | def _merge_input_ids_with_image_features(self, image_features, inputs_... method forward (line 360) | def forward( method prepare_inputs_for_generation (line 516) | def prepare_inputs_for_generation( method _reorder_cache (line 569) | def _reorder_cache(self, *args, **kwargs): FILE: xtuner-eval_niah/xtuner/_lite/modelings/llava/processing_llava.py class LlavaProcessor (line 28) | class LlavaProcessor(ProcessorMixin): method __init__ (line 49) | def __init__(self, image_processor=None, tokenizer=None, chat_template... method __call__ (line 52) | def __call__( method batch_decode (line 117) | def batch_decode(self, *args, **kwargs): method decode (line 125) | def decode(self, *args, **kwargs): method model_input_names (line 134) | def model_input_names(self): FILE: xtuner-eval_niah/xtuner/_lite/parallel/comm.py function _all_to_all (line 13) | def _all_to_all( class _AllToAll (line 29) | class _AllToAll(torch.autograd.Function): method forward (line 40) | def forward(ctx: Any, input: Tensor, sp_group: dist.ProcessGroup, method backward (line 51) | def backward(ctx: Any, grad_output: Tensor) -> Tuple: function all_to_all (line 67) | def all_to_all( function all_to_all_list (line 94) | def all_to_all_list(object_list, group=None): FILE: xtuner-eval_niah/xtuner/_lite/parallel/fsdp/checkpointing.py function checkpoint_check_fn (line 7) | def checkpoint_check_fn(submodule, target=RECOMPUTE_MODULES, selective=1... FILE: xtuner-eval_niah/xtuner/_lite/parallel/fsdp/lazy.py function dp_lazy_init (line 7) | def dp_lazy_init(module, module_map, dp_mesh): function dp_sp_lazy_init (line 35) | def dp_sp_lazy_init(module, module_map, dp_mesh, sp_mesh): function dp_tp_lazy_init (line 61) | def dp_tp_lazy_init(module, module_map, dp_mesh, tp_mesh): class LoadWoInit (line 139) | class LoadWoInit: method __init__ (line 142) | def __init__(self): method __enter__ (line 151) | def __enter__(self, *args, **kwargs): method __exit__ (line 160) | def __exit__(self, *args, **kwargs): FILE: xtuner-eval_niah/xtuner/_lite/parallel/fsdp/precision.py function set_require_grad_param_to_fp32 (line 5) | def set_require_grad_param_to_fp32(model: nn.Module): FILE: xtuner-eval_niah/xtuner/_lite/parallel/fsdp/wrap.py function layer_auto_wrap_policy (line 12) | def layer_auto_wrap_policy( function layer_and_emb_wrap_policy (line 27) | def layer_and_emb_wrap_policy( function token_embedding_wrap_policy (line 49) | def token_embedding_wrap_policy( function all_required_grad_wrap_policy (line 66) | def all_required_grad_wrap_policy( FILE: xtuner-eval_niah/xtuner/_lite/parallel/sampler.py class ParallelSampler (line 13) | class ParallelSampler(Sampler): method __init__ (line 42) | def __init__( method __iter__ (line 78) | def __iter__(self) -> Iterator[int]: method __len__ (line 99) | def __len__(self) -> int: method set_epoch (line 103) | def set_epoch(self, epoch: int, step=0) -> None: function get_length_grouped_indices (line 117) | def get_length_grouped_indices(max_lengths, class LengthGroupedSampler (line 146) | class LengthGroupedSampler(Sampler): method __init__ (line 148) | def __init__(self, method __iter__ (line 200) | def __iter__(self) -> Iterator[int]: method __len__ (line 222) | def __len__(self) -> int: method set_epoch (line 226) | def set_epoch(self, epoch: int, step=0) -> None: FILE: xtuner-eval_niah/xtuner/_lite/parallel/sequence/attention.py function pre_process_for_sequence_parallel_attn (line 8) | def pre_process_for_sequence_parallel_attn(query_states, function post_process_for_sequence_parallel_attn (line 41) | def post_process_for_sequence_parallel_attn(attn_output, function sequence_parallel_wrapper (line 54) | def sequence_parallel_wrapper(local_attn): FILE: xtuner-eval_niah/xtuner/_lite/parallel/sequence/data_collate.py function pad_for_sequence_parallel (line 7) | def pad_for_sequence_parallel(tensor, padding_value, dim=-1): function pad_cumulative_len_for_sequence_parallel (line 26) | def pad_cumulative_len_for_sequence_parallel(cumulative_len): FILE: xtuner-eval_niah/xtuner/_lite/parallel/sequence/ops.py function split_for_sequence_parallel (line 6) | def split_for_sequence_parallel(input, dim: int, sp_group: dist.ProcessG... function gather_for_sequence_parallel (line 33) | def gather_for_sequence_parallel(input, dim: int, sp_group: dist.Process... class _GatherForwardSplitBackward (line 60) | class _GatherForwardSplitBackward(torch.autograd.Function): method forward (line 68) | def forward(ctx, input, dim, sp_group, grad_scale): method backward (line 75) | def backward(ctx, grad_output): class _SplitForwardGatherBackward (line 85) | class _SplitForwardGatherBackward(torch.autograd.Function): method forward (line 93) | def forward(ctx, input, dim, sp_group, grad_scale): method backward (line 100) | def backward(ctx, grad_output): function split_forward_gather_backward (line 109) | def split_forward_gather_backward(input, dim, sp_group, grad_scale=None): function gather_forward_split_backward (line 123) | def gather_forward_split_backward(input, dim, sp_group, grad_scale=None): FILE: xtuner-eval_niah/xtuner/_lite/parallel/sequence/reduce_loss.py class _ReduceLoss (line 7) | class _ReduceLoss(torch.autograd.Function): method forward (line 10) | def forward(ctx, mean_loss, loss_scale, process_group): method backward (line 22) | def backward(ctx, grad_output): function reduce_sequence_parallel_loss (line 26) | def reduce_sequence_parallel_loss(mean_loss, FILE: xtuner-eval_niah/xtuner/_lite/parallel/setup.py function setup_sp (line 15) | def setup_sp(sp_size): function setup_tp (line 31) | def setup_tp(tp_size): function setup_dp (line 47) | def setup_dp(): function set_seq_parallel_pg (line 67) | def set_seq_parallel_pg(sp_ulysses_degree, sp_ring_degree): function setup_parallel (line 93) | def setup_parallel(sp_size=1, tp_size=1, ring_size=1): function get_ulysess_mesh (line 108) | def get_ulysess_mesh(): function get_ring_mesh (line 112) | def get_ring_mesh(): function get_ulysess_group (line 116) | def get_ulysess_group(): function get_ring_group (line 120) | def get_ring_group(): function get_ulysess_world_size (line 124) | def get_ulysess_world_size(): function get_ring_world_size (line 135) | def get_ring_world_size(): function get_dp_mesh (line 146) | def get_dp_mesh(): function get_dp_group (line 150) | def get_dp_group(): function get_dp_world_size (line 154) | def get_dp_world_size(): function get_sp_mesh (line 165) | def get_sp_mesh(): function get_sp_group (line 169) | def get_sp_group(): function get_sp_world_size (line 173) | def get_sp_world_size(): function get_tp_mesh (line 184) | def get_tp_mesh(): function get_tp_group (line 188) | def get_tp_group(): function get_tp_world_size (line 192) | def get_tp_world_size(): FILE: xtuner-eval_niah/xtuner/_lite/yunchang/comm/all_to_all.py function all_to_all_4D (line 15) | def all_to_all_4D( class SeqAllToAll4D (line 96) | class SeqAllToAll4D(torch.autograd.Function): method forward (line 98) | def forward( method backward (line 113) | def backward(ctx: Any, *grad_output: Tensor) -> Tuple[None, Tensor, No... function all_to_all_5D (line 124) | def all_to_all_5D( class SeqAllToAll5D (line 207) | class SeqAllToAll5D(torch.autograd.Function): method forward (line 209) | def forward( method backward (line 224) | def backward(ctx: Any, *grad_output: Tensor) -> Tuple[None, Tensor, No... FILE: xtuner-eval_niah/xtuner/_lite/yunchang/comm/extract_local.py function stripe_extract_local (line 7) | def stripe_extract_local(value, rank, world_size, rd, ud, *args, **kwargs): function basic_extract_local (line 29) | def basic_extract_local(value, rank, world_size, *args, **kwargs): function zigzag_extract_local (line 33) | def zigzag_extract_local(value, rank, world_size, rd, ud, dim=1, *args, ... FILE: xtuner-eval_niah/xtuner/_lite/yunchang/globals.py class Singleton (line 4) | class Singleton: method __new__ (line 7) | def __new__(cls, *args, **kwargs): class ProcessGroupSingleton (line 13) | class ProcessGroupSingleton(Singleton): method __init__ (line 14) | def __init__(self): function set_seq_parallel_pg (line 22) | def set_seq_parallel_pg( FILE: xtuner-eval_niah/xtuner/_lite/yunchang/hybrid/async_attn_layer.py class AsyncLongContextAttention (line 11) | class AsyncLongContextAttention(torch.nn.Module): method __init__ (line 21) | def __init__( method forward (line 42) | def forward( method backward (line 195) | def backward(self, *args, **kwargs): FILE: xtuner-eval_niah/xtuner/_lite/yunchang/hybrid/attn_layer.py class LongContextAttention (line 15) | class LongContextAttention(torch.nn.Module): method __init__ (line 25) | def __init__( method forward (line 45) | def forward( class LongContextAttentionQKVPacked (line 134) | class LongContextAttentionQKVPacked(torch.nn.Module): method __init__ (line 144) | def __init__( method forward (line 164) | def forward( function llama3_varlen_attention_sp_ulysses_ring (line 225) | def llama3_varlen_attention_sp_ulysses_ring( function attention_sp_ulysses_ring (line 299) | def attention_sp_ulysses_ring( class LongContextVarLenAttentionForLlaMa3 (line 347) | class LongContextVarLenAttentionForLlaMa3(torch.nn.Module): method __init__ (line 357) | def __init__( method forward (line 372) | def forward( FILE: xtuner-eval_niah/xtuner/_lite/yunchang/ring/llama3_flash_attn_varlen.py class AsyncHandles (line 10) | class AsyncHandles: method __init__ (line 12) | def __init__(self) -> None: method register (line 15) | def register(self, handle): method wait (line 18) | def wait(self): function llama3_flash_attn_prepare_cu_seqlens (line 24) | def llama3_flash_attn_prepare_cu_seqlens(cu_seqlens, causal, rank, world... function llama3_flash_attn_varlen_forward (line 63) | def llama3_flash_attn_varlen_forward( function llama3_flash_attn_varlen_backward (line 164) | def llama3_flash_attn_varlen_backward( class Llama3FlashAttnVarlenFunc (line 313) | class Llama3FlashAttnVarlenFunc(torch.autograd.Function): method forward (line 315) | def forward( method backward (line 375) | def backward(ctx, dout, *args): function llama3_flash_attn_varlen_qkvpacked_func (line 401) | def llama3_flash_attn_varlen_qkvpacked_func( function llama3_flash_attn_varlen_kvpacked_func (line 439) | def llama3_flash_attn_varlen_kvpacked_func( function llama3_flash_attn_varlen_func (line 478) | def llama3_flash_attn_varlen_func( FILE: xtuner-eval_niah/xtuner/_lite/yunchang/ring/ring_flash_attn.py function ring_flash_attn_forward (line 8) | def ring_flash_attn_forward( function ring_flash_attn_backward (line 61) | def ring_flash_attn_backward( class RingFlashAttnFunc (line 145) | class RingFlashAttnFunc(torch.autograd.Function): method forward (line 147) | def forward( method backward (line 191) | def backward(ctx, dout, *args): function ring_flash_attn_qkvpacked_func (line 211) | def ring_flash_attn_qkvpacked_func( function ring_flash_attn_kvpacked_func (line 237) | def ring_flash_attn_kvpacked_func( function ring_flash_attn_func (line 264) | def ring_flash_attn_func( function ring_flash_attn_inference_func (line 293) | def ring_flash_attn_inference_func( FILE: xtuner-eval_niah/xtuner/_lite/yunchang/ring/ring_flash_attn_varlen.py function ring_flash_attn_varlen_forward (line 25) | def ring_flash_attn_varlen_forward( function ring_flash_attn_varlen_backward (line 95) | def ring_flash_attn_varlen_backward( class RingFlashAttnVarlenFunc (line 184) | class RingFlashAttnVarlenFunc(torch.autograd.Function): method forward (line 186) | def forward( method backward (line 235) | def backward(ctx, dout, *args): function ring_flash_attn_varlen_qkvpacked_func (line 257) | def ring_flash_attn_varlen_qkvpacked_func( function ring_flash_attn_varlen_kvpacked_func (line 287) | def ring_flash_attn_varlen_kvpacked_func( function ring_flash_attn_varlen_func (line 318) | def ring_flash_attn_varlen_func( FILE: xtuner-eval_niah/xtuner/_lite/yunchang/ring/stripe_flash_attn.py function stripe_flash_attn_forward (line 7) | def stripe_flash_attn_forward( function stripe_flash_attn_backward (line 81) | def stripe_flash_attn_backward( class StripeFlashAttnFunc (line 199) | class StripeFlashAttnFunc(torch.autograd.Function): method forward (line 201) | def forward( method backward (line 245) | def backward(ctx, dout, *args): function stripe_flash_attn_qkvpacked_func (line 265) | def stripe_flash_attn_qkvpacked_func( function stripe_flash_attn_kvpacked_func (line 291) | def stripe_flash_attn_kvpacked_func( function stripe_flash_attn_func (line 318) | def stripe_flash_attn_func( FILE: xtuner-eval_niah/xtuner/_lite/yunchang/ring/triton_utils.py function flatten_kernel (line 7) | def flatten_kernel( function flatten_varlen_lse (line 39) | def flatten_varlen_lse(lse, cu_seqlens): function unflatten_kernel (line 71) | def unflatten_kernel( function unflatten_varlen_lse (line 103) | def unflatten_varlen_lse(lse, cu_seqlens, max_seqlen: int): FILE: xtuner-eval_niah/xtuner/_lite/yunchang/ring/utils.py function get_default_args (line 14) | def get_default_args(func): function _update_out_and_lse (line 25) | def _update_out_and_lse( function update_out_and_lse (line 45) | def update_out_and_lse( function flatten_varlen_lse (line 69) | def flatten_varlen_lse(lse, cu_seqlens): function unflatten_varlen_lse (line 78) | def unflatten_varlen_lse(lse, cu_seqlens, max_seqlen: int): class RingComm (line 90) | class RingComm: method __init__ (line 91) | def __init__(self, process_group: dist.ProcessGroup): method send_recv (line 105) | def send_recv( method commit (line 121) | def commit(self): method wait (line 126) | def wait(self): FILE: xtuner-eval_niah/xtuner/_lite/yunchang/ring/zigzag_ring_flash_attn.py function zigzag_ring_flash_attn_forward (line 7) | def zigzag_ring_flash_attn_forward( function zigzag_ring_flash_attn_backward (line 81) | def zigzag_ring_flash_attn_backward( class ZigZagRingFlashAttnFunc (line 187) | class ZigZagRingFlashAttnFunc(torch.autograd.Function): method forward (line 189) | def forward( method backward (line 233) | def backward(ctx, dout, *args): function zigzag_ring_flash_attn_qkvpacked_func (line 253) | def zigzag_ring_flash_attn_qkvpacked_func( function zigzag_ring_flash_attn_kvpacked_func (line 279) | def zigzag_ring_flash_attn_kvpacked_func( function zigzag_ring_flash_attn_func (line 306) | def zigzag_ring_flash_attn_func( FILE: xtuner-eval_niah/xtuner/_lite/yunchang/ring/zigzag_ring_flash_attn_varlen.py function get_half_index (line 24) | def get_half_index(cu_seqlens, *, front: bool): function get_half_lse (line 43) | def get_half_lse(lse, cu_seqlens, *, front: bool): function zigzag_ring_flash_attn_varlen_forward (line 74) | def zigzag_ring_flash_attn_varlen_forward( function zigzag_ring_flash_attn_varlen_backward (line 184) | def zigzag_ring_flash_attn_varlen_backward( class ZigZagRingFlashAttnVarlenFunc (line 305) | class ZigZagRingFlashAttnVarlenFunc(torch.autograd.Function): method forward (line 307) | def forward( method backward (line 369) | def backward(ctx, dout, *args): function zigzag_ring_flash_attn_varlen_qkvpacked_func (line 400) | def zigzag_ring_flash_attn_varlen_qkvpacked_func( function zigzag_ring_flash_attn_varlen_kvpacked_func (line 430) | def zigzag_ring_flash_attn_varlen_kvpacked_func( function zigzag_ring_flash_attn_varlen_func (line 461) | def zigzag_ring_flash_attn_varlen_func( FILE: xtuner-eval_niah/xtuner/_lite/yunchang/ulysses/attn_layer.py function torch_attn (line 16) | def torch_attn(query, class UlyssesAttention (line 42) | class UlyssesAttention(torch.nn.Module): method __init__ (line 52) | def __init__( method forward (line 70) | def forward( FILE: xtuner-eval_niah/xtuner/apis/datasets/alpaca.py function alpaca_enzh_dataset (line 14) | def alpaca_enzh_dataset(tokenizer, function alpaca_enzh_data_collator (line 41) | def alpaca_enzh_data_collator(return_hf_format=False): function alpaca_zh_dataset (line 45) | def alpaca_zh_dataset(tokenizer, function alpaca_zh_data_collator (line 66) | def alpaca_zh_data_collator(return_hf_format=False): function alpaca_dataset (line 70) | def alpaca_dataset(tokenizer, function alpaca_data_collator (line 91) | def alpaca_data_collator(return_hf_format=False): FILE: xtuner-eval_niah/xtuner/apis/datasets/arxiv.py function arxiv_dataset (line 12) | def arxiv_dataset(tokenizer, function arxiv_data_collator (line 37) | def arxiv_data_collator(return_hf_format=False): FILE: xtuner-eval_niah/xtuner/apis/datasets/code_alpaca.py function code_alpaca_dataset (line 12) | def code_alpaca_dataset(tokenizer, function code_alpaca_data_collator (line 33) | def code_alpaca_data_collator(return_hf_format=False): FILE: xtuner-eval_niah/xtuner/apis/datasets/colorist.py function colorist_dataset (line 12) | def colorist_dataset(tokenizer, function colorist_data_collator (line 33) | def colorist_data_collator(return_hf_format=False): FILE: xtuner-eval_niah/xtuner/apis/datasets/lawyer.py function lawyer_dataset (line 15) | def lawyer_dataset(tokenizer, function lawyer_data_collator (line 40) | def lawyer_data_collator(return_hf_format=False): function lawyer_crime_dataset (line 44) | def lawyer_crime_dataset(tokenizer, function lawyer_crime_data_collator (line 68) | def lawyer_crime_data_collator(return_hf_format=False): function lawyer_reference_dataset (line 72) | def lawyer_reference_dataset(tokenizer, function lawyer_reference_data_collator (line 96) | def lawyer_reference_data_collator(return_hf_format=False): FILE: xtuner-eval_niah/xtuner/apis/datasets/medical.py function medical_dataset (line 12) | def medical_dataset(tokenizer, function medical_data_collator (line 33) | def medical_data_collator(return_hf_format=False): FILE: xtuner-eval_niah/xtuner/apis/datasets/moss_003_sft.py function moss_003_sft_dataset (line 10) | def moss_003_sft_dataset(tokenizer, function moss_003_sft_data_collator (line 29) | def moss_003_sft_data_collator(return_hf_format=False): function moss_003_sft_no_plugins_dataset (line 33) | def moss_003_sft_no_plugins_dataset(tokenizer, function moss_003_sft_no_plugins_data_collator (line 50) | def moss_003_sft_no_plugins_data_collator(return_hf_format=False): function moss_003_sft_plugins_dataset (line 54) | def moss_003_sft_plugins_dataset(tokenizer, function moss_003_sft_plugins_data_collator (line 71) | def moss_003_sft_plugins_data_collator(return_hf_format=False): FILE: xtuner-eval_niah/xtuner/apis/datasets/oasst1.py function oasst1_dataset (line 12) | def oasst1_dataset(tokenizer, function oasst1_data_collator (line 33) | def oasst1_data_collator(return_hf_format=False): FILE: xtuner-eval_niah/xtuner/apis/datasets/open_orca.py function openorca_dataset (line 12) | def openorca_dataset(tokenizer, function openorca_data_collator (line 33) | def openorca_data_collator(return_hf_format=False): FILE: xtuner-eval_niah/xtuner/apis/datasets/sql.py function sql_dataset (line 12) | def sql_dataset(tokenizer, function sql_data_collator (line 33) | def sql_data_collator(return_hf_format=False): FILE: xtuner-eval_niah/xtuner/apis/datasets/tiny_codes.py function tiny_codes_dataset (line 12) | def tiny_codes_dataset(tokenizer, function tiny_codes_data_collator (line 33) | def tiny_codes_data_collator(return_hf_format=False): FILE: xtuner-eval_niah/xtuner/apis/datasets/wizardlm.py function wizardlm_dataset (line 12) | def wizardlm_dataset(tokenizer, function wizardlm_data_collator (line 33) | def wizardlm_data_collator(return_hf_format=False): FILE: xtuner-eval_niah/xtuner/apis/model.py function build_qlora_model (line 12) | def build_qlora_model(model_name_or_path, function build_lora_model (line 52) | def build_lora_model(model_name_or_path, function build_model (line 78) | def build_model(model_name_or_path, return_tokenizer=True): FILE: xtuner-eval_niah/xtuner/apis/training_args.py class DefaultTrainingArguments (line 12) | class DefaultTrainingArguments(TrainingArguments): FILE: xtuner-eval_niah/xtuner/configs/__init__.py function get_cfgs_name_path (line 5) | def get_cfgs_name_path(): FILE: xtuner-eval_niah/xtuner/configs/llava/llama3_8b_instruct_clip_vit_large_p14_336/convert_xtuner_weights_to_hf.py function convert_state_dict_to_hf (line 25) | def convert_state_dict_to_hf(state_dict, mapping): function convert_to_hf (line 38) | def convert_to_hf(text_model_id, vision_model_id, projector_weight, save... function main (line 131) | def main(): FILE: xtuner-eval_niah/xtuner/configs/llava/llama3_8b_instruct_clip_vit_large_p14_336/convert_xtuner_weights_to_llava.py function convert_state_dict_to_hf (line 27) | def convert_state_dict_to_hf(state_dict, mapping): function convert_to_llava (line 39) | def convert_to_llava(text_model_id, vision_model_id, projector_weight, function main (line 94) | def main(): FILE: xtuner-eval_niah/xtuner/configs/llava/phi3_mini_4k_instruct_clip_vit_large_p14_336/convert_phi_to_llama.py function convert_phi_to_llama (line 13) | def convert_phi_to_llama(phi_path, save_path): function main (line 91) | def main(): FILE: xtuner-eval_niah/xtuner/configs/llava/phi3_mini_4k_instruct_clip_vit_large_p14_336/convert_xtuner_weights_to_hf.py function convert_state_dict_to_hf (line 25) | def convert_state_dict_to_hf(state_dict, mapping): function convert_to_hf (line 38) | def convert_to_hf(text_model_id, vision_model_id, projector_weight, save... function main (line 128) | def main(): FILE: xtuner-eval_niah/xtuner/configs/llava/phi3_mini_4k_instruct_clip_vit_large_p14_336/convert_xtuner_weights_to_llava.py function convert_state_dict_to_hf (line 27) | def convert_state_dict_to_hf(state_dict, mapping): function convert_to_llava (line 39) | def convert_to_llava(text_model_id, vision_model_id, projector_weight, function main (line 94) | def main(): FILE: xtuner-eval_niah/xtuner/dataset/collate_fns/default_collate_fn.py function default_collate_fn (line 12) | def default_collate_fn(instances: Sequence[Dict], FILE: xtuner-eval_niah/xtuner/dataset/collate_fns/mmlu_collate_fn.py function mmlu_collate_fn (line 10) | def mmlu_collate_fn(instances: Sequence[Dict], FILE: xtuner-eval_niah/xtuner/dataset/collate_fns/preference_collate_fn.py function preference_collate_fn (line 13) | def preference_collate_fn(instances: Sequence[Dict], FILE: xtuner-eval_niah/xtuner/dataset/concat_dataset.py class ConcatDataset (line 7) | class ConcatDataset(TorchConcatDataset): method __init__ (line 9) | def __init__(self, datasets): method __repr__ (line 15) | def __repr__(self): FILE: xtuner-eval_niah/xtuner/dataset/huggingface.py function get_lengths (line 18) | def get_lengths(example): function build_origin_dataset (line 22) | def build_origin_dataset(dataset, split): function map_dataset (line 39) | def map_dataset(dataset, dataset_map_fn, map_num_proc): function add_template_to_dataset (line 54) | def add_template_to_dataset(dataset, template_map_fn, map_num_proc): function tokenize_dataset (line 67) | def tokenize_dataset(dataset, tokenizer, max_length, with_image_token, function pack_dataset (line 88) | def pack_dataset(dataset, max_length, use_varlen_attn, shuffle_before_pack, function process (line 100) | def process(dataset, function process_hf_dataset (line 222) | def process_hf_dataset(dataset, FILE: xtuner-eval_niah/xtuner/dataset/intern_repo.py class JsonlDataset (line 22) | class JsonlDataset(torch.utils.data.Dataset): method __init__ (line 36) | def __init__(self, path: str, min_length=50): method __getitem__ (line 62) | def __getitem__(self, idx): method get_dataset_name (line 84) | def get_dataset_name(self): method _get_mmap (line 87) | def _get_mmap(self): method __setstate__ (line 100) | def __setstate__(self, state): method __getstate__ (line 104) | def __getstate__(self): method __del__ (line 111) | def __del__(self): method exists (line 118) | def exists(path): method __len__ (line 121) | def __len__(self): class PackedDataset (line 128) | class PackedDataset(torch.utils.data.Dataset): method __init__ (line 137) | def __init__(self, dataset, packed_length: int = 8192, seed: int = 1024): method __len__ (line 162) | def __len__(self): method search_sample_index (line 165) | def search_sample_index(self, pack_idx: int = 0): method mapping (line 172) | def mapping(self, pack_idx: int = 0): method build_pack (line 192) | def build_pack(self, begin_sample_idx: int, begin_token_id: int, method __getitem__ (line 228) | def __getitem__(self, item: int): function load_intern_repo_tokenized_dataset (line 235) | def load_intern_repo_tokenized_dataset(folder, function load_intern_repo_untokenized_dataset (line 268) | def load_intern_repo_untokenized_dataset(processed_dataset_dict_path=None, function build_packed_dataset_rank0 (line 332) | def build_packed_dataset_rank0(dataset_cfg, packed_length=8192, seed=1024): function build_packed_dataset (line 352) | def build_packed_dataset(*args, **kwargs): FILE: xtuner-eval_niah/xtuner/dataset/json_dataset.py function load_json_file (line 7) | def load_json_file(data_files=None, data_dir=None, suffix=None): FILE: xtuner-eval_niah/xtuner/dataset/llava.py function load_jsonl (line 19) | def load_jsonl(json_file): class LLaVADataset (line 28) | class LLaVADataset(Dataset): method __init__ (line 30) | def __init__(self, method modality_length (line 89) | def modality_length(self): method __len__ (line 98) | def __len__(self): method __getitem__ (line 101) | def __getitem__(self, index): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/alpaca_map_fn.py function alpaca_map_fn (line 4) | def alpaca_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/alpaca_zh_map_fn.py function alpaca_zh_map_fn (line 4) | def alpaca_zh_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/arxiv_map_fn.py function arxiv_map_fn (line 5) | def arxiv_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/code_alpaca_map_fn.py function code_alpaca_map_fn (line 5) | def code_alpaca_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/colors_map_fn.py function colors_map_fn (line 5) | def colors_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/crime_kg_assitant_map_fn.py function crime_kg_assitant_map_fn (line 5) | def crime_kg_assitant_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/default_map_fn.py function default_map_fn (line 2) | def default_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/law_reference_map_fn.py function law_reference_map_fn (line 5) | def law_reference_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/llava_map_fn.py function llava_image_only_map_fn (line 5) | def llava_image_only_map_fn(example): function llava_map_fn (line 25) | def llava_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/medical_map_fn.py function medical_map_fn (line 5) | def medical_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/msagent_map_fn.py function replace_think (line 9) | def replace_think(match): function replace_exec (line 22) | def replace_exec(match): function extract_json_objects (line 34) | def extract_json_objects(text, decoder=json.JSONDecoder()): function msagent_react_map_fn (line 53) | def msagent_react_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/oasst1_map_fn.py function oasst1_map_fn (line 2) | def oasst1_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/openai_map_fn.py function openai_map_fn (line 2) | def openai_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/openorca_map_fn.py function openorca_map_fn (line 2) | def openorca_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/pretrain_map_fn.py function pretrain_map_fn (line 2) | def pretrain_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/sql_map_fn.py function sql_map_fn (line 5) | def sql_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/stack_exchange_map_fn.py function stack_exchange_map_fn (line 2) | def stack_exchange_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/tiny_codes_map_fn.py function tiny_codes_map_fn (line 5) | def tiny_codes_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/dataset_map_fns/wizardlm_map_fn.py function wizardlm_map_fn (line 2) | def wizardlm_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/map_fns/template_map_fn.py function template_map_fn (line 7) | def template_map_fn(example, template): function template_map_fn_factory (line 33) | def template_map_fn_factory(template): FILE: xtuner-eval_niah/xtuner/dataset/modelscope.py function process_ms_dataset (line 8) | def process_ms_dataset(dataset, split='train', *args, **kwargs): FILE: xtuner-eval_niah/xtuner/dataset/moss_sft.py class MOSSSFTDataset (line 15) | class MOSSSFTDataset(Dataset): method __init__ (line 17) | def __init__(self, data_file, tokenizer, max_length=2048, bot_name=None): method load_data (line 43) | def load_data(self): method process_data (line 118) | def process_data(self): method __len__ (line 125) | def __len__(self): method __getitem__ (line 128) | def __getitem__(self, index): FILE: xtuner-eval_niah/xtuner/dataset/preference_dataset.py function _worker (line 24) | def _worker( function _chunk_data_to_queue (line 41) | def _chunk_data_to_queue(data_queue: Queue, data: List[Dict], chunk_size... function _multi_progress (line 61) | def _multi_progress(tokenize_fun_p, dataset, nproc, task_num, chunksize, function load_jsonl_dataset (line 90) | def load_jsonl_dataset(data_files=None, data_dir=None, suffix=None): function tokenize (line 110) | def tokenize(pair: str, class PreferenceDataset (line 156) | class PreferenceDataset(Dataset): method __init__ (line 158) | def __init__( method __len__ (line 194) | def __len__(self): method __getitem__ (line 197) | def __getitem__(self, idx): class PackedDatasetWrapper (line 201) | class PackedDatasetWrapper(Dataset): method __init__ (line 203) | def __init__(self, method __len__ (line 252) | def __len__(self): method __getitem__ (line 255) | def __getitem__(self, index): function unpack_seq (line 280) | def unpack_seq(seq, cu_seqlens): function broad_cast_dataset (line 288) | def broad_cast_dataset(dataset): function map_dataset (line 309) | def map_dataset(dataset, dataset_map_fn, map_num_proc): function build_preference_dataset (line 324) | def build_preference_dataset( function intel_orca_dpo_map_fn (line 368) | def intel_orca_dpo_map_fn(example): function orpo_dpo_mix_40k_map_fn (line 381) | def orpo_dpo_mix_40k_map_fn(example): FILE: xtuner-eval_niah/xtuner/dataset/refcoco_json.py class RefCOCOJsonDataset (line 26) | class RefCOCOJsonDataset(LLaVADataset): method __init__ (line 37) | def __init__( method reformat_data (line 81) | def reformat_data(self, json_data): method gen_refcoco_conversations (line 91) | def gen_refcoco_conversations(cls, data, instruction_template='{}'): method get_data_json (line 127) | def get_data_json( method normalize_bbox (line 168) | def normalize_bbox(cls, bbox, height, width): class RefCOCOJsonEvalDataset (line 176) | class RefCOCOJsonEvalDataset(RefCOCOJsonDataset): method reformat_data (line 179) | def reformat_data(self, json_data): class InvRefCOCOJsonDataset (line 188) | class InvRefCOCOJsonDataset(RefCOCOJsonDataset): method gen_refcoco_conversations (line 200) | def gen_refcoco_conversations(cls, data, instruction_template='{}'): class REFER (line 241) | class REFER: method __init__ (line 243) | def __init__(self, data_root, vis_root, dataset='refcoco', splitBy='un... method createIndex (line 276) | def createIndex(self): method getRefIds (line 340) | def getRefIds(self, image_ids=[], cat_ids=[], ref_ids=[], split=''): method getAnnIds (line 372) | def getAnnIds(self, image_ids=[], cat_ids=[], ref_ids=[]): method getImgIds (line 397) | def getImgIds(self, ref_ids=[]): method getCatIds (line 408) | def getCatIds(self): method loadRefs (line 411) | def loadRefs(self, ref_ids=[]): method loadAnns (line 417) | def loadAnns(self, ann_ids=[]): method loadImgs (line 423) | def loadImgs(self, image_ids=[]): method loadCats (line 429) | def loadCats(self, cat_ids=[]): method getRefBox (line 435) | def getRefBox(self, ref_id): method showRef (line 440) | def showRef(self, ref, seg_box='box'): FILE: xtuner-eval_niah/xtuner/dataset/samplers/intern_repo.py class InternRepoSampler (line 13) | class InternRepoSampler(Sampler): method __init__ (line 15) | def __init__(self, method __iter__ (line 35) | def __iter__(self) -> Iterator[int]: method __len__ (line 54) | def __len__(self) -> int: method set_epoch (line 58) | def set_epoch(self, epoch: int) -> None: class InternlmRepoSampler (line 71) | class InternlmRepoSampler(InternRepoSampler): method __init__ (line 73) | def __init__(self, FILE: xtuner-eval_niah/xtuner/dataset/samplers/length_grouped.py function get_length_grouped_indices (line 11) | def get_length_grouped_indices(lengths, group_batch_size, generator=None): class LengthGroupedSampler (line 72) | class LengthGroupedSampler(Sampler): method __init__ (line 74) | def __init__(self, method __iter__ (line 124) | def __iter__(self) -> Iterator[int]: method __len__ (line 144) | def __len__(self) -> int: method set_epoch (line 148) | def set_epoch(self, epoch: int) -> None: FILE: xtuner-eval_niah/xtuner/dataset/utils.py function get_bos_eos_token_ids (line 15) | def get_bos_eos_token_ids(tokenizer): function encode_fn (line 36) | def encode_fn(example, class Packer (line 132) | class Packer: method __init__ (line 135) | def __init__(self, method get_cumulative_len (line 146) | def get_cumulative_len(self, chunk_num): method get_position_ids (line 179) | def get_position_ids(self, cumulative_len): method __call__ (line 191) | def __call__(self, batch): function expand2square (line 245) | def expand2square(pil_img, background_color): function load_image (line 259) | def load_image(image_file): function decode_base64_to_image (line 268) | def decode_base64_to_image(base64_string): FILE: xtuner-eval_niah/xtuner/engine/_strategy/deepspeed.py class DeepSpeedStrategy (line 11) | class DeepSpeedStrategy(MMEngineDeepSpeedStrategy): method __init__ (line 13) | def __init__(self, *args, **kwargs): method _wrap_model (line 24) | def _wrap_model(self, model): method save_checkpoint (line 33) | def save_checkpoint(self, *args, **kwargs) -> None: method load_checkpoint (line 45) | def load_checkpoint(self, *args, **kwargs) -> None: method resume (line 54) | def resume(self, *args, **kwargs) -> None: method _setup_distributed (line 63) | def _setup_distributed( # type: ignore FILE: xtuner-eval_niah/xtuner/engine/hooks/dataset_info_hook.py function split_list (line 8) | def split_list(lst, value): class DatasetInfoHook (line 21) | class DatasetInfoHook(Hook): method __init__ (line 23) | def __init__(self, tokenizer, is_intern_repo_dataset=False): method log (line 27) | def log(self, runner, dataset, mode='train'): method before_train (line 42) | def before_train(self, runner) -> None: method before_val (line 52) | def before_val(self, runner) -> None: method before_test (line 56) | def before_test(self, runner) -> None: FILE: xtuner-eval_niah/xtuner/engine/hooks/evaluate_chat_hook.py class EvaluateChatHook (line 20) | class EvaluateChatHook(Hook): method __init__ (line 24) | def __init__(self, method _save_eval_output (line 98) | def _save_eval_output(self, runner, eval_outputs): method _eval_images (line 106) | def _eval_images(self, method _eval_language (line 167) | def _eval_language(self, method _generate_samples (line 194) | def _generate_samples(self, method before_train (line 232) | def before_train(self, runner): method _is_save_checkpoint (line 236) | def _is_save_checkpoint(self, runner): method after_train_iter (line 254) | def after_train_iter(self, method after_train (line 273) | def after_train(self, runner): method after_val (line 277) | def after_val(self, runner) -> None: FILE: xtuner-eval_niah/xtuner/engine/hooks/hf_checkpoint_hook.py class HFCheckpointHook (line 19) | class HFCheckpointHook(Hook): method __init__ (line 23) | def __init__(self, out_dir: Optional[Union[str, Path]] = None) -> None: method _use_shard_moe (line 27) | def _use_shard_moe(llm): method after_run (line 32) | def after_run(self, runner) -> None: FILE: xtuner-eval_niah/xtuner/engine/hooks/throughput_hook.py class ThroughputHook (line 16) | class ThroughputHook(Hook): method __init__ (line 22) | def __init__(self, method _guess_is_casual_attn (line 37) | def _guess_is_casual_attn(model): method _get_batch_size_and_sequence_len (line 47) | def _get_batch_size_and_sequence_len(data_batch): method _guess_use_activation_checkpointing (line 55) | def _guess_use_activation_checkpointing(model): method before_run (line 61) | def before_run(self, runner) -> None: method after_train_iter (line 88) | def after_train_iter(self, FILE: xtuner-eval_niah/xtuner/engine/hooks/varlen_attn_args_to_messagehub_hook.py class VarlenAttnArgsToMessageHubHook (line 11) | class VarlenAttnArgsToMessageHubHook(Hook): method before_train_iter (line 13) | def before_train_iter(self, method after_train_iter (line 31) | def after_train_iter(self, method before_val_iter (line 41) | def before_val_iter(self, method after_val_iter (line 68) | def after_val_iter(self, FILE: xtuner-eval_niah/xtuner/engine/runner/loops.py class TrainLoop (line 8) | class TrainLoop(IterBasedTrainLoop): method __init__ (line 10) | def __init__(self, FILE: xtuner-eval_niah/xtuner/entry_point.py function list_dataset_format (line 127) | def list_dataset_format(): function list_cfg (line 132) | def list_cfg(): function copy_cfg (line 137) | def copy_cfg(): function log_dataset (line 142) | def log_dataset(): function check_custom_dataset (line 147) | def check_custom_dataset(): function train (line 152) | def train(): function test (line 157) | def test(): function chat (line 162) | def chat(): function mmbench (line 167) | def mmbench(): function pth_to_hf (line 172) | def pth_to_hf(): function merge (line 177) | def merge(): function split (line 182) | def split(): function arxiv_preprocess (line 187) | def arxiv_preprocess(): function convert_refcoco (line 192) | def convert_refcoco(): function convert_help_msg (line 197) | def convert_help_msg(): function preprocess_help_msg (line 201) | def preprocess_help_msg(): function eval_refcoco (line 205) | def eval_refcoco(): function cli (line 244) | def cli(): FILE: xtuner-eval_niah/xtuner/evaluation/metrics/mmlu_metric.py class MMLUMetric (line 14) | class MMLUMetric(BaseMetric): method __init__ (line 91) | def __init__(self, tokenizer, *args, **kwargs): method ABCD_to_0123 (line 102) | def ABCD_to_0123(abcd): method find_first_zero_index (line 106) | def find_first_zero_index(tensor): method accuracy (line 114) | def accuracy(preds, gts): method process (line 120) | def process(self, data_batch: Any, data_samples: Sequence[dict]) -> None: method compute_metrics (line 147) | def compute_metrics(self, results: list) -> dict: method _print_results (line 236) | def _print_results(self, table_metrics: dict) -> None: FILE: xtuner-eval_niah/xtuner/evaluation/metrics/reward_metric.py class RewardMetric (line 12) | class RewardMetric(BaseMetric): method __init__ (line 17) | def __init__(self, method process (line 22) | def process(self, data_batch, data_samples: Sequence[dict]): method compute_metrics (line 49) | def compute_metrics(self, results: List): FILE: xtuner-eval_niah/xtuner/model/dpo.py function create_reference_model (line 19) | def create_reference_model(model): class DPO (line 36) | class DPO(SupervisedFinetune): method __init__ (line 39) | def __init__(self, method _gather_masked_logits (line 55) | def _gather_masked_logits(self, logits, labels, mask): method get_logps (line 61) | def get_logps( method get_var_len_atten_logps (line 89) | def get_var_len_atten_logps(self, all_logits, all_ref_logits, labels, method _split_for_sequence_parallel (line 141) | def _split_for_sequence_parallel(data): method compute_loss (line 153) | def compute_loss(self, data, data_samples=None): FILE: xtuner-eval_niah/xtuner/model/llava.py function convert_state_dict_to_hf (line 30) | def convert_state_dict_to_hf(state_dict, mapping): class LLaVAModel (line 42) | class LLaVAModel(BaseModel): method __init__ (line 44) | def __init__(self, method _parse_lora_config (line 121) | def _parse_lora_config(self, lora_config): method _prepare_llm_for_lora (line 127) | def _prepare_llm_for_lora(self, method _prepare_visual_encoder_for_lora (line 138) | def _prepare_visual_encoder_for_lora(self, method gradient_checkpointing_enable (line 147) | def gradient_checkpointing_enable(self): method activation_checkpointing_enable (line 150) | def activation_checkpointing_enable(self): method gradient_checkpointing_disable (line 155) | def gradient_checkpointing_disable(self): method activation_checkpointing_disable (line 158) | def activation_checkpointing_disable(self): method init_weights (line 163) | def init_weights(self): method state_dict (line 166) | def state_dict(self, *args, **kwargs): method _prepare_for_long_context_training (line 194) | def _prepare_for_long_context_training(cfg, llm_cfg, method _prepare_for_flash_attn (line 221) | def _prepare_for_flash_attn(cfg, llm_cfg): method _prepare_for_qlora_zero3 (line 250) | def _prepare_for_qlora_zero3(cfg): method _dispatch_lm_model_cfg (line 266) | def _dispatch_lm_model_cfg(self, cfg, max_position_embeddings=None): method _build_from_cfg_or_module (line 277) | def _build_from_cfg_or_module(self, cfg_or_mod): method forward (line 286) | def forward(self, data, data_samples=None, mode='loss'): method _forward (line 313) | def _forward(self, data, data_samples=None): method predict (line 319) | def predict(self, data, data_samples=None): method compute_loss (line 324) | def compute_loss(self, data, data_samples=None): method __getattr__ (line 329) | def __getattr__(self, name: str): method to_hf (line 335) | def to_hf(self, method to_xtuner_llava (line 352) | def to_xtuner_llava(self, method to_huggingface_llava (line 402) | def to_huggingface_llava(self, method to_official_llava (line 536) | def to_official_llava(self, FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/__init__.py function log_once (line 137) | def log_once(func): function dispatch_attn_forward (line 150) | def dispatch_attn_forward(model): function dispatch_varlen_attn_forward (line 178) | def dispatch_varlen_attn_forward(model): function dispatch_rmsnorm_forward (line 207) | def dispatch_rmsnorm_forward(model): function replace_rote (line 226) | def replace_rote(model): function dispatch_modules (line 254) | def dispatch_modules(model, use_varlen_attn=False): FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/attention.py function flash_attn_wo_mask (line 15) | def flash_attn_wo_mask( function flash_attn_w_mask (line 36) | def flash_attn_w_mask( function varlen_flash_attn (line 68) | def varlen_flash_attn( FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/baichuan.py function baichuan2_norm_head_forward (line 9) | def baichuan2_norm_head_forward(self, hidden_states): function rotate_half (line 14) | def rotate_half(x): function apply_rotary_pos_emb (line 21) | def apply_rotary_pos_emb(q, k, cos_, sin_, position_ids): function baichuan_7b_attn_forward (line 31) | def baichuan_7b_attn_forward( function baichuan_13b_attn_forward (line 75) | def baichuan_13b_attn_forward( FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/cohere.py class Cache (line 17) | class Cache: function cohere_attn_forward (line 21) | def cohere_attn_forward( FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/deepseek_v2.py function deepseek_attn_forward (line 19) | def deepseek_attn_forward( function deepseek_varlen_attn_forward (line 158) | def deepseek_varlen_attn_forward( FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/internlm.py class InternLMRotaryEmbedding (line 21) | class InternLMRotaryEmbedding(torch.nn.Module): method __init__ (line 23) | def __init__(self, method forward (line 43) | def forward(self, x, seq_len): function rotate_half (line 64) | def rotate_half(x): function apply_rotary_pos_emb (line 71) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids): function internlm_attn_forward (line 79) | def internlm_attn_forward( function internlm_varlen_attn_forward (line 140) | def internlm_varlen_attn_forward( FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/internlm2.py function rotate_half (line 16) | def rotate_half(x): function apply_rotary_pos_emb (line 23) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_di... function repeat_kv (line 31) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: function repeat_kv_bshd (line 49) | def repeat_kv_bshd(hidden_states: torch.Tensor, n_rep: int) -> torch.Ten... function internlm2_attn_forward (line 63) | def internlm2_attn_forward( function internlm2_varlen_attn_forward (line 174) | def internlm2_varlen_attn_forward( FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/llama.py class Cache (line 20) | class Cache: function repeat_kv_bshd (line 24) | def repeat_kv_bshd(hidden_states: torch.Tensor, n_rep: int) -> torch.Ten... function llama_attn_forward (line 38) | def llama_attn_forward( function llama_attn_forward_legacy (line 160) | def llama_attn_forward_legacy( function llama_varlen_attn_forward (line 290) | def llama_varlen_attn_forward( function llama_varlen_attn_forward_legacy (line 399) | def llama_varlen_attn_forward_legacy( FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/mistral.py class MistralRotaryEmbedding (line 32) | class MistralRotaryEmbedding(nn.Module): method __init__ (line 34) | def __init__(self, method _set_cos_sin_cache (line 53) | def _set_cos_sin_cache(self, seq_len, device, dtype): method forward (line 64) | def forward(self, x, seq_len=None): function repeat_kv_bshd (line 78) | def repeat_kv_bshd(hidden_states: torch.Tensor, n_rep: int) -> torch.Ten... function mistral_attn_forward (line 92) | def mistral_attn_forward( function mistral_varlen_attn_forward (line 241) | def mistral_varlen_attn_forward( FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/phi3.py class Cache (line 18) | class Cache: function repeat_kv (line 40) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: function rotate_half (line 59) | def rotate_half(x): function apply_rotary_pos_emb (line 67) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_di... function phi3_attn_forward (line 94) | def phi3_attn_forward( function phi3_varlen_attn_forward (line 261) | def phi3_varlen_attn_forward( FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/qwen2.py function qwen2_attn_forward (line 30) | def qwen2_attn_forward( function qwen2_varlen_attn_forward (line 177) | def qwen2_varlen_attn_forward( FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/triton_kernels/layer_norm.py function layer_norm_forward (line 6) | def layer_norm_forward(self, hidden_states): FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/triton_kernels/rms_norm.py function _rms_norm_fwd_fused (line 8) | def _rms_norm_fwd_fused( function _rms_norm_bwd_dx_fused (line 45) | def _rms_norm_bwd_dx_fused( function _rms_norm_bwd_dwdb (line 100) | def _rms_norm_bwd_dwdb( class RMSNorm (line 122) | class RMSNorm(torch.autograd.Function): method forward (line 125) | def forward(ctx, x, weight, eps): method backward (line 159) | def backward(ctx, dy): function rms_norm_forward (line 214) | def rms_norm_forward(self, hidden_states): FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/triton_kernels/rotary.py function rotary_kernel (line 11) | def rotary_kernel( function apply_rotary (line 163) | def apply_rotary( class ApplyRotaryEmb (line 265) | class ApplyRotaryEmb(torch.autograd.Function): method forward (line 268) | def forward( method backward (line 302) | def backward(ctx, do): FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/utils.py function _get_unpad_data (line 10) | def _get_unpad_data(attention_mask): function upad_qkv (line 23) | def upad_qkv(query_layer, key_layer, value_layer, attention_mask, FILE: xtuner-eval_niah/xtuner/model/modules/dispatch/yi.py function rotate_half (line 8) | def rotate_half(x): function apply_rotary_pos_emb (line 15) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids): function repeat_kv (line 27) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: function yi_attn_forward (line 45) | def yi_attn_forward( FILE: xtuner-eval_niah/xtuner/model/modules/projector/configuration_projector.py class ProjectorConfig (line 5) | class ProjectorConfig(PretrainedConfig): method __init__ (line 9) | def __init__( FILE: xtuner-eval_niah/xtuner/model/modules/projector/modeling_projector.py class ProjectorModel (line 10) | class ProjectorModel(PreTrainedModel): method __init__ (line 16) | def __init__(self, config: ProjectorConfig) -> None: method enable_input_require_grads (line 35) | def enable_input_require_grads(self): method _set_gradient_checkpointing (line 42) | def _set_gradient_checkpointing(self, module, value=False): method forward (line 46) | def forward(self, x): FILE: xtuner-eval_niah/xtuner/model/orpo.py class ORPO (line 17) | class ORPO(SupervisedFinetune): method __init__ (line 25) | def __init__(self, *args, beta=0.1, **kwargs): method _gather_masked_logits (line 29) | def _gather_masked_logits(self, logits, labels, mask): method get_logps (line 35) | def get_logps( method get_var_len_atten_logps (line 56) | def get_var_len_atten_logps(self, all_logits, average_log_prob, labels, method cross_entropy_loss (line 94) | def cross_entropy_loss(self, logits, labels): method odds_ratio_loss (line 106) | def odds_ratio_loss( method _split_for_sequence_parallel (line 127) | def _split_for_sequence_parallel(data): method compute_loss (line 139) | def compute_loss(self, data, data_samples=None): FILE: xtuner-eval_niah/xtuner/model/reward.py function reduce_mean (line 35) | def reduce_mean(tensor): function smart_tokenizer_and_embedding_resize (line 44) | def smart_tokenizer_and_embedding_resize( class RewardModel (line 87) | class RewardModel(BaseModel): method __init__ (line 89) | def __init__( method gradient_checkpointing_enable (line 157) | def gradient_checkpointing_enable(self): method activation_checkpointing_enable (line 160) | def activation_checkpointing_enable(self): method gradient_checkpointing_disable (line 163) | def gradient_checkpointing_disable(self): method activation_checkpointing_disable (line 166) | def activation_checkpointing_disable(self): method _prepare_for_lora (line 169) | def _prepare_for_lora(self, method init_weights (line 182) | def init_weights(self): method _prepare_for_long_context_training (line 186) | def _prepare_for_long_context_training(cfg, llm_cfg, method _prepare_for_flash_attn (line 211) | def _prepare_for_flash_attn(cfg, llm_cfg): method _prepare_for_qlora_zero3 (line 240) | def _prepare_for_qlora_zero3(cfg): method _dispatch_lm_model_cfg (line 256) | def _dispatch_lm_model_cfg(self, cfg, max_position_embeddings=None): method _build_from_cfg_or_module (line 267) | def _build_from_cfg_or_module(self, cfg_or_mod): method forward (line 276) | def forward(self, data, data_samples=None, mode='loss'): method _forward (line 287) | def _forward(self, data, data_samples=None): method predict (line 292) | def predict(self, data, data_samples=None): method _split_for_sequence_parallel (line 299) | def _split_for_sequence_parallel(data): method compute_loss (line 311) | def compute_loss(self, data, labels=None): method ranking_loss (line 381) | def ranking_loss(self, chosen_logits, rejected_logits, avg_factor): method focal_loss (line 385) | def focal_loss(self, chosen_logits, rejected_logits, avg_factor): method log_barrier_penalty (line 394) | def log_barrier_penalty(self, method l2_penalty (line 408) | def l2_penalty(self, logits, avg_factor=1): method state_dict (line 411) | def state_dict(self, *args, **kwargs): method __getattr__ (line 418) | def __getattr__(self, name: str): method to_hf (line 424) | def to_hf(self, FILE: xtuner-eval_niah/xtuner/model/sft.py function smart_tokenizer_and_embedding_resize (line 28) | def smart_tokenizer_and_embedding_resize( class SupervisedFinetune (line 71) | class SupervisedFinetune(BaseModel): method __init__ (line 73) | def __init__(self, method gradient_checkpointing_enable (line 122) | def gradient_checkpointing_enable(self): method activation_checkpointing_enable (line 125) | def activation_checkpointing_enable(self): method gradient_checkpointing_disable (line 128) | def gradient_checkpointing_disable(self): method activation_checkpointing_disable (line 131) | def activation_checkpointing_disable(self): method _prepare_for_lora (line 134) | def _prepare_for_lora(self, method init_weights (line 147) | def init_weights(self): method _prepare_for_long_context_training (line 151) | def _prepare_for_long_context_training(cfg, llm_cfg, method _prepare_for_flash_attn (line 176) | def _prepare_for_flash_attn(cfg, llm_cfg): method _prepare_for_qlora_zero3 (line 206) | def _prepare_for_qlora_zero3(cfg): method _dispatch_lm_model_cfg (line 222) | def _dispatch_lm_model_cfg(self, cfg, max_position_embeddings=None): method _build_from_cfg_or_module (line 233) | def _build_from_cfg_or_module(self, cfg_or_mod): method forward (line 242) | def forward(self, data, data_samples=None, mode='loss'): method _forward (line 253) | def _forward(self, data, data_samples=None): method predict (line 259) | def predict(self, data, data_samples=None): method _split_for_sequence_parallel (line 265) | def _split_for_sequence_parallel(data): method _compute_sequence_parallel_loss (line 277) | def _compute_sequence_parallel_loss(self, data): method compute_loss (line 287) | def compute_loss(self, data, data_samples=None): method state_dict (line 295) | def state_dict(self, *args, **kwargs): method __getattr__ (line 302) | def __getattr__(self, name: str): method to_hf (line 308) | def to_hf(self, FILE: xtuner-eval_niah/xtuner/model/transformers_models/deepseek_v2/configuration_deepseek.py class DeepseekV2Config (line 11) | class DeepseekV2Config(PretrainedConfig): method __init__ (line 124) | def __init__( FILE: xtuner-eval_niah/xtuner/model/transformers_models/deepseek_v2/modeling_deepseek.py function _get_unpad_data (line 76) | def _get_unpad_data(attention_mask): class DeepseekV2RMSNorm (line 89) | class DeepseekV2RMSNorm(nn.Module): method __init__ (line 91) | def __init__(self, hidden_size, eps=1e-6): method forward (line 97) | def forward(self, hidden_states): class DeepseekV2RotaryEmbedding (line 109) | class DeepseekV2RotaryEmbedding(nn.Module): method __init__ (line 111) | def __init__(self, method _set_cos_sin_cache (line 134) | def _set_cos_sin_cache(self, seq_len, device, dtype): method forward (line 147) | def forward(self, x, seq_len=None): class DeepseekV2LinearScalingRotaryEmbedding (line 160) | class DeepseekV2LinearScalingRotaryEmbedding(DeepseekV2RotaryEmbedding): method __init__ (line 166) | def __init__( method _set_cos_sin_cache (line 177) | def _set_cos_sin_cache(self, seq_len, device, dtype): class DeepseekV2DynamicNTKScalingRotaryEmbedding (line 193) | class DeepseekV2DynamicNTKScalingRotaryEmbedding(DeepseekV2RotaryEmbeddi... method __init__ (line 199) | def __init__( method _set_cos_sin_cache (line 210) | def _set_cos_sin_cache(self, seq_len, device, dtype): function yarn_find_correction_dim (line 236) | def yarn_find_correction_dim(num_rotations, function yarn_find_correction_range (line 246) | def yarn_find_correction_range(low_rot, function yarn_get_mscale (line 258) | def yarn_get_mscale(scale=1, mscale=1): function yarn_linear_ramp_mask (line 264) | def yarn_linear_ramp_mask(min, max, dim): class DeepseekV2YarnRotaryEmbedding (line 273) | class DeepseekV2YarnRotaryEmbedding(DeepseekV2RotaryEmbedding): method __init__ (line 275) | def __init__( method _set_cos_sin_cache (line 296) | def _set_cos_sin_cache(self, seq_len, device, dtype): function rotate_half (line 336) | def rotate_half(x): function apply_rotary_pos_emb (line 344) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids, unsqueeze_dim=1): class DeepseekV2MLP (line 379) | class DeepseekV2MLP(nn.Module): method __init__ (line 381) | def __init__(self, config, hidden_size=None, intermediate_size=None): method forward (line 397) | def forward(self, x): class MoEGate (line 403) | class MoEGate(nn.Module): method __init__ (line 405) | def __init__(self, config): method reset_parameters (line 425) | def reset_parameters(self) -> None: method forward (line 430) | def forward(self, hidden_states): class AddAuxiliaryLoss (line 502) | class AddAuxiliaryLoss(torch.autograd.Function): method forward (line 507) | def forward(ctx, x, loss): method backward (line 514) | def backward(ctx, grad_output): class ExpertShard (line 522) | class ExpertShard(nn.Module): method __init__ (line 524) | def __init__(self, config, shard_idx, expert_in_one_shard=10): method reset_parameters (line 539) | def reset_parameters(self) -> None: method expert_forward (line 545) | def expert_forward(self, current_state, expert_idx): method forward (line 555) | def forward(self, hidden_states, flat_topk_idx, y): class DeepseekV2MoEShard (line 563) | class DeepseekV2MoEShard(nn.Module): method __init__ (line 566) | def __init__(self, config): method forward (line 597) | def forward(self, hidden_states): class DeepseekV2MoE (line 623) | class DeepseekV2MoE(nn.Module): method __init__ (line 626) | def __init__(self, config): method forward (line 658) | def forward(self, hidden_states): method moe_infer (line 684) | def moe_infer(self, x, topk_ids, topk_weight): function repeat_kv (line 754) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class DeepseekV2Attention (line 773) | class DeepseekV2Attention(nn.Module): method __init__ (line 776) | def __init__(self, method _init_rope (line 845) | def _init_rope(self): method _shape (line 890) | def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int): method forward (line 894) | def forward( class DeepseekV2FlashAttention2 (line 999) | class DeepseekV2FlashAttention2(DeepseekV2Attention): method __init__ (line 1008) | def __init__(self, *args, **kwargs): method forward (line 1017) | def forward( method _flash_attention_forward (line 1146) | def _flash_attention_forward( method _upad_input (line 1224) | def _upad_input(self, query_layer, key_layer, value_layer, attention_m... class DeepseekV2DecoderLayer (line 1278) | class DeepseekV2DecoderLayer(nn.Module): method __init__ (line 1280) | def __init__(self, config: DeepseekV2Config, layer_idx: int): method forward (line 1305) | def forward( function _load_pretrained_model (line 1367) | def _load_pretrained_model( class DeepseekV2PreTrainedModel (line 1421) | class DeepseekV2PreTrainedModel(PreTrainedModel): method _init_weights (line 1431) | def _init_weights(self, module): method from_pretrained (line 1443) | def from_pretrained(cls, pretrained_model_name_or_path, *args, **kwargs): class DeepseekV2Model (line 1529) | class DeepseekV2Model(DeepseekV2PreTrainedModel): method __init__ (line 1537) | def __init__(self, config: DeepseekV2Config): method get_input_embeddings (line 1557) | def get_input_embeddings(self): method set_input_embeddings (line 1560) | def set_input_embeddings(self, value): method forward (line 1564) | def forward( class DeepseekV2ForCausalLM (line 1718) | class DeepseekV2ForCausalLM(DeepseekV2PreTrainedModel): method __init__ (line 1721) | def __init__(self, config): method get_input_embeddings (line 1731) | def get_input_embeddings(self): method set_input_embeddings (line 1734) | def set_input_embeddings(self, value): method get_output_embeddings (line 1737) | def get_output_embeddings(self): method set_output_embeddings (line 1740) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 1743) | def set_decoder(self, decoder): method get_decoder (line 1746) | def get_decoder(self): method forward (line 1752) | def forward( method prepare_inputs_for_generation (line 1842) | def prepare_inputs_for_generation( method _reorder_cache (line 1901) | def _reorder_cache(past_key_values, beam_idx): class DeepseekV2ForSequenceClassification (line 1925) | class DeepseekV2ForSequenceClassification(DeepseekV2PreTrainedModel): method __init__ (line 1927) | def __init__(self, config): method get_input_embeddings (line 1936) | def get_input_embeddings(self): method set_input_embeddings (line 1939) | def set_input_embeddings(self, value): method forward (line 1943) | def forward( FILE: xtuner-eval_niah/xtuner/model/transformers_models/deepseek_v2/tokenization_deepseek_fast.py class DeepseekTokenizerFast (line 6) | class DeepseekTokenizerFast(LlamaTokenizerFast): method convert_ids_to_tokens (line 8) | def convert_ids_to_tokens( method _convert_id_to_token (line 35) | def _convert_id_to_token(self, index: int) -> Optional[str]: FILE: xtuner-eval_niah/xtuner/model/transformers_models/mixtral/configuration_mixtral.py class MixtralConfig (line 22) | class MixtralConfig(PretrainedConfig): method __init__ (line 114) | def __init__( FILE: xtuner-eval_niah/xtuner/model/transformers_models/mixtral/modeling_mixtral.py function load_balancing_loss_func (line 56) | def load_balancing_loss_func( function _get_unpad_data (line 138) | def _get_unpad_data(attention_mask): class MixtralRMSNorm (line 152) | class MixtralRMSNorm(nn.Module): method __init__ (line 154) | def __init__(self, hidden_size, eps=1e-6): method forward (line 160) | def forward(self, hidden_states): class MixtralRotaryEmbedding (line 170) | class MixtralRotaryEmbedding(nn.Module): method __init__ (line 172) | def __init__(self, method _set_cos_sin_cache (line 194) | def _set_cos_sin_cache(self, seq_len, device, dtype): method forward (line 208) | def forward(self, x, seq_len=None): function rotate_half (line 221) | def rotate_half(x): function apply_rotary_pos_emb (line 229) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids, unsqueeze_dim=1): function repeat_kv (line 258) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class MixtralAttention (line 277) | class MixtralAttention(nn.Module): method __init__ (line 284) | def __init__(self, config: MixtralConfig, layer_idx: Optional[int] = N... method _shape (line 327) | def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int): method forward (line 331) | def forward( class MixtralFlashAttention2 (line 416) | class MixtralFlashAttention2(MixtralAttention): method __init__ (line 426) | def __init__(self, *args, **kwargs): method forward (line 435) | def forward( method _flash_attention_forward (line 567) | def _flash_attention_forward( method _upad_input (line 670) | def _upad_input(self, query_layer, key_layer, value_layer, attention_m... class MixtralSdpaAttention (line 722) | class MixtralSdpaAttention(MixtralAttention): method forward (line 732) | def forward( class MixtralBlockSparseTop2MLP (line 825) | class MixtralBlockSparseTop2MLP(nn.Module): method __init__ (line 827) | def __init__(self, config: MixtralConfig): method forward (line 838) | def forward(self, hidden_states): class MixtralSparseMoeBlock (line 845) | class MixtralSparseMoeBlock(nn.Module): method __init__ (line 856) | def __init__(self, config): method forward (line 873) | def forward(self, hidden_states: torch.Tensor) -> torch.Tensor: class ExpertShard (line 921) | class ExpertShard(nn.Module): method __init__ (line 923) | def __init__(self, config, expert_in_one_shard=1): method forward (line 934) | def forward(self, hidden_states, expert_mask, routing_weights, class MixtralSparseShardMoeBlock (line 955) | class MixtralSparseShardMoeBlock(nn.Module): method __init__ (line 957) | def __init__(self, config): method forward (line 981) | def forward(self, hidden_states: torch.Tensor) -> torch.Tensor: class MixtralDecoderLayer (line 1021) | class MixtralDecoderLayer(nn.Module): method __init__ (line 1023) | def __init__(self, config: MixtralConfig, layer_idx: int): method forward (line 1044) | def forward( function _load_pretrained_model (line 1107) | def _load_pretrained_model( class MixtralPreTrainedModel (line 1162) | class MixtralPreTrainedModel(PreTrainedModel): method _init_weights (line 1172) | def _init_weights(self, module): method from_pretrained (line 1184) | def from_pretrained(cls, pretrained_model_name_or_path, *args, **kwargs): class MixtralModel (line 1268) | class MixtralModel(MixtralPreTrainedModel): method __init__ (line 1276) | def __init__(self, config: MixtralConfig): method get_input_embeddings (line 1294) | def get_input_embeddings(self): method set_input_embeddings (line 1297) | def set_input_embeddings(self, value): method forward (line 1302) | def forward( class MixtralForCausalLM (line 1475) | class MixtralForCausalLM(MixtralPreTrainedModel): method __init__ (line 1478) | def __init__(self, config): method get_input_embeddings (line 1490) | def get_input_embeddings(self): method set_input_embeddings (line 1493) | def set_input_embeddings(self, value): method get_output_embeddings (line 1496) | def get_output_embeddings(self): method set_output_embeddings (line 1499) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 1502) | def set_decoder(self, decoder): method get_decoder (line 1505) | def get_decoder(self): method forward (line 1512) | def forward( method prepare_inputs_for_generation (line 1621) | def prepare_inputs_for_generation( method _reorder_cache (line 1683) | def _reorder_cache(past_key_values, beam_idx): class MixtralForSequenceClassification (line 1708) | class MixtralForSequenceClassification(MixtralPreTrainedModel): method __init__ (line 1710) | def __init__(self, config): method get_input_embeddings (line 1719) | def get_input_embeddings(self): method set_input_embeddings (line 1722) | def set_input_embeddings(self, value): method forward (line 1726) | def forward( FILE: xtuner-eval_niah/xtuner/model/utils.py function set_obj_dtype (line 14) | def set_obj_dtype(d): function try_build_module (line 20) | def try_build_module(cfg): function traverse_dict (line 33) | def traverse_dict(d): function find_all_linear_names (line 47) | def find_all_linear_names(model): class LoadWoInit (line 61) | class LoadWoInit: method __init__ (line 64) | def __init__(self): method __enter__ (line 73) | def __enter__(self, *args, **kwargs): method __exit__ (line 82) | def __exit__(self, *args, **kwargs): function get_peft_model_state_dict (line 92) | def get_peft_model_state_dict(model, state_dict=None, adapter_name='defa... function prepare_inputs_labels_for_multimodal (line 138) | def prepare_inputs_labels_for_multimodal( function make_inputs_require_grad (line 293) | def make_inputs_require_grad(module, input, output): function guess_load_checkpoint (line 297) | def guess_load_checkpoint(pth_model): FILE: xtuner-eval_niah/xtuner/parallel/sequence/attention.py function pre_process_for_sequence_parallel_attn (line 16) | def pre_process_for_sequence_parallel_attn(query_states, function post_process_for_sequence_parallel_attn (line 96) | def post_process_for_sequence_parallel_attn(attn_output, function sequence_parallel_wrapper (line 130) | def sequence_parallel_wrapper(local_attn): FILE: xtuner-eval_niah/xtuner/parallel/sequence/comm.py function _all_to_all (line 9) | def _all_to_all( class _AllToAll (line 25) | class _AllToAll(torch.autograd.Function): method forward (line 36) | def forward(ctx: Any, input: Tensor, sp_group: dist.ProcessGroup, method backward (line 47) | def backward(ctx: Any, grad_output: Tensor) -> Tuple: function all_to_all (line 63) | def all_to_all( function split_for_sequence_parallel (line 90) | def split_for_sequence_parallel(input, dim: int, sp_group: dist.ProcessG... function gather_for_sequence_parallel (line 117) | def gather_for_sequence_parallel(input, dim: int, sp_group: dist.Process... class _GatherForwardSplitBackward (line 144) | class _GatherForwardSplitBackward(torch.autograd.Function): method forward (line 152) | def forward(ctx, input, dim, sp_group, grad_scale): method backward (line 159) | def backward(ctx, grad_output): class _SplitForwardGatherBackward (line 169) | class _SplitForwardGatherBackward(torch.autograd.Function): method forward (line 177) | def forward(ctx, input, dim, sp_group, grad_scale): method backward (line 184) | def backward(ctx, grad_output): function split_forward_gather_backward (line 193) | def split_forward_gather_backward(input, dim, sp_group, grad_scale=None): function gather_forward_split_backward (line 207) | def gather_forward_split_backward(input, dim, sp_group, grad_scale=None): FILE: xtuner-eval_niah/xtuner/parallel/sequence/data_collate.py function pad_for_sequence_parallel (line 7) | def pad_for_sequence_parallel(tensor, padding_value, dim=-1): function pad_cumulative_len_for_sequence_parallel (line 26) | def pad_cumulative_len_for_sequence_parallel(cumulative_len): FILE: xtuner-eval_niah/xtuner/parallel/sequence/reduce_loss.py class _ReduceLoss (line 7) | class _ReduceLoss(torch.autograd.Function): method forward (line 10) | def forward(ctx, mean_loss, loss_scale, process_group): method backward (line 22) | def backward(ctx, grad_output): function reduce_sequence_parallel_loss (line 26) | def reduce_sequence_parallel_loss(mean_loss, FILE: xtuner-eval_niah/xtuner/parallel/sequence/sampler.py class SequenceParallelSampler (line 12) | class SequenceParallelSampler(DefaultSampler): method __init__ (line 14) | def __init__(self, FILE: xtuner-eval_niah/xtuner/parallel/sequence/setup_distributed.py function init_sequence_parallel (line 17) | def init_sequence_parallel(sequence_parallel_size: int = 1): function init_inner_sequence_parallel (line 56) | def init_inner_sequence_parallel(inner_sequence_parallel_size: int = 1): function is_inner_sequence_parallel_initialized (line 82) | def is_inner_sequence_parallel_initialized(): function get_inner_sequence_parallel_group (line 86) | def get_inner_sequence_parallel_group(): function get_inner_sequence_parallel_world_size (line 90) | def get_inner_sequence_parallel_world_size(): function get_inner_sequence_parallel_rank (line 102) | def get_inner_sequence_parallel_rank(): function get_sequence_parallel_group (line 114) | def get_sequence_parallel_group(): function get_sequence_parallel_world_size (line 119) | def get_sequence_parallel_world_size(): function get_sequence_parallel_rank (line 132) | def get_sequence_parallel_rank(): function get_data_parallel_group (line 145) | def get_data_parallel_group(): function get_data_parallel_world_size (line 152) | def get_data_parallel_world_size(): function get_data_parallel_rank (line 165) | def get_data_parallel_rank(): FILE: xtuner-eval_niah/xtuner/tools/chat.py function remove_prefix (line 26) | def remove_prefix(state_dict, prefix): function parse_args (line 37) | def parse_args(): function get_input (line 131) | def get_input(): function main (line 146) | def main(): FILE: xtuner-eval_niah/xtuner/tools/check_custom_dataset.py function parse_args (line 13) | def parse_args(): function is_standard_format (line 22) | def is_standard_format(dataset): function main (line 40) | def main(): FILE: xtuner-eval_niah/xtuner/tools/copy_cfg.py function parse_args (line 11) | def parse_args(): function add_copy_suffix (line 19) | def add_copy_suffix(string): function main (line 24) | def main(): FILE: xtuner-eval_niah/xtuner/tools/data_preprocess/arxiv.py function parse_args (line 7) | def parse_args(): function has_intersection (line 25) | def has_intersection(list1, list2): function read_json_file (line 31) | def read_json_file(file_path): function main (line 43) | def main(): FILE: xtuner-eval_niah/xtuner/tools/data_preprocess/convert_refcoco.py function parse_args (line 8) | def parse_args(): FILE: xtuner-eval_niah/xtuner/tools/eval_refcoco.py function merge_outputs (line 31) | def merge_outputs(otuputs): function master_print (line 44) | def master_print(msg): function parse_args (line 48) | def parse_args(): function eval_iou (line 110) | def eval_iou(answers): function build_model (line 143) | def build_model(args): function generate (line 233) | def generate( function main (line 299) | def main(): FILE: xtuner-eval_niah/xtuner/tools/get_data_order.py function parse_args (line 6) | def parse_args(): function save_data_order (line 18) | def save_data_order(data_folder, save_folder, file_type='.bin'): FILE: xtuner-eval_niah/xtuner/tools/list_cfg.py function parse_args (line 7) | def parse_args(): function main (line 15) | def main(pattern=None): FILE: xtuner-eval_niah/xtuner/tools/list_dataset_format.py function main (line 5) | def main(): FILE: xtuner-eval_niah/xtuner/tools/log_dataset.py function parse_args (line 9) | def parse_args(): function main (line 22) | def main(): FILE: xtuner-eval_niah/xtuner/tools/mmbench.py function parse_args (line 38) | def parse_args(): function master_print (line 95) | def master_print(msg): class MMBenchDataset (line 99) | class MMBenchDataset(Dataset): method __init__ (line 116) | def __init__(self, data_file): method get_image (line 122) | def get_image(self, image): method __len__ (line 130) | def __len__(self): method __getitem__ (line 133) | def __getitem__(self, idx): method load_from_df (line 166) | def load_from_df(self, idx, key): method eval_result (line 173) | def eval_result(self, result_df, show=True): function main (line 271) | def main(): FILE: xtuner-eval_niah/xtuner/tools/model_converters/merge.py function parse_args (line 12) | def parse_args(): function main (line 43) | def main(): FILE: xtuner-eval_niah/xtuner/tools/model_converters/modeling_internlm2_reward/configuration_internlm2.py class InternLM2Config (line 28) | class InternLM2Config(PretrainedConfig): method __init__ (line 78) | def __init__( # pylint: disable=W0102 method _rope_scaling_validation (line 135) | def _rope_scaling_validation(self): FILE: xtuner-eval_niah/xtuner/tools/model_converters/modeling_internlm2_reward/modeling_internlm2.py function _import_flash_attn (line 56) | def _import_flash_attn(): function _get_unpad_data (line 68) | def _get_unpad_data(attention_mask): function _make_causal_mask (line 81) | def _make_causal_mask( function _expand_mask (line 99) | def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Option... class InternLM2RMSNorm (line 114) | class InternLM2RMSNorm(nn.Module): method __init__ (line 115) | def __init__(self, hidden_size, eps=1e-6): method forward (line 123) | def forward(self, hidden_states): class InternLM2RotaryEmbedding (line 132) | class InternLM2RotaryEmbedding(nn.Module): method __init__ (line 133) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method _set_cos_sin_cache (line 147) | def _set_cos_sin_cache(self, seq_len, device, dtype): method forward (line 157) | def forward(self, x, seq_len=None): class InternLM2LinearScalingRotaryEmbedding (line 169) | class InternLM2LinearScalingRotaryEmbedding(InternLM2RotaryEmbedding): method __init__ (line 172) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method _set_cos_sin_cache (line 176) | def _set_cos_sin_cache(self, seq_len, device, dtype): class InternLM2DynamicNTKScalingRotaryEmbedding (line 189) | class InternLM2DynamicNTKScalingRotaryEmbedding(InternLM2RotaryEmbedding): method __init__ (line 194) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method _set_cos_sin_cache (line 198) | def _set_cos_sin_cache(self, seq_len, device, dtype): function rotate_half (line 218) | def rotate_half(x): function apply_rotary_pos_emb (line 226) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids, unsqueeze_dim=1): class InternLM2MLP (line 235) | class InternLM2MLP(nn.Module): method __init__ (line 236) | def __init__(self, config): method forward (line 246) | def forward(self, x): function repeat_kv (line 253) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class InternLM2Attention (line 266) | class InternLM2Attention(nn.Module): method __init__ (line 269) | def __init__(self, config: InternLM2Config): method _init_rope (line 295) | def _init_rope(self): method _shape (line 323) | def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int): method forward (line 326) | def forward( class InternLM2FlashAttention2 (line 415) | class InternLM2FlashAttention2(InternLM2Attention): method forward (line 422) | def forward( method _flash_attention_forward (line 494) | def _flash_attention_forward( method _unpad_input (line 548) | def _unpad_input(self, query_layer, key_layer, value_layer, attention_... class InternLM2DecoderLayer (line 593) | class InternLM2DecoderLayer(nn.Module): method __init__ (line 594) | def __init__(self, config: InternLM2Config): method forward (line 604) | def forward( class InternLM2PreTrainedModel (line 689) | class InternLM2PreTrainedModel(PreTrainedModel): method _init_weights (line 696) | def _init_weights(self, module): class InternLM2Model (line 778) | class InternLM2Model(InternLM2PreTrainedModel): method __init__ (line 788) | def __init__(self, config: InternLM2Config): method get_input_embeddings (line 803) | def get_input_embeddings(self): method set_input_embeddings (line 806) | def set_input_embeddings(self, value): method _prepare_decoder_attention_mask (line 809) | def _prepare_decoder_attention_mask(self, attention_mask, input_shape,... method forward (line 833) | def forward( class InternLM2ForCausalLM (line 967) | class InternLM2ForCausalLM(InternLM2PreTrainedModel): method __init__ (line 972) | def __init__(self, config): method get_input_embeddings (line 981) | def get_input_embeddings(self): method set_input_embeddings (line 984) | def set_input_embeddings(self, value): method get_output_embeddings (line 987) | def get_output_embeddings(self): method set_output_embeddings (line 990) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 993) | def set_decoder(self, decoder): method get_decoder (line 996) | def get_decoder(self): method forward (line 1001) | def forward( method prepare_inputs_for_generation (line 1088) | def prepare_inputs_for_generation( method _reorder_cache (line 1128) | def _reorder_cache(past_key_values, beam_idx): method build_inputs (line 1136) | def build_inputs(self, tokenizer, query: str, history: List[Tuple[str,... method chat (line 1149) | def chat( method stream_chat (line 1185) | def stream_chat( class InternLM2ForRewardModel (line 1271) | class InternLM2ForRewardModel(InternLM2PreTrainedModel): method __init__ (line 1276) | def __init__(self, config): method get_input_embeddings (line 1286) | def get_input_embeddings(self): method set_input_embeddings (line 1289) | def set_input_embeddings(self, value): method get_output_embeddings (line 1292) | def get_output_embeddings(self): method set_output_embeddings (line 1295) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 1298) | def set_decoder(self, decoder): method get_decoder (line 1301) | def get_decoder(self): method forward (line 1306) | def forward( method get_score (line 1386) | def get_score( method get_scores (line 1403) | def get_scores( method compare (line 1428) | def compare( method rank (line 1444) | def rank( class InternLM2ForSequenceClassification (line 1474) | class InternLM2ForSequenceClassification(InternLM2PreTrainedModel): method __init__ (line 1475) | def __init__(self, config): method get_input_embeddings (line 1484) | def get_input_embeddings(self): method set_input_embeddings (line 1487) | def set_input_embeddings(self, value): method forward (line 1491) | def forward( FILE: xtuner-eval_niah/xtuner/tools/model_converters/pth_to_hf.py function parse_args (line 20) | def parse_args(): function main (line 60) | def main(): FILE: xtuner-eval_niah/xtuner/tools/model_converters/split.py function parse_args (line 13) | def parse_args(): function main (line 22) | def main(): FILE: xtuner-eval_niah/xtuner/tools/plugins/api.py function plugins_api (line 5) | def plugins_api(input_str, FILE: xtuner-eval_niah/xtuner/tools/plugins/calculate.py function Calculate (line 5) | def Calculate(expression): FILE: xtuner-eval_niah/xtuner/tools/plugins/search.py function parse_results (line 15) | def parse_results(results, k=10): function search (line 26) | def search(api_key, search_term, **kwargs): function Search (line 47) | def Search(q, k=10): FILE: xtuner-eval_niah/xtuner/tools/plugins/solve.py function Solve (line 11) | def Solve(equations_str): FILE: xtuner-eval_niah/xtuner/tools/process_untokenized_datasets.py function parse_args (line 15) | def parse_args(): function modify_config (line 23) | def modify_config(config, dataset_save_folder): function process_untokenized_dataset (line 45) | def process_untokenized_dataset(config): FILE: xtuner-eval_niah/xtuner/tools/process_untokenized_datasets_legacy.py function parse_args (line 42) | def parse_args(): function process_one (line 78) | def process_one(fp, function process_untokenized_dataset (line 109) | def process_untokenized_dataset(folder, FILE: xtuner-eval_niah/xtuner/tools/process_untokenized_llava_data.py function parse_args (line 13) | def parse_args(): function build_llava_dataset (line 21) | def build_llava_dataset(config): FILE: xtuner-eval_niah/xtuner/tools/test.py function parse_args (line 16) | def parse_args(): function register_function (line 45) | def register_function(cfg_dict): function main (line 60) | def main(): FILE: xtuner-eval_niah/xtuner/tools/tokenize_ftdp_datasets.py function chatml_format (line 95) | def chatml_format( function write_bin_meta_bin (line 271) | def write_bin_meta_bin(path, dataset_name, filename, samples): function tokenize_and_save (line 320) | def tokenize_and_save(tokenizer, processed_dir, tokenized_dir): function tokenizer_add_special_tokens (line 389) | def tokenizer_add_special_tokens(tokenizer): function save_new_tokenizer (line 397) | def save_new_tokenizer(tokenizer, save_dir): function parse_args (line 402) | def parse_args(): function main (line 419) | def main(): FILE: xtuner-eval_niah/xtuner/tools/train.py function parse_args (line 29) | def parse_args(): function register_function (line 65) | def register_function(cfg_dict): function check_cfg (line 80) | def check_cfg(cfg, args): function main (line 127) | def main(): FILE: xtuner-eval_niah/xtuner/tools/utils.py function get_base_model (line 13) | def get_base_model(model): function get_streamer (line 21) | def get_streamer(model): class DecodeOutputStreamer (line 41) | class DecodeOutputStreamer(BaseStreamer): method __init__ (line 44) | def __init__(self, tokenizer, skip_prompt=True) -> None: method _decode_with_raw_id (line 59) | def _decode_with_raw_id(self, value): method _decode_fallback (line 74) | def _decode_fallback(self, value): method put (line 83) | def put(self, value): method end (line 94) | def end(self): class NoSpaceStreamer (line 100) | class NoSpaceStreamer(DecodeOutputStreamer): method __init__ (line 102) | def __init__(self, tokenizer, skip_prompt=True) -> None: method decode (line 113) | def decode(self, value): function get_stop_criteria (line 123) | def get_stop_criteria( function auto_dtype_of_deepspeed_config (line 133) | def auto_dtype_of_deepspeed_config(ds_config): function is_cn_string (line 152) | def is_cn_string(s): function get_seed_from_checkpoint (line 158) | def get_seed_from_checkpoint(pth_model): FILE: xtuner-eval_niah/xtuner/utils/fileio.py function patch_func (line 8) | def patch_func(module, fn_name_to_wrap): function patch_fileio (line 23) | def patch_fileio(global_vars=None): function patch_hf_auto_from_pretrained (line 231) | def patch_hf_auto_from_pretrained(petrel_hub): function patch_hf_save_pretrained (line 279) | def patch_hf_save_pretrained(): function patch_deepspeed_engine (line 320) | def patch_deepspeed_engine(): FILE: xtuner-eval_niah/xtuner/utils/handle_moe_load_and_save.py function print_on_rank0 (line 32) | def print_on_rank0(info): function get_expert_num_per_shard (line 37) | def get_expert_num_per_shard(model): function mix_sort (line 43) | def mix_sort(expert_name): function _get_merged_param_name (line 49) | def _get_merged_param_name(origin_param_name, expert_num_per_shard): function _merge_experts_weight (line 60) | def _merge_experts_weight(state_dict, expert_num_per_shard, order_mapping): function load_state_dict_into_model (line 99) | def load_state_dict_into_model(model_to_load, pretrained_model_path): function _get_origin_param_name (line 172) | def _get_origin_param_name(merged_param_name, expert_num_per_shard, is_w... function _split_param (line 197) | def _split_param(merged_param, is_w1w3): function get_origin_state_dict (line 207) | def get_origin_state_dict(state_dict, model): FILE: xtuner-eval_niah/xtuner/utils/stop_criteria.py class StopWordStoppingCriteria (line 5) | class StopWordStoppingCriteria(StoppingCriteria): method __init__ (line 8) | def __init__(self, tokenizer, stop_word): method __call__ (line 13) | def __call__(self, input_ids, *args, **kwargs) -> bool: FILE: xtuner-eval_niah/xtuner/utils/zero_to_any_dtype.py class zero_model_state (line 43) | class zero_model_state: function atoi (line 60) | def atoi(text): function natural_keys (line 64) | def natural_keys(text): function get_model_state_file (line 71) | def get_model_state_file(checkpoint_dir, zero_stage): function get_checkpoint_files (line 88) | def get_checkpoint_files(checkpoint_dir, glob_pattern): function get_optim_files (line 102) | def get_optim_files(checkpoint_dir): function get_model_state_files (line 106) | def get_model_state_files(checkpoint_dir): function parse_model_states (line 110) | def parse_model_states(files, dtype=DEFAULT_DTYPE): function parse_optim_states (line 161) | def parse_optim_states(files, ds_checkpoint_dir, dtype=DEFAULT_DTYPE): function _get_state_dict_from_zero_checkpoint (line 217) | def _get_state_dict_from_zero_checkpoint(ds_checkpoint_dir, function _zero2_merge_frozen_params (line 250) | def _zero2_merge_frozen_params(state_dict, zero_model_states): function _has_callable (line 286) | def _has_callable(obj, fn): function _zero2_merge_trainable_params (line 291) | def _zero2_merge_trainable_params(state_dict, world_size, flat_groups, function _get_state_dict_from_zero2_checkpoint (line 378) | def _get_state_dict_from_zero2_checkpoint(world_size, flat_groups, function zero3_partitioned_param_info (line 403) | def zero3_partitioned_param_info(unpartitioned_numel, world_size): function _zero3_merge_frozen_params (line 410) | def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states): function _zero3_merge_trainable_params (line 457) | def _zero3_merge_trainable_params(state_dict, world_size, flat_groups, function _get_state_dict_from_zero3_checkpoint (line 536) | def _get_state_dict_from_zero3_checkpoint(world_size, flat_groups, function get_state_dict_from_zero_checkpoint (line 561) | def get_state_dict_from_zero_checkpoint(checkpoint_dir, function convert_zero_checkpoint_to_state_dict (line 622) | def convert_zero_checkpoint_to_state_dict(checkpoint_dir, function load_state_dict_from_zero_checkpoint (line 648) | def load_state_dict_from_zero_checkpoint(model, FILE: xtuner-eval_niah/xtuner/version.py function parse_version_info (line 6) | def parse_version_info(version_str): FILE: xtuner-train_internvideo2_5/setup.py function readme (line 6) | def readme(): function get_version (line 15) | def get_version(): function parse_requirements (line 21) | def parse_requirements(fname='requirements.txt', with_version=True): FILE: xtuner-train_internvideo2_5/unify_internvl2_train_r16.py function parse_args (line 48) | def parse_args(): class LazyInternVL2Dataset (line 219) | class LazyInternVL2Dataset(BaseOrigDataset): method __init__ (line 220) | def __init__(self, data_name, data, model_name, method calc_group_len (line 283) | def calc_group_len(self): method pre_tokenize_fn_for_pack (line 324) | def pre_tokenize_fn_for_pack(self, data_item): method _get_preprocess_function (line 338) | def _get_preprocess_function(self): method _get_transform (line 354) | def _get_transform(self): method load_image (line 360) | def load_image(self, image_path): method multi_modal_get_item (line 366) | def multi_modal_get_item(self, data_item, pack_data=False): method multi_modal_multi_image_get_item (line 369) | def multi_modal_multi_image_get_item(self, data_item, pack_data=False): method _get_num_frames_by_duration (line 373) | def _get_num_frames_by_duration(self, duration): method video_get_item (line 388) | def video_get_item(self, data_item, pack_data=False): method pure_text_get_item (line 474) | def pure_text_get_item(self, data_item, pack_data=False): method __getitem__ (line 521) | def __getitem__(self, i): function packing_collate (line 544) | def packing_collate(features, pack_batch=True, pad_id=0, sp_size=1): function build_llava_model (line 614) | def build_llava_model(args, dtype=torch.float32, device='cpu'): function build_fsdp_model (line 648) | def build_fsdp_model(rank0_model, meta_model, dp_mesh, tp_mesh, dtype, a... function llava_train (line 716) | def llava_train(args): FILE: xtuner-train_internvideo2_5/xtuner/_lite/__init__.py function get_logger (line 11) | def get_logger(): FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/dispatches/__init__.py function _dispatch_forward_fn (line 9) | def _dispatch_forward_fn(module, dispatch_fn): function dispatch_internlm_varlen_attn_forward (line 13) | def dispatch_internlm_varlen_attn_forward(module): function dispatch_clip_attn_forward (line 20) | def dispatch_clip_attn_forward(module): function dispatch_rms_norm_forward (line 27) | def dispatch_rms_norm_forward(module): function dispatch_phi3_varlen_attn_forward (line 33) | def dispatch_phi3_varlen_attn_forward(module): function dispatch_llama3_varlen_attn_forward (line 40) | def dispatch_llama3_varlen_attn_forward(module): function dispatch_qwen2vl_varlen_attn_forward (line 47) | def dispatch_qwen2vl_varlen_attn_forward(module): function dispatch_internvl2_forward (line 54) | def dispatch_internvl2_forward(module): function dispatch_qwen2_varlen_attn_forward (line 61) | def dispatch_qwen2_varlen_attn_forward(module): function dispatch_internvl2_hico_forward (line 67) | def dispatch_internvl2_hico_forward(module): function dispatch_modules (line 89) | def dispatch_modules(model, exclude_cls=[]): FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/dispatches/_attention.py function _get_unpad_data (line 17) | def _get_unpad_data(attention_mask): function upad_qkv (line 30) | def upad_qkv(query_layer, key_layer, value_layer, attention_mask, function flash_attn_wo_mask (line 75) | def flash_attn_wo_mask( function flash_attn_w_mask (line 96) | def flash_attn_w_mask( function varlen_flash_attn (line 128) | def varlen_flash_attn( FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/dispatches/_fused/layer_norm.py function layer_norm_forward (line 6) | def layer_norm_forward(self, hidden_states): FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/dispatches/_fused/rms_norm.py function rms_norm_forward (line 14) | def rms_norm_forward(self, hidden_states): FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/dispatches/_fused/rotary.py function rotary_kernel (line 11) | def rotary_kernel( function apply_rotary (line 163) | def apply_rotary( class ApplyRotaryEmb (line 265) | class ApplyRotaryEmb(torch.autograd.Function): method forward (line 268) | def forward( method backward (line 302) | def backward(ctx, do): FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/dispatches/clip.py function clip_flash_attn_forward (line 11) | def clip_flash_attn_forward( FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/dispatches/internlm2.py class InternLM2RotaryEmbedding (line 15) | class InternLM2RotaryEmbedding(torch.nn.Module): method __init__ (line 17) | def __init__(self, method forward (line 40) | def forward(self, x, seq_len): function rotate_half (line 61) | def rotate_half(x): function apply_rotary_pos_emb (line 68) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_di... function apply_rotary_pos_emb_old (line 75) | def apply_rotary_pos_emb_old(q, k, cos, sin, position_ids, unsqueeze_dim... function repeat_kv (line 84) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: function repeat_kv_bshd (line 102) | def repeat_kv_bshd(hidden_states: torch.Tensor, n_rep: int) -> torch.Ten... function _internlm2_varlen_attn_forward (line 116) | def _internlm2_varlen_attn_forward( function internlm2_varlen_attn_forward (line 256) | def internlm2_varlen_attn_forward( FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/dispatches/internvl2.py function rescale_sp_loss (line 16) | def rescale_sp_loss(loss_per_sp_rank, function internvl2_forward (line 40) | def internvl2_forward( function internvl2_hico_forward (line 212) | def internvl2_hico_forward( FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/dispatches/llama3.py function rotate_half (line 9) | def rotate_half(x): function apply_rotary_pos_emb (line 16) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_di... function _llama3_varlen_attn_forward (line 43) | def _llama3_varlen_attn_forward( function llama3_varlen_attn_forward (line 128) | def llama3_varlen_attn_forward( FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/dispatches/new.py function _dispatch_forward_fn (line 9) | def _dispatch_forward_fn(module, dispatch_fn): function dispatch_internlm_varlen_attn_forward (line 13) | def dispatch_internlm_varlen_attn_forward(module): function dispatch_clip_attn_forward (line 20) | def dispatch_clip_attn_forward(module): function dispatch_rms_norm_forward (line 27) | def dispatch_rms_norm_forward(module): function dispatch_phi3_varlen_attn_forward (line 33) | def dispatch_phi3_varlen_attn_forward(module): function dispatch_llama3_varlen_attn_forward (line 40) | def dispatch_llama3_varlen_attn_forward(module): function dispatch_qwen2vl_varlen_attn_forward (line 47) | def dispatch_qwen2vl_varlen_attn_forward(module): function dispatch_internvl2_forward (line 54) | def dispatch_internvl2_forward(module): function dispatch_qwen2_varlen_attn_forward (line 61) | def dispatch_qwen2_varlen_attn_forward(module): function dispatch_modules (line 82) | def dispatch_modules(model, exclude_cls=[]): FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/dispatches/phi3.py function rotate_half (line 14) | def rotate_half(x): function apply_rotary_pos_emb (line 21) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_di... function repeat_kv (line 47) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: function _phi3_varlen_attn_forward (line 59) | def _phi3_varlen_attn_forward( function ph3_varlen_attn_forward (line 224) | def ph3_varlen_attn_forward( FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/dispatches/qwen2.py function rotate_half (line 12) | def rotate_half(x): function apply_rotary_pos_emb (line 19) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_di... function qwen2_varlen_attn_forward (line 46) | def qwen2_varlen_attn_forward( FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/dispatches/qwen_vl2.py function qwen2_vl_varlen_attn_forward (line 26) | def qwen2_vl_varlen_attn_forward( FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/fsdp/checkpointing.py function checkpoint_check_fn (line 8) | def checkpoint_check_fn(submodule, target=RECOMPUTE_MODULES, selective=1... FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/fsdp/clip_grad.py function clip_grad_norm_ (line 14) | def clip_grad_norm_( FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/fsdp/lazy.py function dp_lazy_init (line 7) | def dp_lazy_init(module, module_map, dp_mesh): function dp_sp_lazy_init (line 35) | def dp_sp_lazy_init(module, module_map, dp_mesh, sp_mesh): function dp_tp_lazy_init (line 61) | def dp_tp_lazy_init(module, module_map, dp_mesh, tp_mesh): class LoadWoInit (line 139) | class LoadWoInit: method __init__ (line 142) | def __init__(self): method __enter__ (line 151) | def __enter__(self, *args, **kwargs): method __exit__ (line 160) | def __exit__(self, *args, **kwargs): FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/fsdp/precision.py function set_require_grad_param_to_fp32 (line 5) | def set_require_grad_param_to_fp32(model: nn.Module): FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/fsdp/wrap.py function layer_auto_wrap_policy (line 14) | def layer_auto_wrap_policy( function token_embedding_wrap_policy (line 29) | def token_embedding_wrap_policy( function all_required_grad_wrap_policy (line 46) | def all_required_grad_wrap_policy( FILE: xtuner-train_internvideo2_5/xtuner/_lite/accelerate/packed.py function packed_sequence (line 6) | def packed_sequence(num_tokens, enable=False, sp_size=1, skip_position_i... FILE: xtuner-train_internvideo2_5/xtuner/_lite/auto.py function download_model_from_hub (line 20) | def download_model_from_hub( class AutoModelForCausalLM (line 64) | class AutoModelForCausalLM: method from_config (line 91) | def from_config(cls, method from_pretrained (line 102) | def from_pretrained( method _flash_attn_kwargs (line 139) | def _flash_attn_kwargs(config: PretrainedConfig) -> dict: method _long_ctx_kwargs (line 162) | def _long_ctx_kwargs(config: PretrainedConfig, FILE: xtuner-train_internvideo2_5/xtuner/_lite/chat/messages/base.py class BaseMessages (line 10) | class BaseMessages(BaseModel): method add (line 13) | def add(self, role: str, content): method pop (line 17) | def pop(self): method get_prompt (line 21) | def get_prompt(self, chat_template: ChatTemplate) -> str: method tokenize (line 25) | def tokenize(self, tokenizer: PreTrainedTokenizer, method from_dict (line 30) | def from_dict(cls, item: Dict) -> 'BaseMessages': FILE: xtuner-train_internvideo2_5/xtuner/_lite/chat/messages/chat.py class TextContentItem (line 15) | class TextContentItem(BaseModel): method apply_chat_template (line 19) | def apply_chat_template(self, chat_template: HybridChatTemplate) -> str: class ImageContentItem (line 23) | class ImageContentItem(BaseModel): method apply_chat_template (line 27) | def apply_chat_template(self, chat_template: HybridChatTemplate) -> str: class ChatMsg (line 35) | class ChatMsg(BaseModel): method __init__ (line 41) | def __init__(self, *args, **kwargs): method collect_img_urls (line 53) | def collect_img_urls(self) -> List[str]: method get_prompt (line 61) | def get_prompt(self, chat_template: ChatTemplate) -> str: method tokenize (line 86) | def tokenize( class ChatMessages (line 107) | class ChatMessages(BaseMessages): method add (line 111) | def add(self, role, content, loss=False): method pop (line 114) | def pop(self): method get_prompt (line 117) | def get_prompt(self, chat_template: ChatTemplate) -> str: method tokenize (line 127) | def tokenize(self, tokenizer: PreTrainedTokenizer, method from_str (line 169) | def from_str(cls, prompt: str) -> 'ChatMessages': method from_dict (line 175) | def from_dict(cls, item: dict) -> 'ChatMessages': FILE: xtuner-train_internvideo2_5/xtuner/_lite/chat/templates/chat.py class ChatTemplate (line 6) | class ChatTemplate(BaseModel): method decorate_system (line 18) | def decorate_system(self, text: str) -> str: method decorate_assistant (line 22) | def decorate_assistant(self, text: str) -> str: method decorate_user (line 26) | def decorate_user(self, text: str) -> str: method check_system (line 31) | def check_system(cls, v: str) -> str: method check_user (line 41) | def check_user(cls, v: str) -> str: method check_assistant (line 51) | def check_assistant(cls, v: str) -> str: FILE: xtuner-train_internvideo2_5/xtuner/_lite/chat/templates/hybrid.py class HybridChatTemplate (line 6) | class HybridChatTemplate(BaseModel): method mm_token_maps (line 42) | def mm_token_maps(self) -> Dict[str, int]: method decorate_system (line 47) | def decorate_system(self, text: str) -> str: method decorate_assistant (line 51) | def decorate_assistant(self, text: str) -> str: method decorate_user (line 55) | def decorate_user(self, text: str) -> str: method decorate_files (line 59) | def decorate_files(self, text: str) -> str: method decorate_functions (line 63) | def decorate_functions(self, text: str) -> str: method decorate_function_call (line 67) | def decorate_function_call(self, text: str, func: str) -> str: method decorate_function_result (line 71) | def decorate_function_result(self, text: str) -> str: method decorate_code_interpreter (line 75) | def decorate_code_interpreter(self, text: str) -> str: method decorate_code_interpreter_call (line 79) | def decorate_code_interpreter_call(self, text: str, func: str) -> str: method decorate_code_interpreter_result (line 84) | def decorate_code_interpreter_result(self, text: str) -> str: method check_system (line 90) | def check_system(cls, v: str) -> str: method check_user (line 100) | def check_user(cls, v: str) -> str: method check_assistant (line 110) | def check_assistant(cls, v: str) -> str: method check_function_call (line 121) | def check_function_call(cls, v: str) -> str: method check_function_result (line 137) | def check_function_result(cls, v: str) -> str: method check_functions (line 148) | def check_functions(cls, v: str) -> str: method check_code_interpreter (line 159) | def check_code_interpreter(cls, v: str) -> str: method check_code_interpreter_call (line 170) | def check_code_interpreter_call(cls, v: str) -> str: method check_code_interpreter_result (line 186) | def check_code_interpreter_result(cls, v: str) -> str: FILE: xtuner-train_internvideo2_5/xtuner/_lite/checkpoint.py function _no_hook (line 13) | def _no_hook(module: nn.Module): function checkpoint (line 28) | def checkpoint(module: nn.Module) -> nn.Module: class MyModel (line 66) | class MyModel(nn.Module): method __init__ (line 68) | def __init__(self): method forward (line 73) | def forward(self, x, b, a=4, c=4): FILE: xtuner-train_internvideo2_5/xtuner/_lite/datasets/dataset_fn.py function _apply_exif_orientation (line 30) | def _apply_exif_orientation(image): function log_format (line 77) | def log_format(rank, debug=False): function check_args (line 90) | def check_args(args): function set_logger_envs (line 124) | def set_logger_envs(args): class SoftPackDataset (line 166) | class SoftPackDataset(Dataset): method __init__ (line 168) | def __init__(self, datasets, pack_max_length=32768, concat_before_pack... method get_pack_infos (line 195) | def get_pack_infos(self, dataset, dataset_id, num_tokens): method __len__ (line 238) | def __len__(self): method __getitem__ (line 241) | def __getitem__(self, item): function load_json_or_jsonl (line 247) | def load_json_or_jsonl(json_path): function calculate_jsonl_sha256 (line 260) | def calculate_jsonl_sha256(path): function calculate_json_sha256 (line 268) | def calculate_json_sha256(file_path): function expand2square (line 277) | def expand2square(pil_img, background_color): class BaseOrigDataset (line 291) | class BaseOrigDataset(Dataset): method __init__ (line 292) | def __init__(self, method __len__ (line 363) | def __len__(self): method calc_group_len (line 366) | def calc_group_len(self): method calc_packing_info (line 369) | def calc_packing_info(self): method count_tokens_for_pack (line 392) | def count_tokens_for_pack(self, cache_dir=None): method pre_tokenize_fn_for_pack (line 432) | def pre_tokenize_fn_for_pack(self, data): method process_text (line 435) | def process_text(self, conversations, media_type='image', image_grids=... method _process_media_format_first_round (line 488) | def _process_media_format_first_round(self, input_, media_type, image_... method modality_length (line 492) | def modality_length(self): method length (line 496) | def length(self): function build_dataset (line 502) | def build_dataset(args, datasets): function build_train_dataloader (line 515) | def build_train_dataloader(args, train_dataset, collate_fn): function _prepare_input (line 554) | def _prepare_input(data, device='cuda'): function is_interval (line 567) | def is_interval(step, total_steps, interval): FILE: xtuner-train_internvideo2_5/xtuner/_lite/datasets/format.py class Alpaca2Openai (line 4) | class Alpaca2Openai(): method source_format (line 7) | def source_format(cls): method target_format (line 16) | def target_format(cls): method convert (line 32) | def convert(data): function llava_to_openai (line 50) | def llava_to_openai(data): FILE: xtuner-train_internvideo2_5/xtuner/_lite/datasets/llava.py function expand2square (line 14) | def expand2square(pil_img, background_color): class LlavaTokenizeFunction (line 28) | class LlavaTokenizeFunction(): method __init__ (line 30) | def __init__(self, method __call__ (line 45) | def __call__(self, item): class LlavaTokenizedDataset (line 80) | class LlavaTokenizedDataset(torch.utils.data.Dataset): method __init__ (line 82) | def __init__(self, dataset, image_processor, pad_image_to_square=False): method process_tokenized_data (line 88) | def process_tokenized_data(self, tokenized_data): method __getitem__ (line 117) | def __getitem__(self, item): class LlavaRawDataset (line 131) | class LlavaRawDataset(LlavaTokenizedDataset): method __init__ (line 133) | def __init__(self, dataset, image_processor, tokenize_fn, pad_image_to... method modality_length (line 165) | def modality_length(self): method length (line 169) | def length(self): method __getitem__ (line 174) | def __getitem__(self, item): method __len__ (line 179) | def __len__(self): class SoftPackerForLlava (line 183) | class SoftPackerForLlava(SoftPackerForText): method __init__ (line 185) | def __init__(self, method __getitem__ (line 196) | def __getitem__(self, item): class LlavaCollator (line 273) | class LlavaCollator(): method __init__ (line 275) | def __init__(self, pack_batch=False): method __call__ (line 278) | def __call__(self, instances): class LlavaDatasetForNonPack (line 343) | class LlavaDatasetForNonPack(torch.utils.data.Dataset): method __init__ (line 345) | def __init__(self, method modality_length (line 385) | def modality_length(self): method length (line 389) | def length(self): method __getitem__ (line 394) | def __getitem__(self, item): method __len__ (line 398) | def __len__(self): class NewLlavaTokenizeFunction (line 402) | class NewLlavaTokenizeFunction(): method __init__ (line 404) | def __init__(self, method __call__ (line 423) | def __call__(self, item): class NewLlavaCollator (line 468) | class NewLlavaCollator(): method __init__ (line 470) | def __init__(self, pad_token_id=0, ignore_id=-100, pack_batch=False): method __call__ (line 475) | def __call__(self, instances): FILE: xtuner-train_internvideo2_5/xtuner/_lite/datasets/load.py function load_json (line 20) | def load_json(file): function load_jsonl (line 26) | def load_jsonl(file): function load_bin (line 34) | def load_bin(file): function master_only_load (line 41) | def master_only_load(load_fn): function multi_thread_map (line 70) | def multi_thread_map(map_fns, dataset, desc, num_proc=8): function openai_format (line 90) | def openai_format(item): function load_hf_dataset (line 97) | def load_hf_dataset(path, function load_from_cache (line 128) | def load_from_cache(cache_dir, keep_cache_path=None): function load_local_datasets (line 141) | def load_local_datasets(paths, function load_datasets (line 376) | def load_datasets(paths, function load_ms_dataset (line 496) | def load_ms_dataset(): FILE: xtuner-train_internvideo2_5/xtuner/_lite/datasets/load_new.py function calculate_jsonl_sha256 (line 24) | def calculate_jsonl_sha256(path): function calculate_tokenize_fn_sha256 (line 32) | def calculate_tokenize_fn_sha256(tokenize_fn): class JsonlDataset (line 39) | class JsonlDataset(torch.utils.data.Dataset): method __init__ (line 41) | def __init__(self, method count_offsets (line 101) | def count_offsets(self, cache_dir=None): method count_tokens (line 119) | def count_tokens(self, cache_dir=None): method __len__ (line 165) | def __len__(self): method __getitem__ (line 168) | def __getitem__(self, item): function calculate_json_sha256 (line 190) | def calculate_json_sha256(file_path): class JsonDataset (line 199) | class JsonDataset(torch.utils.data.Dataset): method __init__ (line 201) | def __init__(self, method count_tokens (line 256) | def count_tokens(self, cache_dir=None): method __len__ (line 302) | def __len__(self): method __getitem__ (line 305) | def __getitem__(self, item): function load_local_datasets (line 330) | def load_local_datasets(paths, function load_datasets (line 414) | def load_datasets(paths, function load_ms_dataset (line 479) | def load_ms_dataset(): class SoftPackDataset (line 483) | class SoftPackDataset(torch.utils.data.Dataset): method __init__ (line 485) | def __init__(self, datasets, target=2048, blend=False, sort=False): method get_pack_infos (line 503) | def get_pack_infos(self, dataset, dataset_id, num_tokens): method __len__ (line 545) | def __len__(self): method __getitem__ (line 548) | def __getitem__(self, item): class SftCollator (line 556) | class SftCollator(): method __init__ (line 558) | def __init__(self, pad_token_id=0, ignore_id=-100, pack_batch=False): method __call__ (line 563) | def __call__(self, instances): FILE: xtuner-train_internvideo2_5/xtuner/_lite/datasets/text.py function sort_and_return_indices (line 23) | def sort_and_return_indices(lst): class TextTokenizeFunction (line 27) | class TextTokenizeFunction(): method __init__ (line 29) | def __init__(self, tokenizer, chat_template, raw_format='openai'): method __call__ (line 35) | def __call__(self, item): class TextTokenizedDataset (line 43) | class TextTokenizedDataset(torch.utils.data.Dataset): method __init__ (line 45) | def __init__(self, dataset): method __len__ (line 50) | def __len__(self): method __getitem__ (line 53) | def __getitem__(self, item): class TextOnlineTokenizeDataset (line 72) | class TextOnlineTokenizeDataset(torch.utils.data.Dataset): method __init__ (line 74) | def __init__(self, dataset, tokenize_fn): method __len__ (line 80) | def __len__(self): method __getitem__ (line 83) | def __getitem__(self, item): class SoftPackerForText (line 104) | class SoftPackerForText(torch.utils.data.Dataset): method __init__ (line 106) | def __init__(self, dataset, max_length=2048, pack_info=None): method cache (line 123) | def cache(self): method load_cache (line 141) | def load_cache(self): method __len__ (line 149) | def __len__(self): method __getitem__ (line 152) | def __getitem__(self, item): method get_pack_info (line 205) | def get_pack_info(cls, dataset, max_length): method get_pack_infos (line 254) | def get_pack_infos(cls, datasets, max_length): class HardPackerForText (line 287) | class HardPackerForText(torch.utils.data.Dataset): method __init__ (line 306) | def __init__(self, dataset, max_length=2048, pack_info=None): method _cal_max_length (line 323) | def _cal_max_length(begin, end, shfl_item_rngs_left, shfl_item_rngs_ri... method get_pack_info (line 337) | def get_pack_info(cls, dataset, max_length): method get_pack_infos (line 380) | def get_pack_infos(cls, datasets, max_length): method _pack_ids_and_labels_in_range (line 412) | def _pack_ids_and_labels_in_range(self, begin: int, end: int): method __len__ (line 457) | def __len__(self): method __getitem__ (line 460) | def __getitem__(self, item): class TextCollator (line 488) | class TextCollator(): method __init__ (line 490) | def __init__(self, pack_batch=False): method __call__ (line 493) | def __call__(self, instances): FILE: xtuner-train_internvideo2_5/xtuner/_lite/internvl/conversation.py class SeparatorStyle (line 13) | class SeparatorStyle(IntEnum): class Conversation (line 37) | class Conversation: method get_prompt (line 61) | def get_prompt(self) -> str: method set_system_message (line 251) | def set_system_message(self, system_message: str): method append_message (line 255) | def append_message(self, role: str, message: str): method update_last_message (line 259) | def update_last_message(self, message: str): method to_gradio_chatbot (line 267) | def to_gradio_chatbot(self): method to_openai_api_messages (line 277) | def to_openai_api_messages(self): method copy (line 289) | def copy(self): method dict (line 304) | def dict(self): function register_conv_template (line 318) | def register_conv_template(template: Conversation, override: bool = False): function get_conv_template (line 328) | def get_conv_template(name: str) -> Conversation: FILE: xtuner-train_internvideo2_5/xtuner/_lite/internvl/dataset.py function get_frame_indices (line 37) | def get_frame_indices(num_frames, vlen, sample='rand', fix_start=None, i... function read_frames_gif (line 78) | def read_frames_gif( function read_frames_decord (line 103) | def read_frames_decord( function extract_frame_number (line 136) | def extract_frame_number(filename): function sort_frames (line 142) | def sort_frames(frame_paths): function read_frames_folder (line 147) | def read_frames_folder( class WeightedConcatDataset (line 177) | class WeightedConcatDataset(ConcatDataset): method __init__ (line 178) | def __init__(self, datasets, weights): method __iter__ (line 184) | def __iter__(self): method __len__ (line 187) | def __len__(self): function pil_loader (line 191) | def pil_loader(img_str): class TCSLoader (line 197) | class TCSLoader(object): method __init__ (line 199) | def __init__(self, sc_config_key='sensecore'): method __call__ (line 204) | def __call__(self, fn, image_type='image', max_num_frames=-1, min_num_... function expand2square (line 229) | def expand2square(pil_img, background_color): function simulate_jpeg_degradation (line 243) | def simulate_jpeg_degradation(quality): function build_transform (line 258) | def build_transform(is_train, input_size, pad2square=False, normalize_ty... function preprocess (line 295) | def preprocess( function preprocess_mpt (line 404) | def preprocess_mpt( function preprocess_phi3 (line 502) | def preprocess_phi3( function preprocess_phi3_fast (line 614) | def preprocess_phi3_fast( function preprocess_internlm (line 706) | def preprocess_internlm( function find_closest_aspect_ratio (line 804) | def find_closest_aspect_ratio(aspect_ratio, target_ratios, width, height... function dynamic_preprocess (line 821) | def dynamic_preprocess(image, min_num=1, max_num=6, image_size=448, use_... function dynamic_num_patch (line 860) | def dynamic_num_patch(size, min_num=1, max_num=6, image_size=448, use_th... function concat_pad_data_collator (line 885) | def concat_pad_data_collator(features, pad_id=0): function packing_collate (line 954) | def packing_collate(features, pack_batch=True, pad_id=0): function concat_pad_data_collator_dpo (line 1005) | def concat_pad_data_collator_dpo(features, pad_id=0): FILE: xtuner-train_internvideo2_5/xtuner/_lite/internvl/new_dataset.py function get_frame_indices (line 37) | def get_frame_indices(num_frames, vlen, sample='rand', fix_start=None, i... function read_frames_gif (line 78) | def read_frames_gif( function read_frames_decord (line 103) | def read_frames_decord( function extract_frame_number (line 136) | def extract_frame_number(filename): function sort_frames (line 142) | def sort_frames(frame_paths): function read_frames_folder (line 147) | def read_frames_folder( class WeightedConcatDataset (line 177) | class WeightedConcatDataset(ConcatDataset): method __init__ (line 178) | def __init__(self, datasets, weights): method __iter__ (line 184) | def __iter__(self): method __len__ (line 187) | def __len__(self): function pil_loader (line 191) | def pil_loader(img_str): class TCSLoader (line 197) | class TCSLoader(object): method __init__ (line 199) | def __init__(self, conf_path, sc_config_key='sensecore'): method __call__ (line 207) | def __call__(self, fn, image_type='image', max_num_frames=-1, min_num_... function expand2square (line 245) | def expand2square(pil_img, background_color): function simulate_jpeg_degradation (line 259) | def simulate_jpeg_degradation(quality): function build_transform (line 274) | def build_transform(is_train, input_size, pad2square=False, normalize_ty... function preprocess (line 311) | def preprocess( function preprocess_mpt (line 419) | def preprocess_mpt( function preprocess_phi3 (line 517) | def preprocess_phi3( function preprocess_phi3_fast (line 630) | def preprocess_phi3_fast( function preprocess_internlm (line 720) | def preprocess_internlm( function find_closest_aspect_ratio (line 819) | def find_closest_aspect_ratio(aspect_ratio, target_ratios, width, height... function dynamic_preprocess (line 836) | def dynamic_preprocess(image, min_num=1, max_num=6, image_size=448, use_... function dynamic_num_patch (line 875) | def dynamic_num_patch(size, min_num=1, max_num=6, image_size=448, use_th... function concat_pad_data_collator (line 900) | def concat_pad_data_collator(features, pad_id=0): function packing_collate (line 969) | def packing_collate(features, pack_batch=True, pad_id=0): function concat_pad_data_collator_dpo (line 1020) | def concat_pad_data_collator_dpo(features, pad_id=0): FILE: xtuner-train_internvideo2_5/xtuner/_lite/internvl/v1_5/configuration_intern_vit.py class InternVisionConfig (line 15) | class InternVisionConfig(PretrainedConfig): method __init__ (line 63) | def __init__( method from_pretrained (line 107) | def from_pretrained(cls, pretrained_model_name_or_path: Union[str, os.... FILE: xtuner-train_internvideo2_5/xtuner/_lite/internvl/v1_5/configuration_internvl_chat.py class InternVLChatConfig (line 19) | class InternVLChatConfig(PretrainedConfig): method __init__ (line 23) | def __init__( method to_dict (line 73) | def to_dict(self): FILE: xtuner-train_internvideo2_5/xtuner/_lite/internvl/v1_5/configuration_phi3.py class Phi3Config (line 31) | class Phi3Config(PretrainedConfig): method __init__ (line 117) | def __init__( method _rope_scaling_validation (line 175) | def _rope_scaling_validation(self): FILE: xtuner-train_internvideo2_5/xtuner/_lite/internvl/v1_5/conversation.py class SeparatorStyle (line 13) | class SeparatorStyle(IntEnum): class Conversation (line 37) | class Conversation: method get_prompt (line 61) | def get_prompt(self) -> str: method set_system_message (line 251) | def set_system_message(self, system_message: str): method append_message (line 255) | def append_message(self, role: str, message: str): method update_last_message (line 259) | def update_last_message(self, message: str): method to_gradio_chatbot (line 267) | def to_gradio_chatbot(self): method to_openai_api_messages (line 277) | def to_openai_api_messages(self): method copy (line 289) | def copy(self): method dict (line 304) | def dict(self): function register_conv_template (line 318) | def register_conv_template(template: Conversation, override: bool = False): function get_conv_template (line 328) | def get_conv_template(name: str) -> Conversation: FILE: xtuner-train_internvideo2_5/xtuner/_lite/internvl/v1_5/modeling_intern_vit.py class FlashAttention (line 33) | class FlashAttention(nn.Module): method __init__ (line 44) | def __init__(self, softmax_scale=None, attention_dropout=0.0, device=N... method forward (line 49) | def forward(self, qkv, key_padding_mask=None, causal=False, cu_seqlens... class InternRMSNorm (line 97) | class InternRMSNorm(nn.Module): method __init__ (line 98) | def __init__(self, hidden_size, eps=1e-6): method forward (line 103) | def forward(self, hidden_states): class InternVisionEmbeddings (line 131) | class InternVisionEmbeddings(nn.Module): method __init__ (line 132) | def __init__(self, config): method _get_pos_embed (line 152) | def _get_pos_embed(self, pos_embed, H, W): method forward (line 160) | def forward(self, pixel_values: torch.FloatTensor) -> torch.Tensor: class InternAttention (line 175) | class InternAttention(nn.Module): method __init__ (line 178) | def __init__(self, config): method _naive_attn (line 208) | def _naive_attn(self, x): method _flash_attn (line 227) | def _flash_attn(self, x, key_padding_mask=None, need_weights=False): method forward (line 244) | def forward(self, hidden_states: torch.Tensor) -> torch.Tensor: class InternMLP (line 249) | class InternMLP(nn.Module): method __init__ (line 250) | def __init__(self, config): method forward (line 257) | def forward(self, hidden_states: torch.Tensor) -> torch.Tensor: class InternVisionEncoderLayer (line 264) | class InternVisionEncoderLayer(nn.Module): method __init__ (line 265) | def __init__(self, config, drop_path_rate: float): method forward (line 281) | def forward( class InternVisionEncoder (line 296) | class InternVisionEncoder(nn.Module): method __init__ (line 306) | def __init__(self, config): method forward (line 318) | def forward( class InternVisionModel (line 365) | class InternVisionModel(PreTrainedModel): method __init__ (line 370) | def __init__(self, config): method resize_pos_embeddings (line 377) | def resize_pos_embeddings(self, old_size, new_size, patch_size): method get_input_embeddings (line 389) | def get_input_embeddings(self): method forward (line 392) | def forward( FILE: xtuner-train_internvideo2_5/xtuner/_lite/internvl/v1_5/modeling_internvl_chat.py function version_cmp (line 39) | def version_cmp(v1, v2, op='eq'): function rescale_sp_loss (line 47) | def rescale_sp_loss(loss_per_sp_rank, class InternVLChatModel (line 71) | class InternVLChatModel(PreTrainedModel): method __init__ (line 78) | def __init__(self, config: InternVLChatConfig, vision_model=None, lang... method forward (line 125) | def forward( method pixel_shuffle (line 363) | def pixel_shuffle(self, x, scale_factor=0.5): method extract_feature (line 379) | def extract_feature(self, pixel_values): method batch_chat (line 399) | def batch_chat(self, tokenizer, pixel_values, questions, generation_co... method chat (line 448) | def chat(self, tokenizer, pixel_values, question, generation_config, h... method generate (line 505) | def generate( FILE: xtuner-train_internvideo2_5/xtuner/_lite/internvl/v1_5/modeling_phi3.py class Phi3RMSNorm (line 78) | class Phi3RMSNorm(nn.Module): method __init__ (line 79) | def __init__(self, hidden_size, eps=1e-6): method forward (line 87) | def forward(self, hidden_states): function _get_unpad_data (line 96) | def _get_unpad_data(attention_mask): class Phi3RotaryEmbedding (line 109) | class Phi3RotaryEmbedding(nn.Module): method __init__ (line 110) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method forward (line 119) | def forward(self, x, position_ids, seq_len=None): class Phi3SuScaledRotaryEmbedding (line 139) | class Phi3SuScaledRotaryEmbedding(Phi3RotaryEmbedding): method __init__ (line 140) | def __init__(self, dim, config, device=None): method forward (line 148) | def forward(self, x, position_ids, seq_len=None): class Phi3YarnScaledRotaryEmbedding (line 180) | class Phi3YarnScaledRotaryEmbedding(Phi3RotaryEmbedding): method __init__ (line 181) | def __init__(self, dim, config, device=None): method forward (line 189) | def forward(self, x, position_ids, seq_len=None): function rotate_half (line 222) | def rotate_half(x): function apply_rotary_pos_emb (line 230) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_di... class Phi3MLP (line 257) | class Phi3MLP(nn.Module): method __init__ (line 258) | def __init__(self, config): method forward (line 267) | def forward(self, hidden_states: torch.FloatTensor) -> torch.FloatTensor: function repeat_kv (line 277) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class Phi3Attention (line 289) | class Phi3Attention(nn.Module): method __init__ (line 292) | def __init__(self, config: Phi3Config, layer_idx: Optional[int] = None): method _init_rope (line 326) | def _init_rope(self): method forward (line 342) | def forward( class Phi3FlashAttention2 (line 424) | class Phi3FlashAttention2(Phi3Attention): method __init__ (line 432) | def __init__(self, *args, **kwargs): method forward (line 440) | def forward( method _flash_attention_forward (line 589) | def _flash_attention_forward( method _upad_input (line 690) | def _upad_input(self, query_layer, key_layer, value_layer, attention_m... class Phi3SdpaAttention (line 735) | class Phi3SdpaAttention(Phi3Attention): method forward (line 743) | def forward( class Phi3DecoderLayer (line 831) | class Phi3DecoderLayer(nn.Module): method __init__ (line 832) | def __init__(self, config: Phi3Config, layer_idx: int): method forward (line 845) | def forward( class Phi3PreTrainedModel (line 930) | class Phi3PreTrainedModel(PreTrainedModel): method __init__ (line 942) | def __init__(self, config: Phi3Config): method _init_weights (line 948) | def _init_weights(self, module): class Phi3Model (line 1034) | class Phi3Model(Phi3PreTrainedModel): method __init__ (line 1042) | def __init__(self, config: Phi3Config): method get_input_embeddings (line 1060) | def get_input_embeddings(self): method set_input_embeddings (line 1063) | def set_input_embeddings(self, value): method forward (line 1067) | def forward( class Phi3ForCausalLM (line 1204) | class Phi3ForCausalLM(Phi3PreTrainedModel): method __init__ (line 1208) | def __init__(self, config): method get_input_embeddings (line 1218) | def get_input_embeddings(self): method set_input_embeddings (line 1222) | def set_input_embeddings(self, value): method get_output_embeddings (line 1226) | def get_output_embeddings(self): method set_output_embeddings (line 1230) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 1234) | def set_decoder(self, decoder): method get_decoder (line 1238) | def get_decoder(self): method forward (line 1244) | def forward( method prepare_inputs_for_generation (line 1359) | def prepare_inputs_for_generation( method _reorder_cache (line 1418) | def _reorder_cache(past_key_values, beam_idx): class Phi3ForSequenceClassification (line 1443) | class Phi3ForSequenceClassification(Phi3PreTrainedModel): method __init__ (line 1444) | def __init__(self, config): method get_input_embeddings (line 1453) | def get_input_embeddings(self): method set_input_embeddings (line 1456) | def set_input_embeddings(self, value): method forward (line 1460) | def forward( class Phi3ForTokenClassification (line 1559) | class Phi3ForTokenClassification(Phi3PreTrainedModel): method __init__ (line 1560) | def __init__(self, config: Phi3Config): method forward (line 1583) | def forward( FILE: xtuner-train_internvideo2_5/xtuner/_lite/internvl/video_utils.py function get_index (line 20) | def get_index(num_frames, num_segments): function lazy_load_s3video (line 29) | def lazy_load_s3video(s3path_video, num_frames, video_start, video_end, ... function pts_to_secs (line 73) | def pts_to_secs(pts: int, time_base: float, start_pts: int) -> float: function get_pyav_video_duration (line 88) | def get_pyav_video_duration(video_reader): function get_frame_indices (line 99) | def get_frame_indices(num_frames, vlen, sample='middle', fix_start=None,... function read_frames_av (line 169) | def read_frames_av(video_path, num_frames, sample='rand', client=None, f... function read_frames_gif (line 198) | def read_frames_gif( function read_frames_decord (line 250) | def read_frames_decord( function read_frames_img (line 300) | def read_frames_img( function read_frames_fake (line 402) | def read_frames_fake( FILE: xtuner-train_internvideo2_5/xtuner/_lite/modelings/__init__.py function register_remote_code (line 31) | def register_remote_code(): function lce_forward (line 38) | def lce_forward( function apply_liger_kernel_to_qwen2_vl (line 188) | def apply_liger_kernel_to_qwen2_vl( class LigerSwiGLUMLPForInternlm2 (line 232) | class LigerSwiGLUMLPForInternlm2(nn.Module): method __init__ (line 233) | def __init__(self, config): method forward (line 244) | def forward(self, x): function apply_liger_kernel_to_llava_clip_internlm2 (line 250) | def apply_liger_kernel_to_llava_clip_internlm2( FILE: xtuner-train_internvideo2_5/xtuner/_lite/modelings/internlm2/configuration_internlm2.py class InternLM2Config (line 28) | class InternLM2Config(PretrainedConfig): method __init__ (line 95) | def __init__( # pylint: disable=W0102 method _rope_scaling_validation (line 151) | def _rope_scaling_validation(self): FILE: xtuner-train_internvideo2_5/xtuner/_lite/modelings/internlm2/modeling_internlm2.py function _get_unpad_data (line 69) | def _get_unpad_data(attention_mask): class InternLM2RMSNorm (line 81) | class InternLM2RMSNorm(nn.Module): method __init__ (line 84) | def __init__(self, hidden_size, eps=1e-6): method forward (line 89) | def forward(self, hidden_states): class InternLM2RotaryEmbedding (line 100) | class InternLM2RotaryEmbedding(nn.Module): method __init__ (line 103) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method forward (line 115) | def forward(self, x, position_ids): class InternLM2LinearScalingRotaryEmbedding (line 131) | class InternLM2LinearScalingRotaryEmbedding(InternLM2RotaryEmbedding): method forward (line 134) | def forward(self, x, position_ids): class InternLM2DynamicNTKScalingRotaryEmbedding (line 141) | class InternLM2DynamicNTKScalingRotaryEmbedding(InternLM2RotaryEmbedding): method forward (line 145) | def forward(self, x, position_ids): function rotate_half (line 159) | def rotate_half(x): function apply_rotary_pos_emb (line 166) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_di... class InternLM2MLP (line 192) | class InternLM2MLP(nn.Module): method __init__ (line 195) | def __init__(self, config): method forward (line 205) | def forward(self, x): function repeat_kv (line 211) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class InternLM2Attention (line 223) | class InternLM2Attention(nn.Module): method __init__ (line 226) | def __init__(self, config: InternLM2Config, layer_idx: Optional[int] =... method _init_rope (line 261) | def _init_rope(self): method forward (line 288) | def forward( class InternLM2FlashAttention2 (line 371) | class InternLM2FlashAttention2(InternLM2Attention): method __init__ (line 378) | def __init__(self, *args, **kwargs): method forward (line 389) | def forward( method _flash_attention_forward (line 484) | def _flash_attention_forward( method _upad_input (line 543) | def _upad_input(self, query_layer, key_layer, value_layer, attention_m... class InternLM2SdpaAttention (line 585) | class InternLM2SdpaAttention(InternLM2Attention): method forward (line 593) | def forward( class InternLM2DecoderLayer (line 694) | class InternLM2DecoderLayer(nn.Module): method __init__ (line 697) | def __init__(self, config: InternLM2Config, layer_idx: int): method forward (line 708) | def forward( class InternLM2PreTrainedModel (line 785) | class InternLM2PreTrainedModel(PreTrainedModel): method _init_weights (line 801) | def _init_weights(self, module): class InternLM2Model (line 880) | class InternLM2Model(InternLM2PreTrainedModel): method __init__ (line 889) | def __init__(self, config: InternLM2Config): method get_input_embeddings (line 906) | def get_input_embeddings(self): method set_input_embeddings (line 909) | def set_input_embeddings(self, value): method forward (line 913) | def forward( method _update_causal_mask (line 1025) | def _update_causal_mask( class InternLM2ForCausalLM (line 1106) | class InternLM2ForCausalLM(InternLM2PreTrainedModel): method __init__ (line 1112) | def __init__(self, config): method get_input_embeddings (line 1121) | def get_input_embeddings(self): method set_input_embeddings (line 1124) | def set_input_embeddings(self, value): method get_output_embeddings (line 1127) | def get_output_embeddings(self): method set_output_embeddings (line 1130) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 1133) | def set_decoder(self, decoder): method get_decoder (line 1136) | def get_decoder(self): method forward (line 1141) | def forward( method prepare_inputs_for_generation (line 1237) | def prepare_inputs_for_generation( method _reorder_cache (line 1317) | def _reorder_cache(past_key_values, beam_idx): method build_inputs (line 1325) | def build_inputs(self, tokenizer, query: str, history: List[Tuple[str,... method chat (line 1340) | def chat( method stream_chat (line 1380) | def stream_chat( class InternLM2ForSequenceClassification (line 1486) | class InternLM2ForSequenceClassification(InternLM2PreTrainedModel): method __init__ (line 1489) | def __init__(self, config): method get_input_embeddings (line 1498) | def get_input_embeddings(self): method set_input_embeddings (line 1501) | def set_input_embeddings(self, value): method forward (line 1505) | def forward( class InternLM2ForQuestionAnswering (line 1604) | class InternLM2ForQuestionAnswering(InternLM2PreTrainedModel): method __init__ (line 1609) | def __init__(self, config): method get_input_embeddings (line 1617) | def get_input_embeddings(self): method set_input_embeddings (line 1620) | def set_input_embeddings(self, value): method forward (line 1624) | def forward( class InternLM2ForTokenClassification (line 1705) | class InternLM2ForTokenClassification(InternLM2PreTrainedModel): method __init__ (line 1708) | def __init__(self, config): method get_input_embeddings (line 1724) | def get_input_embeddings(self): method set_input_embeddings (line 1727) | def set_input_embeddings(self, value): method forward (line 1731) | def forward( FILE: xtuner-train_internvideo2_5/xtuner/_lite/modelings/model_fn.py function map_meta_modules (line 18) | def map_meta_modules(model, meta_model): class MetaStateful (line 27) | class MetaStateful(Stateful): method __init__ (line 28) | def __init__(self, **kwargs): method state_dict (line 32) | def state_dict(self): method load_state_dict (line 35) | def load_state_dict(self, state_dict) -> None: method __getitem__ (line 38) | def __getitem__(self, key): function lazy_init_megatron (line 43) | def lazy_init_megatron(module, rank0_map, dp_mesh, tp_mesh=None, pp_mesh... function resume (line 98) | def resume(args, fsdp_model, optimizer, warmup_scheduler, cosine_schedul... function save_ckpt (line 133) | def save_ckpt(args, step, total_steps, fsdp_model, rank0_model, warmup_s... FILE: xtuner-train_internvideo2_5/xtuner/_lite/parallel/comm.py function _all_to_all (line 13) | def _all_to_all( class _AllToAll (line 29) | class _AllToAll(torch.autograd.Function): method forward (line 40) | def forward(ctx: Any, input: Tensor, sp_group: dist.ProcessGroup, method backward (line 51) | def backward(ctx: Any, grad_output: Tensor) -> Tuple: function all_to_all (line 67) | def all_to_all( function all_to_all_list (line 94) | def all_to_all_list(object_list, group=None): FILE: xtuner-train_internvideo2_5/xtuner/_lite/parallel/new_setup.py function get_device (line 25) | def get_device(): function setup_parallel (line 45) | def setup_parallel(sp_size=1, tp_size=1, sp_ring_degree=1): function get_sp_world_size (line 127) | def get_sp_world_size(): function get_ulysess_mesh (line 138) | def get_ulysess_mesh(): function get_ring_mesh (line 142) | def get_ring_mesh(): function get_ulysess_group (line 146) | def get_ulysess_group(): function get_ring_group (line 150) | def get_ring_group(): function get_ulysess_world_size (line 154) | def get_ulysess_world_size(): function get_ring_world_size (line 165) | def get_ring_world_size(): function get_world_mesh (line 176) | def get_world_mesh(): function get_dp_mesh (line 180) | def get_dp_mesh(): function get_fsdp_mesh (line 184) | def get_fsdp_mesh(): function get_sp_mesh (line 188) | def get_sp_mesh(): function get_tp_mesh (line 192) | def get_tp_mesh(): function get_sp_group (line 196) | def get_sp_group(): function get_torch_device_module (line 200) | def get_torch_device_module(): function profile_time_and_memory (line 212) | def profile_time_and_memory(desc): FILE: xtuner-train_internvideo2_5/xtuner/_lite/parallel/sampler.py class ParallelSampler (line 13) | class ParallelSampler(Sampler): method __init__ (line 42) | def __init__( method __iter__ (line 78) | def __iter__(self) -> Iterator[int]: method __len__ (line 99) | def __len__(self) -> int: method set_epoch (line 103) | def set_epoch(self, epoch: int, step=0) -> None: function get_length_grouped_indices11 (line 117) | def get_length_grouped_indices11(max_lengths, function get_length_grouped_indices (line 145) | def get_length_grouped_indices(max_lengths, group_batch_size, generator=... class LengthGroupedSampler (line 207) | class LengthGroupedSampler(Sampler): method __init__ (line 209) | def __init__(self, method __iter__ (line 262) | def __iter__(self) -> Iterator[int]: method __len__ (line 283) | def __len__(self) -> int: method set_epoch (line 287) | def set_epoch(self, epoch: int, step=0) -> None: FILE: xtuner-train_internvideo2_5/xtuner/_lite/parallel/sequence/attention.py function pre_process_for_sequence_parallel_attn (line 8) | def pre_process_for_sequence_parallel_attn(query_states, function post_process_for_sequence_parallel_attn (line 41) | def post_process_for_sequence_parallel_attn(attn_output, function sequence_parallel_wrapper (line 54) | def sequence_parallel_wrapper(local_attn): FILE: xtuner-train_internvideo2_5/xtuner/_lite/parallel/sequence/data_collate.py function pad_for_sequence_parallel (line 7) | def pad_for_sequence_parallel(tensor, padding_value, dim=-1): function pad_cumulative_len_for_sequence_parallel (line 26) | def pad_cumulative_len_for_sequence_parallel(cumulative_len): FILE: xtuner-train_internvideo2_5/xtuner/_lite/parallel/sequence/ops.py function split_for_sequence_parallel (line 6) | def split_for_sequence_parallel(input, dim: int, sp_group: dist.ProcessG... function gather_for_sequence_parallel (line 33) | def gather_for_sequence_parallel(input, dim: int, sp_group: dist.Process... class _GatherForwardSplitBackward (line 60) | class _GatherForwardSplitBackward(torch.autograd.Function): method forward (line 68) | def forward(ctx, input, dim, sp_group, grad_scale): method backward (line 75) | def backward(ctx, grad_output): class _SplitForwardGatherBackward (line 85) | class _SplitForwardGatherBackward(torch.autograd.Function): method forward (line 93) | def forward(ctx, input, dim, sp_group, grad_scale): method backward (line 100) | def backward(ctx, grad_output): function split_forward_gather_backward (line 109) | def split_forward_gather_backward(input, dim, sp_group, grad_scale=None): function gather_forward_split_backward (line 123) | def gather_forward_split_backward(input, dim, sp_group, grad_scale=None): FILE: xtuner-train_internvideo2_5/xtuner/_lite/parallel/sequence/reduce_loss.py class _ReduceLoss (line 7) | class _ReduceLoss(torch.autograd.Function): method forward (line 10) | def forward(ctx, mean_loss, loss_scale, process_group): method backward (line 22) | def backward(ctx, grad_output): function reduce_sequence_parallel_loss (line 26) | def reduce_sequence_parallel_loss(mean_loss, FILE: xtuner-train_internvideo2_5/xtuner/_lite/parallel/setup.py function setup_sp (line 15) | def setup_sp(sp_size): function setup_tp (line 31) | def setup_tp(tp_size): function setup_dp (line 47) | def setup_dp(): function set_seq_parallel_pg (line 67) | def set_seq_parallel_pg(sp_ulysses_degree, sp_ring_degree): function setup_parallel (line 93) | def setup_parallel(sp_size=1, tp_size=1, ring_size=1): function get_ulysess_mesh (line 108) | def get_ulysess_mesh(): function get_ring_mesh (line 112) | def get_ring_mesh(): function get_ulysess_group (line 116) | def get_ulysess_group(): function get_ring_group (line 120) | def get_ring_group(): function get_ulysess_world_size (line 124) | def get_ulysess_world_size(): function get_ring_world_size (line 135) | def get_ring_world_size(): function get_dp_mesh (line 146) | def get_dp_mesh(): function get_dp_group (line 150) | def get_dp_group(): function get_dp_world_size (line 154) | def get_dp_world_size(): function get_sp_mesh (line 165) | def get_sp_mesh(): function get_sp_group (line 169) | def get_sp_group(): function get_sp_world_size (line 173) | def get_sp_world_size(): function get_tp_mesh (line 184) | def get_tp_mesh(): function get_tp_group (line 188) | def get_tp_group(): function get_tp_world_size (line 192) | def get_tp_world_size(): FILE: xtuner-train_internvideo2_5/xtuner/_lite/yunchang/comm/all_to_all.py function all_to_all_4D (line 15) | def all_to_all_4D( class SeqAllToAll4D (line 96) | class SeqAllToAll4D(torch.autograd.Function): method forward (line 98) | def forward( method backward (line 113) | def backward(ctx: Any, *grad_output: Tensor) -> Tuple[None, Tensor, No... function all_to_all_5D (line 124) | def all_to_all_5D( class SeqAllToAll5D (line 207) | class SeqAllToAll5D(torch.autograd.Function): method forward (line 209) | def forward( method backward (line 224) | def backward(ctx: Any, *grad_output: Tensor) -> Tuple[None, Tensor, No... FILE: xtuner-train_internvideo2_5/xtuner/_lite/yunchang/comm/extract_local.py function stripe_extract_local (line 7) | def stripe_extract_local(value, rank, world_size, rd, ud, *args, **kwargs): function basic_extract_local (line 29) | def basic_extract_local(value, rank, world_size, *args, **kwargs): function zigzag_extract_local (line 33) | def zigzag_extract_local(value, rank, world_size, rd, ud, dim=1, *args, ... FILE: xtuner-train_internvideo2_5/xtuner/_lite/yunchang/globals.py class Singleton (line 4) | class Singleton: method __new__ (line 7) | def __new__(cls, *args, **kwargs): class ProcessGroupSingleton (line 13) | class ProcessGroupSingleton(Singleton): method __init__ (line 14) | def __init__(self): function set_seq_parallel_pg (line 22) | def set_seq_parallel_pg( FILE: xtuner-train_internvideo2_5/xtuner/_lite/yunchang/hybrid/async_attn_layer.py class AsyncLongContextAttention (line 11) | class AsyncLongContextAttention(torch.nn.Module): method __init__ (line 21) | def __init__( method forward (line 42) | def forward( method backward (line 195) | def backward(self, *args, **kwargs): FILE: xtuner-train_internvideo2_5/xtuner/_lite/yunchang/hybrid/attn_layer.py class LongContextAttention (line 15) | class LongContextAttention(torch.nn.Module): method __init__ (line 25) | def __init__( method forward (line 45) | def forward( class LongContextAttentionQKVPacked (line 134) | class LongContextAttentionQKVPacked(torch.nn.Module): method __init__ (line 144) | def __init__( method forward (line 164) | def forward( function llama3_varlen_attention_sp_ulysses_ring (line 225) | def llama3_varlen_attention_sp_ulysses_ring( class LongContextVarLenAttentionForLlaMa3 (line 299) | class LongContextVarLenAttentionForLlaMa3(torch.nn.Module): method __init__ (line 309) | def __init__( method forward (line 324) | def forward( FILE: xtuner-train_internvideo2_5/xtuner/_lite/yunchang/ring/llama3_flash_attn_varlen.py class AsyncHandles (line 10) | class AsyncHandles: method __init__ (line 12) | def __init__(self) -> None: method register (line 15) | def register(self, handle): method wait (line 18) | def wait(self): function llama3_flash_attn_prepare_cu_seqlens (line 24) | def llama3_flash_attn_prepare_cu_seqlens(cu_seqlens, causal, rank, world... function llama3_flash_attn_varlen_forward (line 63) | def llama3_flash_attn_varlen_forward( function llama3_flash_attn_varlen_backward (line 164) | def llama3_flash_attn_varlen_backward( class Llama3FlashAttnVarlenFunc (line 313) | class Llama3FlashAttnVarlenFunc(torch.autograd.Function): method forward (line 315) | def forward( method backward (line 375) | def backward(ctx, dout, *args): function llama3_flash_attn_varlen_qkvpacked_func (line 401) | def llama3_flash_attn_varlen_qkvpacked_func( function llama3_flash_attn_varlen_kvpacked_func (line 439) | def llama3_flash_attn_varlen_kvpacked_func( function llama3_flash_attn_varlen_func (line 478) | def llama3_flash_attn_varlen_func( FILE: xtuner-train_internvideo2_5/xtuner/_lite/yunchang/ring/ring_flash_attn.py function ring_flash_attn_forward (line 7) | def ring_flash_attn_forward( function ring_flash_attn_backward (line 60) | def ring_flash_attn_backward( class RingFlashAttnFunc (line 144) | class RingFlashAttnFunc(torch.autograd.Function): method forward (line 146) | def forward( method backward (line 190) | def backward(ctx, dout, *args): function ring_flash_attn_qkvpacked_func (line 210) | def ring_flash_attn_qkvpacked_func( function ring_flash_attn_kvpacked_func (line 236) | def ring_flash_attn_kvpacked_func( function ring_flash_attn_func (line 263) | def ring_flash_attn_func( FILE: xtuner-train_internvideo2_5/xtuner/_lite/yunchang/ring/ring_flash_attn_varlen.py function ring_flash_attn_varlen_forward (line 25) | def ring_flash_attn_varlen_forward( function ring_flash_attn_varlen_backward (line 95) | def ring_flash_attn_varlen_backward( class RingFlashAttnVarlenFunc (line 184) | class RingFlashAttnVarlenFunc(torch.autograd.Function): method forward (line 186) | def forward( method backward (line 235) | def backward(ctx, dout, *args): function ring_flash_attn_varlen_qkvpacked_func (line 257) | def ring_flash_attn_varlen_qkvpacked_func( function ring_flash_attn_varlen_kvpacked_func (line 287) | def ring_flash_attn_varlen_kvpacked_func( function ring_flash_attn_varlen_func (line 318) | def ring_flash_attn_varlen_func( FILE: xtuner-train_internvideo2_5/xtuner/_lite/yunchang/ring/stripe_flash_attn.py function stripe_flash_attn_forward (line 7) | def stripe_flash_attn_forward( function stripe_flash_attn_backward (line 81) | def stripe_flash_attn_backward( class StripeFlashAttnFunc (line 199) | class StripeFlashAttnFunc(torch.autograd.Function): method forward (line 201) | def forward( method backward (line 245) | def backward(ctx, dout, *args): function stripe_flash_attn_qkvpacked_func (line 265) | def stripe_flash_attn_qkvpacked_func( function stripe_flash_attn_kvpacked_func (line 291) | def stripe_flash_attn_kvpacked_func( function stripe_flash_attn_func (line 318) | def stripe_flash_attn_func( FILE: xtuner-train_internvideo2_5/xtuner/_lite/yunchang/ring/triton_utils.py function flatten_kernel (line 7) | def flatten_kernel( function flatten_varlen_lse (line 39) | def flatten_varlen_lse(lse, cu_seqlens): function unflatten_kernel (line 71) | def unflatten_kernel( function unflatten_varlen_lse (line 103) | def unflatten_varlen_lse(lse, cu_seqlens, max_seqlen: int): FILE: xtuner-train_internvideo2_5/xtuner/_lite/yunchang/ring/utils.py function get_default_args (line 14) | def get_default_args(func): function _update_out_and_lse (line 25) | def _update_out_and_lse( function update_out_and_lse (line 45) | def update_out_and_lse( function flatten_varlen_lse (line 69) | def flatten_varlen_lse(lse, cu_seqlens): function unflatten_varlen_lse (line 78) | def unflatten_varlen_lse(lse, cu_seqlens, max_seqlen: int): class RingComm (line 90) | class RingComm: method __init__ (line 91) | def __init__(self, process_group: dist.ProcessGroup): method send_recv (line 105) | def send_recv( method commit (line 121) | def commit(self): method wait (line 126) | def wait(self): FILE: xtuner-train_internvideo2_5/xtuner/_lite/yunchang/ring/zigzag_ring_flash_attn.py function zigzag_ring_flash_attn_forward (line 7) | def zigzag_ring_flash_attn_forward( function zigzag_ring_flash_attn_backward (line 81) | def zigzag_ring_flash_attn_backward( class ZigZagRingFlashAttnFunc (line 187) | class ZigZagRingFlashAttnFunc(torch.autograd.Function): method forward (line 189) | def forward( method backward (line 233) | def backward(ctx, dout, *args): function zigzag_ring_flash_attn_qkvpacked_func (line 253) | def zigzag_ring_flash_attn_qkvpacked_func( function zigzag_ring_flash_attn_kvpacked_func (line 279) | def zigzag_ring_flash_attn_kvpacked_func( function zigzag_ring_flash_attn_func (line 306) | def zigzag_ring_flash_attn_func( FILE: xtuner-train_internvideo2_5/xtuner/_lite/yunchang/ring/zigzag_ring_flash_attn_varlen.py function get_half_index (line 24) | def get_half_index(cu_seqlens, *, front: bool): function get_half_lse (line 43) | def get_half_lse(lse, cu_seqlens, *, front: bool): function zigzag_ring_flash_attn_varlen_forward (line 74) | def zigzag_ring_flash_attn_varlen_forward( function zigzag_ring_flash_attn_varlen_backward (line 184) | def zigzag_ring_flash_attn_varlen_backward( class ZigZagRingFlashAttnVarlenFunc (line 305) | class ZigZagRingFlashAttnVarlenFunc(torch.autograd.Function): method forward (line 307) | def forward( method backward (line 369) | def backward(ctx, dout, *args): function zigzag_ring_flash_attn_varlen_qkvpacked_func (line 400) | def zigzag_ring_flash_attn_varlen_qkvpacked_func( function zigzag_ring_flash_attn_varlen_kvpacked_func (line 430) | def zigzag_ring_flash_attn_varlen_kvpacked_func( function zigzag_ring_flash_attn_varlen_func (line 461) | def zigzag_ring_flash_attn_varlen_func( FILE: xtuner-train_internvideo2_5/xtuner/_lite/yunchang/ulysses/attn_layer.py function torch_attn (line 16) | def torch_attn(query, class UlyssesAttention (line 42) | class UlyssesAttention(torch.nn.Module): method __init__ (line 52) | def __init__( method forward (line 70) | def forward( FILE: xtuner-train_internvideo2_5/xtuner/apis/datasets/alpaca.py function alpaca_enzh_dataset (line 14) | def alpaca_enzh_dataset(tokenizer, function alpaca_enzh_data_collator (line 41) | def alpaca_enzh_data_collator(return_hf_format=False): function alpaca_zh_dataset (line 45) | def alpaca_zh_dataset(tokenizer, function alpaca_zh_data_collator (line 66) | def alpaca_zh_data_collator(return_hf_format=False): function alpaca_dataset (line 70) | def alpaca_dataset(tokenizer, function alpaca_data_collator (line 91) | def alpaca_data_collator(return_hf_format=False): FILE: xtuner-train_internvideo2_5/xtuner/apis/datasets/arxiv.py function arxiv_dataset (line 12) | def arxiv_dataset(tokenizer, function arxiv_data_collator (line 37) | def arxiv_data_collator(return_hf_format=False): FILE: xtuner-train_internvideo2_5/xtuner/apis/datasets/code_alpaca.py function code_alpaca_dataset (line 12) | def code_alpaca_dataset(tokenizer, function code_alpaca_data_collator (line 33) | def code_alpaca_data_collator(return_hf_format=False): FILE: xtuner-train_internvideo2_5/xtuner/apis/datasets/colorist.py function colorist_dataset (line 12) | def colorist_dataset(tokenizer, function colorist_data_collator (line 33) | def colorist_data_collator(return_hf_format=False): FILE: xtuner-train_internvideo2_5/xtuner/apis/datasets/lawyer.py function lawyer_dataset (line 15) | def lawyer_dataset(tokenizer, function lawyer_data_collator (line 40) | def lawyer_data_collator(return_hf_format=False): function lawyer_crime_dataset (line 44) | def lawyer_crime_dataset(tokenizer, function lawyer_crime_data_collator (line 68) | def lawyer_crime_data_collator(return_hf_format=False): function lawyer_reference_dataset (line 72) | def lawyer_reference_dataset(tokenizer, function lawyer_reference_data_collator (line 96) | def lawyer_reference_data_collator(return_hf_format=False): FILE: xtuner-train_internvideo2_5/xtuner/apis/datasets/medical.py function medical_dataset (line 12) | def medical_dataset(tokenizer, function medical_data_collator (line 33) | def medical_data_collator(return_hf_format=False): FILE: xtuner-train_internvideo2_5/xtuner/apis/datasets/moss_003_sft.py function moss_003_sft_dataset (line 10) | def moss_003_sft_dataset(tokenizer, function moss_003_sft_data_collator (line 29) | def moss_003_sft_data_collator(return_hf_format=False): function moss_003_sft_no_plugins_dataset (line 33) | def moss_003_sft_no_plugins_dataset(tokenizer, function moss_003_sft_no_plugins_data_collator (line 50) | def moss_003_sft_no_plugins_data_collator(return_hf_format=False): function moss_003_sft_plugins_dataset (line 54) | def moss_003_sft_plugins_dataset(tokenizer, function moss_003_sft_plugins_data_collator (line 71) | def moss_003_sft_plugins_data_collator(return_hf_format=False): FILE: xtuner-train_internvideo2_5/xtuner/apis/datasets/oasst1.py function oasst1_dataset (line 12) | def oasst1_dataset(tokenizer, function oasst1_data_collator (line 33) | def oasst1_data_collator(return_hf_format=False): FILE: xtuner-train_internvideo2_5/xtuner/apis/datasets/open_orca.py function openorca_dataset (line 12) | def openorca_dataset(tokenizer, function openorca_data_collator (line 33) | def openorca_data_collator(return_hf_format=False): FILE: xtuner-train_internvideo2_5/xtuner/apis/datasets/sql.py function sql_dataset (line 12) | def sql_dataset(tokenizer, function sql_data_collator (line 33) | def sql_data_collator(return_hf_format=False): FILE: xtuner-train_internvideo2_5/xtuner/apis/datasets/tiny_codes.py function tiny_codes_dataset (line 12) | def tiny_codes_dataset(tokenizer, function tiny_codes_data_collator (line 33) | def tiny_codes_data_collator(return_hf_format=False): FILE: xtuner-train_internvideo2_5/xtuner/apis/datasets/wizardlm.py function wizardlm_dataset (line 12) | def wizardlm_dataset(tokenizer, function wizardlm_data_collator (line 33) | def wizardlm_data_collator(return_hf_format=False): FILE: xtuner-train_internvideo2_5/xtuner/apis/model.py function build_qlora_model (line 12) | def build_qlora_model(model_name_or_path, function build_lora_model (line 52) | def build_lora_model(model_name_or_path, function build_model (line 78) | def build_model(model_name_or_path, return_tokenizer=True): FILE: xtuner-train_internvideo2_5/xtuner/apis/training_args.py class DefaultTrainingArguments (line 12) | class DefaultTrainingArguments(TrainingArguments): FILE: xtuner-train_internvideo2_5/xtuner/configs/__init__.py function get_cfgs_name_path (line 5) | def get_cfgs_name_path(): FILE: xtuner-train_internvideo2_5/xtuner/configs/llava/llama3_8b_instruct_clip_vit_large_p14_336/convert_xtuner_weights_to_hf.py function convert_state_dict_to_hf (line 25) | def convert_state_dict_to_hf(state_dict, mapping): function convert_to_hf (line 38) | def convert_to_hf(text_model_id, vision_model_id, projector_weight, save... function main (line 131) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/configs/llava/llama3_8b_instruct_clip_vit_large_p14_336/convert_xtuner_weights_to_llava.py function convert_state_dict_to_hf (line 27) | def convert_state_dict_to_hf(state_dict, mapping): function convert_to_llava (line 39) | def convert_to_llava(text_model_id, vision_model_id, projector_weight, function main (line 94) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/configs/llava/phi3_mini_4k_instruct_clip_vit_large_p14_336/convert_phi_to_llama.py function convert_phi_to_llama (line 13) | def convert_phi_to_llama(phi_path, save_path): function main (line 91) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/configs/llava/phi3_mini_4k_instruct_clip_vit_large_p14_336/convert_xtuner_weights_to_hf.py function convert_state_dict_to_hf (line 25) | def convert_state_dict_to_hf(state_dict, mapping): function convert_to_hf (line 38) | def convert_to_hf(text_model_id, vision_model_id, projector_weight, save... function main (line 128) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/configs/llava/phi3_mini_4k_instruct_clip_vit_large_p14_336/convert_xtuner_weights_to_llava.py function convert_state_dict_to_hf (line 27) | def convert_state_dict_to_hf(state_dict, mapping): function convert_to_llava (line 39) | def convert_to_llava(text_model_id, vision_model_id, projector_weight, function main (line 94) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/dataset/collate_fns/default_collate_fn.py function default_collate_fn (line 12) | def default_collate_fn(instances: Sequence[Dict], FILE: xtuner-train_internvideo2_5/xtuner/dataset/collate_fns/mmlu_collate_fn.py function mmlu_collate_fn (line 10) | def mmlu_collate_fn(instances: Sequence[Dict], FILE: xtuner-train_internvideo2_5/xtuner/dataset/collate_fns/preference_collate_fn.py function preference_collate_fn (line 13) | def preference_collate_fn(instances: Sequence[Dict], FILE: xtuner-train_internvideo2_5/xtuner/dataset/concat_dataset.py class ConcatDataset (line 7) | class ConcatDataset(TorchConcatDataset): method __init__ (line 9) | def __init__(self, datasets): method __repr__ (line 15) | def __repr__(self): FILE: xtuner-train_internvideo2_5/xtuner/dataset/huggingface.py function get_lengths (line 18) | def get_lengths(example): function build_origin_dataset (line 22) | def build_origin_dataset(dataset, split): function map_dataset (line 39) | def map_dataset(dataset, dataset_map_fn, map_num_proc): function add_template_to_dataset (line 54) | def add_template_to_dataset(dataset, template_map_fn, map_num_proc): function tokenize_dataset (line 67) | def tokenize_dataset(dataset, tokenizer, max_length, with_image_token, function pack_dataset (line 88) | def pack_dataset(dataset, max_length, use_varlen_attn, shuffle_before_pack, function process (line 100) | def process(dataset, function process_hf_dataset (line 222) | def process_hf_dataset(dataset, FILE: xtuner-train_internvideo2_5/xtuner/dataset/intern_repo.py class JsonlDataset (line 22) | class JsonlDataset(torch.utils.data.Dataset): method __init__ (line 36) | def __init__(self, path: str, min_length=50): method __getitem__ (line 62) | def __getitem__(self, idx): method get_dataset_name (line 84) | def get_dataset_name(self): method _get_mmap (line 87) | def _get_mmap(self): method __setstate__ (line 100) | def __setstate__(self, state): method __getstate__ (line 104) | def __getstate__(self): method __del__ (line 111) | def __del__(self): method exists (line 118) | def exists(path): method __len__ (line 121) | def __len__(self): class PackedDataset (line 128) | class PackedDataset(torch.utils.data.Dataset): method __init__ (line 137) | def __init__(self, dataset, packed_length: int = 8192, seed: int = 1024): method __len__ (line 162) | def __len__(self): method search_sample_index (line 165) | def search_sample_index(self, pack_idx: int = 0): method mapping (line 172) | def mapping(self, pack_idx: int = 0): method build_pack (line 192) | def build_pack(self, begin_sample_idx: int, begin_token_id: int, method __getitem__ (line 228) | def __getitem__(self, item: int): function load_intern_repo_tokenized_dataset (line 235) | def load_intern_repo_tokenized_dataset(folder, function load_intern_repo_untokenized_dataset (line 268) | def load_intern_repo_untokenized_dataset(processed_dataset_dict_path=None, function build_packed_dataset_rank0 (line 332) | def build_packed_dataset_rank0(dataset_cfg, packed_length=8192, seed=1024): function build_packed_dataset (line 352) | def build_packed_dataset(*args, **kwargs): FILE: xtuner-train_internvideo2_5/xtuner/dataset/json_dataset.py function load_json_file (line 7) | def load_json_file(data_files=None, data_dir=None, suffix=None): FILE: xtuner-train_internvideo2_5/xtuner/dataset/llava.py function load_jsonl (line 19) | def load_jsonl(json_file): class LLaVADataset (line 28) | class LLaVADataset(Dataset): method __init__ (line 30) | def __init__(self, method modality_length (line 89) | def modality_length(self): method __len__ (line 98) | def __len__(self): method __getitem__ (line 101) | def __getitem__(self, index): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/alpaca_map_fn.py function alpaca_map_fn (line 4) | def alpaca_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/alpaca_zh_map_fn.py function alpaca_zh_map_fn (line 4) | def alpaca_zh_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/arxiv_map_fn.py function arxiv_map_fn (line 5) | def arxiv_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/code_alpaca_map_fn.py function code_alpaca_map_fn (line 5) | def code_alpaca_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/colors_map_fn.py function colors_map_fn (line 5) | def colors_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/crime_kg_assitant_map_fn.py function crime_kg_assitant_map_fn (line 5) | def crime_kg_assitant_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/default_map_fn.py function default_map_fn (line 2) | def default_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/law_reference_map_fn.py function law_reference_map_fn (line 5) | def law_reference_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/llava_map_fn.py function llava_image_only_map_fn (line 5) | def llava_image_only_map_fn(example): function llava_map_fn (line 25) | def llava_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/medical_map_fn.py function medical_map_fn (line 5) | def medical_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/msagent_map_fn.py function replace_think (line 9) | def replace_think(match): function replace_exec (line 22) | def replace_exec(match): function extract_json_objects (line 34) | def extract_json_objects(text, decoder=json.JSONDecoder()): function msagent_react_map_fn (line 53) | def msagent_react_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/oasst1_map_fn.py function oasst1_map_fn (line 2) | def oasst1_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/openai_map_fn.py function openai_map_fn (line 2) | def openai_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/openorca_map_fn.py function openorca_map_fn (line 2) | def openorca_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/pretrain_map_fn.py function pretrain_map_fn (line 2) | def pretrain_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/sql_map_fn.py function sql_map_fn (line 5) | def sql_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/stack_exchange_map_fn.py function stack_exchange_map_fn (line 2) | def stack_exchange_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/tiny_codes_map_fn.py function tiny_codes_map_fn (line 5) | def tiny_codes_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/dataset_map_fns/wizardlm_map_fn.py function wizardlm_map_fn (line 2) | def wizardlm_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/map_fns/template_map_fn.py function template_map_fn (line 7) | def template_map_fn(example, template): function template_map_fn_factory (line 33) | def template_map_fn_factory(template): FILE: xtuner-train_internvideo2_5/xtuner/dataset/modelscope.py function process_ms_dataset (line 8) | def process_ms_dataset(dataset, split='train', *args, **kwargs): FILE: xtuner-train_internvideo2_5/xtuner/dataset/moss_sft.py class MOSSSFTDataset (line 15) | class MOSSSFTDataset(Dataset): method __init__ (line 17) | def __init__(self, data_file, tokenizer, max_length=2048, bot_name=None): method load_data (line 43) | def load_data(self): method process_data (line 118) | def process_data(self): method __len__ (line 125) | def __len__(self): method __getitem__ (line 128) | def __getitem__(self, index): FILE: xtuner-train_internvideo2_5/xtuner/dataset/preference_dataset.py function _worker (line 24) | def _worker( function _chunk_data_to_queue (line 41) | def _chunk_data_to_queue(data_queue: Queue, data: List[Dict], chunk_size... function _multi_progress (line 61) | def _multi_progress(tokenize_fun_p, dataset, nproc, task_num, chunksize, function load_jsonl_dataset (line 90) | def load_jsonl_dataset(data_files=None, data_dir=None, suffix=None): function tokenize (line 110) | def tokenize(pair: str, class PreferenceDataset (line 156) | class PreferenceDataset(Dataset): method __init__ (line 158) | def __init__( method __len__ (line 194) | def __len__(self): method __getitem__ (line 197) | def __getitem__(self, idx): class PackedDatasetWrapper (line 201) | class PackedDatasetWrapper(Dataset): method __init__ (line 203) | def __init__(self, method __len__ (line 252) | def __len__(self): method __getitem__ (line 255) | def __getitem__(self, index): function unpack_seq (line 280) | def unpack_seq(seq, cu_seqlens): function broad_cast_dataset (line 288) | def broad_cast_dataset(dataset): function map_dataset (line 309) | def map_dataset(dataset, dataset_map_fn, map_num_proc): function build_preference_dataset (line 324) | def build_preference_dataset( function intel_orca_dpo_map_fn (line 368) | def intel_orca_dpo_map_fn(example): function orpo_dpo_mix_40k_map_fn (line 381) | def orpo_dpo_mix_40k_map_fn(example): FILE: xtuner-train_internvideo2_5/xtuner/dataset/refcoco_json.py class RefCOCOJsonDataset (line 26) | class RefCOCOJsonDataset(LLaVADataset): method __init__ (line 37) | def __init__( method reformat_data (line 81) | def reformat_data(self, json_data): method gen_refcoco_conversations (line 91) | def gen_refcoco_conversations(cls, data, instruction_template='{}'): method get_data_json (line 127) | def get_data_json( method normalize_bbox (line 168) | def normalize_bbox(cls, bbox, height, width): class RefCOCOJsonEvalDataset (line 176) | class RefCOCOJsonEvalDataset(RefCOCOJsonDataset): method reformat_data (line 179) | def reformat_data(self, json_data): class InvRefCOCOJsonDataset (line 188) | class InvRefCOCOJsonDataset(RefCOCOJsonDataset): method gen_refcoco_conversations (line 200) | def gen_refcoco_conversations(cls, data, instruction_template='{}'): class REFER (line 241) | class REFER: method __init__ (line 243) | def __init__(self, data_root, vis_root, dataset='refcoco', splitBy='un... method createIndex (line 276) | def createIndex(self): method getRefIds (line 340) | def getRefIds(self, image_ids=[], cat_ids=[], ref_ids=[], split=''): method getAnnIds (line 372) | def getAnnIds(self, image_ids=[], cat_ids=[], ref_ids=[]): method getImgIds (line 397) | def getImgIds(self, ref_ids=[]): method getCatIds (line 408) | def getCatIds(self): method loadRefs (line 411) | def loadRefs(self, ref_ids=[]): method loadAnns (line 417) | def loadAnns(self, ann_ids=[]): method loadImgs (line 423) | def loadImgs(self, image_ids=[]): method loadCats (line 429) | def loadCats(self, cat_ids=[]): method getRefBox (line 435) | def getRefBox(self, ref_id): method showRef (line 440) | def showRef(self, ref, seg_box='box'): FILE: xtuner-train_internvideo2_5/xtuner/dataset/samplers/intern_repo.py class InternRepoSampler (line 13) | class InternRepoSampler(Sampler): method __init__ (line 15) | def __init__(self, method __iter__ (line 35) | def __iter__(self) -> Iterator[int]: method __len__ (line 54) | def __len__(self) -> int: method set_epoch (line 58) | def set_epoch(self, epoch: int) -> None: class InternlmRepoSampler (line 71) | class InternlmRepoSampler(InternRepoSampler): method __init__ (line 73) | def __init__(self, FILE: xtuner-train_internvideo2_5/xtuner/dataset/samplers/length_grouped.py function get_length_grouped_indices (line 11) | def get_length_grouped_indices(lengths, group_batch_size, generator=None): class LengthGroupedSampler (line 72) | class LengthGroupedSampler(Sampler): method __init__ (line 74) | def __init__(self, method __iter__ (line 124) | def __iter__(self) -> Iterator[int]: method __len__ (line 144) | def __len__(self) -> int: method set_epoch (line 148) | def set_epoch(self, epoch: int) -> None: FILE: xtuner-train_internvideo2_5/xtuner/dataset/utils.py function get_bos_eos_token_ids (line 15) | def get_bos_eos_token_ids(tokenizer): function encode_fn (line 36) | def encode_fn(example, class Packer (line 132) | class Packer: method __init__ (line 135) | def __init__(self, method get_cumulative_len (line 146) | def get_cumulative_len(self, chunk_num): method get_position_ids (line 179) | def get_position_ids(self, cumulative_len): method __call__ (line 191) | def __call__(self, batch): function expand2square (line 245) | def expand2square(pil_img, background_color): function load_image (line 259) | def load_image(image_file): function decode_base64_to_image (line 268) | def decode_base64_to_image(base64_string): FILE: xtuner-train_internvideo2_5/xtuner/engine/_strategy/deepspeed.py class DeepSpeedStrategy (line 11) | class DeepSpeedStrategy(MMEngineDeepSpeedStrategy): method __init__ (line 13) | def __init__(self, *args, **kwargs): method _wrap_model (line 24) | def _wrap_model(self, model): method save_checkpoint (line 33) | def save_checkpoint(self, *args, **kwargs) -> None: method load_checkpoint (line 45) | def load_checkpoint(self, *args, **kwargs) -> None: method resume (line 54) | def resume(self, *args, **kwargs) -> None: method _setup_distributed (line 63) | def _setup_distributed( # type: ignore FILE: xtuner-train_internvideo2_5/xtuner/engine/hooks/dataset_info_hook.py function split_list (line 8) | def split_list(lst, value): class DatasetInfoHook (line 21) | class DatasetInfoHook(Hook): method __init__ (line 23) | def __init__(self, tokenizer, is_intern_repo_dataset=False): method log (line 27) | def log(self, runner, dataset, mode='train'): method before_train (line 42) | def before_train(self, runner) -> None: method before_val (line 52) | def before_val(self, runner) -> None: method before_test (line 56) | def before_test(self, runner) -> None: FILE: xtuner-train_internvideo2_5/xtuner/engine/hooks/evaluate_chat_hook.py class EvaluateChatHook (line 20) | class EvaluateChatHook(Hook): method __init__ (line 24) | def __init__(self, method _save_eval_output (line 98) | def _save_eval_output(self, runner, eval_outputs): method _eval_images (line 106) | def _eval_images(self, method _eval_language (line 167) | def _eval_language(self, method _generate_samples (line 194) | def _generate_samples(self, method before_train (line 232) | def before_train(self, runner): method _is_save_checkpoint (line 236) | def _is_save_checkpoint(self, runner): method after_train_iter (line 254) | def after_train_iter(self, method after_train (line 273) | def after_train(self, runner): method after_val (line 277) | def after_val(self, runner) -> None: FILE: xtuner-train_internvideo2_5/xtuner/engine/hooks/hf_checkpoint_hook.py class HFCheckpointHook (line 19) | class HFCheckpointHook(Hook): method __init__ (line 23) | def __init__(self, out_dir: Optional[Union[str, Path]] = None) -> None: method _use_shard_moe (line 27) | def _use_shard_moe(llm): method after_run (line 32) | def after_run(self, runner) -> None: FILE: xtuner-train_internvideo2_5/xtuner/engine/hooks/throughput_hook.py class ThroughputHook (line 16) | class ThroughputHook(Hook): method __init__ (line 22) | def __init__(self, method _guess_is_casual_attn (line 37) | def _guess_is_casual_attn(model): method _get_batch_size_and_sequence_len (line 47) | def _get_batch_size_and_sequence_len(data_batch): method _guess_use_activation_checkpointing (line 55) | def _guess_use_activation_checkpointing(model): method before_run (line 61) | def before_run(self, runner) -> None: method after_train_iter (line 88) | def after_train_iter(self, FILE: xtuner-train_internvideo2_5/xtuner/engine/hooks/varlen_attn_args_to_messagehub_hook.py class VarlenAttnArgsToMessageHubHook (line 11) | class VarlenAttnArgsToMessageHubHook(Hook): method before_train_iter (line 13) | def before_train_iter(self, method after_train_iter (line 31) | def after_train_iter(self, method before_val_iter (line 41) | def before_val_iter(self, method after_val_iter (line 68) | def after_val_iter(self, FILE: xtuner-train_internvideo2_5/xtuner/engine/runner/loops.py class TrainLoop (line 8) | class TrainLoop(IterBasedTrainLoop): method __init__ (line 10) | def __init__(self, FILE: xtuner-train_internvideo2_5/xtuner/entry_point.py function list_dataset_format (line 127) | def list_dataset_format(): function list_cfg (line 132) | def list_cfg(): function copy_cfg (line 137) | def copy_cfg(): function log_dataset (line 142) | def log_dataset(): function check_custom_dataset (line 147) | def check_custom_dataset(): function train (line 152) | def train(): function test (line 157) | def test(): function chat (line 162) | def chat(): function mmbench (line 167) | def mmbench(): function pth_to_hf (line 172) | def pth_to_hf(): function merge (line 177) | def merge(): function split (line 182) | def split(): function arxiv_preprocess (line 187) | def arxiv_preprocess(): function convert_refcoco (line 192) | def convert_refcoco(): function convert_help_msg (line 197) | def convert_help_msg(): function preprocess_help_msg (line 201) | def preprocess_help_msg(): function eval_refcoco (line 205) | def eval_refcoco(): function cli (line 244) | def cli(): FILE: xtuner-train_internvideo2_5/xtuner/evaluation/metrics/mmlu_metric.py class MMLUMetric (line 14) | class MMLUMetric(BaseMetric): method __init__ (line 91) | def __init__(self, tokenizer, *args, **kwargs): method ABCD_to_0123 (line 102) | def ABCD_to_0123(abcd): method find_first_zero_index (line 106) | def find_first_zero_index(tensor): method accuracy (line 114) | def accuracy(preds, gts): method process (line 120) | def process(self, data_batch: Any, data_samples: Sequence[dict]) -> None: method compute_metrics (line 147) | def compute_metrics(self, results: list) -> dict: method _print_results (line 236) | def _print_results(self, table_metrics: dict) -> None: FILE: xtuner-train_internvideo2_5/xtuner/evaluation/metrics/reward_metric.py class RewardMetric (line 12) | class RewardMetric(BaseMetric): method __init__ (line 17) | def __init__(self, method process (line 22) | def process(self, data_batch, data_samples: Sequence[dict]): method compute_metrics (line 49) | def compute_metrics(self, results: List): FILE: xtuner-train_internvideo2_5/xtuner/model/dpo.py function create_reference_model (line 19) | def create_reference_model(model): class DPO (line 36) | class DPO(SupervisedFinetune): method __init__ (line 39) | def __init__(self, method _gather_masked_logits (line 55) | def _gather_masked_logits(self, logits, labels, mask): method get_logps (line 61) | def get_logps( method get_var_len_atten_logps (line 89) | def get_var_len_atten_logps(self, all_logits, all_ref_logits, labels, method _split_for_sequence_parallel (line 141) | def _split_for_sequence_parallel(data): method compute_loss (line 153) | def compute_loss(self, data, data_samples=None): FILE: xtuner-train_internvideo2_5/xtuner/model/llava.py function convert_state_dict_to_hf (line 30) | def convert_state_dict_to_hf(state_dict, mapping): class LLaVAModel (line 42) | class LLaVAModel(BaseModel): method __init__ (line 44) | def __init__(self, method _parse_lora_config (line 121) | def _parse_lora_config(self, lora_config): method _prepare_llm_for_lora (line 127) | def _prepare_llm_for_lora(self, method _prepare_visual_encoder_for_lora (line 138) | def _prepare_visual_encoder_for_lora(self, method gradient_checkpointing_enable (line 147) | def gradient_checkpointing_enable(self): method activation_checkpointing_enable (line 150) | def activation_checkpointing_enable(self): method gradient_checkpointing_disable (line 155) | def gradient_checkpointing_disable(self): method activation_checkpointing_disable (line 158) | def activation_checkpointing_disable(self): method init_weights (line 163) | def init_weights(self): method state_dict (line 166) | def state_dict(self, *args, **kwargs): method _prepare_for_long_context_training (line 194) | def _prepare_for_long_context_training(cfg, llm_cfg, method _prepare_for_flash_attn (line 221) | def _prepare_for_flash_attn(cfg, llm_cfg): method _prepare_for_qlora_zero3 (line 250) | def _prepare_for_qlora_zero3(cfg): method _dispatch_lm_model_cfg (line 266) | def _dispatch_lm_model_cfg(self, cfg, max_position_embeddings=None): method _build_from_cfg_or_module (line 277) | def _build_from_cfg_or_module(self, cfg_or_mod): method forward (line 286) | def forward(self, data, data_samples=None, mode='loss'): method _forward (line 313) | def _forward(self, data, data_samples=None): method predict (line 319) | def predict(self, data, data_samples=None): method compute_loss (line 324) | def compute_loss(self, data, data_samples=None): method __getattr__ (line 329) | def __getattr__(self, name: str): method to_hf (line 335) | def to_hf(self, method to_xtuner_llava (line 352) | def to_xtuner_llava(self, method to_huggingface_llava (line 402) | def to_huggingface_llava(self, method to_official_llava (line 536) | def to_official_llava(self, FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/__init__.py function log_once (line 137) | def log_once(func): function dispatch_attn_forward (line 150) | def dispatch_attn_forward(model): function dispatch_varlen_attn_forward (line 178) | def dispatch_varlen_attn_forward(model): function dispatch_rmsnorm_forward (line 207) | def dispatch_rmsnorm_forward(model): function replace_rote (line 226) | def replace_rote(model): function dispatch_modules (line 254) | def dispatch_modules(model, use_varlen_attn=False): FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/attention.py function flash_attn_wo_mask (line 15) | def flash_attn_wo_mask( function flash_attn_w_mask (line 36) | def flash_attn_w_mask( function varlen_flash_attn (line 68) | def varlen_flash_attn( FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/baichuan.py function baichuan2_norm_head_forward (line 9) | def baichuan2_norm_head_forward(self, hidden_states): function rotate_half (line 14) | def rotate_half(x): function apply_rotary_pos_emb (line 21) | def apply_rotary_pos_emb(q, k, cos_, sin_, position_ids): function baichuan_7b_attn_forward (line 31) | def baichuan_7b_attn_forward( function baichuan_13b_attn_forward (line 75) | def baichuan_13b_attn_forward( FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/cohere.py class Cache (line 17) | class Cache: function cohere_attn_forward (line 21) | def cohere_attn_forward( FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/deepseek_v2.py function deepseek_attn_forward (line 19) | def deepseek_attn_forward( function deepseek_varlen_attn_forward (line 158) | def deepseek_varlen_attn_forward( FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/internlm.py class InternLMRotaryEmbedding (line 21) | class InternLMRotaryEmbedding(torch.nn.Module): method __init__ (line 23) | def __init__(self, method forward (line 43) | def forward(self, x, seq_len): function rotate_half (line 64) | def rotate_half(x): function apply_rotary_pos_emb (line 71) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids): function internlm_attn_forward (line 79) | def internlm_attn_forward( function internlm_varlen_attn_forward (line 140) | def internlm_varlen_attn_forward( FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/internlm2.py function rotate_half (line 16) | def rotate_half(x): function apply_rotary_pos_emb (line 23) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_di... function repeat_kv (line 31) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: function repeat_kv_bshd (line 49) | def repeat_kv_bshd(hidden_states: torch.Tensor, n_rep: int) -> torch.Ten... function internlm2_attn_forward (line 63) | def internlm2_attn_forward( function internlm2_varlen_attn_forward (line 174) | def internlm2_varlen_attn_forward( FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/llama.py class Cache (line 20) | class Cache: function repeat_kv_bshd (line 24) | def repeat_kv_bshd(hidden_states: torch.Tensor, n_rep: int) -> torch.Ten... function llama_attn_forward (line 38) | def llama_attn_forward( function llama_attn_forward_legacy (line 160) | def llama_attn_forward_legacy( function llama_varlen_attn_forward (line 290) | def llama_varlen_attn_forward( function llama_varlen_attn_forward_legacy (line 399) | def llama_varlen_attn_forward_legacy( FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/mistral.py class MistralRotaryEmbedding (line 32) | class MistralRotaryEmbedding(nn.Module): method __init__ (line 34) | def __init__(self, method _set_cos_sin_cache (line 53) | def _set_cos_sin_cache(self, seq_len, device, dtype): method forward (line 64) | def forward(self, x, seq_len=None): function repeat_kv_bshd (line 78) | def repeat_kv_bshd(hidden_states: torch.Tensor, n_rep: int) -> torch.Ten... function mistral_attn_forward (line 92) | def mistral_attn_forward( function mistral_varlen_attn_forward (line 241) | def mistral_varlen_attn_forward( FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/phi3.py class Cache (line 18) | class Cache: function repeat_kv (line 40) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: function rotate_half (line 59) | def rotate_half(x): function apply_rotary_pos_emb (line 67) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_di... function phi3_attn_forward (line 94) | def phi3_attn_forward( function phi3_varlen_attn_forward (line 261) | def phi3_varlen_attn_forward( FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/qwen2.py function qwen2_attn_forward (line 30) | def qwen2_attn_forward( function qwen2_varlen_attn_forward (line 177) | def qwen2_varlen_attn_forward( FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/triton_kernels/layer_norm.py function layer_norm_forward (line 6) | def layer_norm_forward(self, hidden_states): FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/triton_kernels/rms_norm.py function _rms_norm_fwd_fused (line 8) | def _rms_norm_fwd_fused( function _rms_norm_bwd_dx_fused (line 45) | def _rms_norm_bwd_dx_fused( function _rms_norm_bwd_dwdb (line 100) | def _rms_norm_bwd_dwdb( class RMSNorm (line 122) | class RMSNorm(torch.autograd.Function): method forward (line 125) | def forward(ctx, x, weight, eps): method backward (line 159) | def backward(ctx, dy): function rms_norm_forward (line 214) | def rms_norm_forward(self, hidden_states): FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/triton_kernels/rotary.py function rotary_kernel (line 11) | def rotary_kernel( function apply_rotary (line 163) | def apply_rotary( class ApplyRotaryEmb (line 265) | class ApplyRotaryEmb(torch.autograd.Function): method forward (line 268) | def forward( method backward (line 302) | def backward(ctx, do): FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/utils.py function _get_unpad_data (line 10) | def _get_unpad_data(attention_mask): function upad_qkv (line 23) | def upad_qkv(query_layer, key_layer, value_layer, attention_mask, FILE: xtuner-train_internvideo2_5/xtuner/model/modules/dispatch/yi.py function rotate_half (line 8) | def rotate_half(x): function apply_rotary_pos_emb (line 15) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids): function repeat_kv (line 27) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: function yi_attn_forward (line 45) | def yi_attn_forward( FILE: xtuner-train_internvideo2_5/xtuner/model/modules/projector/configuration_projector.py class ProjectorConfig (line 5) | class ProjectorConfig(PretrainedConfig): method __init__ (line 9) | def __init__( FILE: xtuner-train_internvideo2_5/xtuner/model/modules/projector/modeling_projector.py class ProjectorModel (line 10) | class ProjectorModel(PreTrainedModel): method __init__ (line 16) | def __init__(self, config: ProjectorConfig) -> None: method enable_input_require_grads (line 35) | def enable_input_require_grads(self): method _set_gradient_checkpointing (line 42) | def _set_gradient_checkpointing(self, module, value=False): method forward (line 46) | def forward(self, x): FILE: xtuner-train_internvideo2_5/xtuner/model/orpo.py class ORPO (line 17) | class ORPO(SupervisedFinetune): method __init__ (line 25) | def __init__(self, *args, beta=0.1, **kwargs): method _gather_masked_logits (line 29) | def _gather_masked_logits(self, logits, labels, mask): method get_logps (line 35) | def get_logps( method get_var_len_atten_logps (line 56) | def get_var_len_atten_logps(self, all_logits, average_log_prob, labels, method cross_entropy_loss (line 94) | def cross_entropy_loss(self, logits, labels): method odds_ratio_loss (line 106) | def odds_ratio_loss( method _split_for_sequence_parallel (line 127) | def _split_for_sequence_parallel(data): method compute_loss (line 139) | def compute_loss(self, data, data_samples=None): FILE: xtuner-train_internvideo2_5/xtuner/model/reward.py function reduce_mean (line 35) | def reduce_mean(tensor): function smart_tokenizer_and_embedding_resize (line 44) | def smart_tokenizer_and_embedding_resize( class RewardModel (line 87) | class RewardModel(BaseModel): method __init__ (line 89) | def __init__( method gradient_checkpointing_enable (line 157) | def gradient_checkpointing_enable(self): method activation_checkpointing_enable (line 160) | def activation_checkpointing_enable(self): method gradient_checkpointing_disable (line 163) | def gradient_checkpointing_disable(self): method activation_checkpointing_disable (line 166) | def activation_checkpointing_disable(self): method _prepare_for_lora (line 169) | def _prepare_for_lora(self, method init_weights (line 182) | def init_weights(self): method _prepare_for_long_context_training (line 186) | def _prepare_for_long_context_training(cfg, llm_cfg, method _prepare_for_flash_attn (line 211) | def _prepare_for_flash_attn(cfg, llm_cfg): method _prepare_for_qlora_zero3 (line 240) | def _prepare_for_qlora_zero3(cfg): method _dispatch_lm_model_cfg (line 256) | def _dispatch_lm_model_cfg(self, cfg, max_position_embeddings=None): method _build_from_cfg_or_module (line 267) | def _build_from_cfg_or_module(self, cfg_or_mod): method forward (line 276) | def forward(self, data, data_samples=None, mode='loss'): method _forward (line 287) | def _forward(self, data, data_samples=None): method predict (line 292) | def predict(self, data, data_samples=None): method _split_for_sequence_parallel (line 299) | def _split_for_sequence_parallel(data): method compute_loss (line 311) | def compute_loss(self, data, labels=None): method ranking_loss (line 381) | def ranking_loss(self, chosen_logits, rejected_logits, avg_factor): method focal_loss (line 385) | def focal_loss(self, chosen_logits, rejected_logits, avg_factor): method log_barrier_penalty (line 394) | def log_barrier_penalty(self, method l2_penalty (line 408) | def l2_penalty(self, logits, avg_factor=1): method state_dict (line 411) | def state_dict(self, *args, **kwargs): method __getattr__ (line 418) | def __getattr__(self, name: str): method to_hf (line 424) | def to_hf(self, FILE: xtuner-train_internvideo2_5/xtuner/model/sft.py function smart_tokenizer_and_embedding_resize (line 28) | def smart_tokenizer_and_embedding_resize( class SupervisedFinetune (line 71) | class SupervisedFinetune(BaseModel): method __init__ (line 73) | def __init__(self, method gradient_checkpointing_enable (line 122) | def gradient_checkpointing_enable(self): method activation_checkpointing_enable (line 125) | def activation_checkpointing_enable(self): method gradient_checkpointing_disable (line 128) | def gradient_checkpointing_disable(self): method activation_checkpointing_disable (line 131) | def activation_checkpointing_disable(self): method _prepare_for_lora (line 134) | def _prepare_for_lora(self, method init_weights (line 147) | def init_weights(self): method _prepare_for_long_context_training (line 151) | def _prepare_for_long_context_training(cfg, llm_cfg, method _prepare_for_flash_attn (line 176) | def _prepare_for_flash_attn(cfg, llm_cfg): method _prepare_for_qlora_zero3 (line 206) | def _prepare_for_qlora_zero3(cfg): method _dispatch_lm_model_cfg (line 222) | def _dispatch_lm_model_cfg(self, cfg, max_position_embeddings=None): method _build_from_cfg_or_module (line 233) | def _build_from_cfg_or_module(self, cfg_or_mod): method forward (line 242) | def forward(self, data, data_samples=None, mode='loss'): method _forward (line 253) | def _forward(self, data, data_samples=None): method predict (line 259) | def predict(self, data, data_samples=None): method _split_for_sequence_parallel (line 265) | def _split_for_sequence_parallel(data): method _compute_sequence_parallel_loss (line 277) | def _compute_sequence_parallel_loss(self, data): method compute_loss (line 287) | def compute_loss(self, data, data_samples=None): method state_dict (line 295) | def state_dict(self, *args, **kwargs): method __getattr__ (line 302) | def __getattr__(self, name: str): method to_hf (line 308) | def to_hf(self, FILE: xtuner-train_internvideo2_5/xtuner/model/transformers_models/deepseek_v2/configuration_deepseek.py class DeepseekV2Config (line 11) | class DeepseekV2Config(PretrainedConfig): method __init__ (line 124) | def __init__( FILE: xtuner-train_internvideo2_5/xtuner/model/transformers_models/deepseek_v2/modeling_deepseek.py function _get_unpad_data (line 76) | def _get_unpad_data(attention_mask): class DeepseekV2RMSNorm (line 89) | class DeepseekV2RMSNorm(nn.Module): method __init__ (line 91) | def __init__(self, hidden_size, eps=1e-6): method forward (line 97) | def forward(self, hidden_states): class DeepseekV2RotaryEmbedding (line 109) | class DeepseekV2RotaryEmbedding(nn.Module): method __init__ (line 111) | def __init__(self, method _set_cos_sin_cache (line 134) | def _set_cos_sin_cache(self, seq_len, device, dtype): method forward (line 147) | def forward(self, x, seq_len=None): class DeepseekV2LinearScalingRotaryEmbedding (line 160) | class DeepseekV2LinearScalingRotaryEmbedding(DeepseekV2RotaryEmbedding): method __init__ (line 166) | def __init__( method _set_cos_sin_cache (line 177) | def _set_cos_sin_cache(self, seq_len, device, dtype): class DeepseekV2DynamicNTKScalingRotaryEmbedding (line 193) | class DeepseekV2DynamicNTKScalingRotaryEmbedding(DeepseekV2RotaryEmbeddi... method __init__ (line 199) | def __init__( method _set_cos_sin_cache (line 210) | def _set_cos_sin_cache(self, seq_len, device, dtype): function yarn_find_correction_dim (line 236) | def yarn_find_correction_dim(num_rotations, function yarn_find_correction_range (line 246) | def yarn_find_correction_range(low_rot, function yarn_get_mscale (line 258) | def yarn_get_mscale(scale=1, mscale=1): function yarn_linear_ramp_mask (line 264) | def yarn_linear_ramp_mask(min, max, dim): class DeepseekV2YarnRotaryEmbedding (line 273) | class DeepseekV2YarnRotaryEmbedding(DeepseekV2RotaryEmbedding): method __init__ (line 275) | def __init__( method _set_cos_sin_cache (line 296) | def _set_cos_sin_cache(self, seq_len, device, dtype): function rotate_half (line 336) | def rotate_half(x): function apply_rotary_pos_emb (line 344) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids, unsqueeze_dim=1): class DeepseekV2MLP (line 379) | class DeepseekV2MLP(nn.Module): method __init__ (line 381) | def __init__(self, config, hidden_size=None, intermediate_size=None): method forward (line 397) | def forward(self, x): class MoEGate (line 403) | class MoEGate(nn.Module): method __init__ (line 405) | def __init__(self, config): method reset_parameters (line 425) | def reset_parameters(self) -> None: method forward (line 430) | def forward(self, hidden_states): class AddAuxiliaryLoss (line 502) | class AddAuxiliaryLoss(torch.autograd.Function): method forward (line 507) | def forward(ctx, x, loss): method backward (line 514) | def backward(ctx, grad_output): class ExpertShard (line 522) | class ExpertShard(nn.Module): method __init__ (line 524) | def __init__(self, config, shard_idx, expert_in_one_shard=10): method reset_parameters (line 539) | def reset_parameters(self) -> None: method expert_forward (line 545) | def expert_forward(self, current_state, expert_idx): method forward (line 555) | def forward(self, hidden_states, flat_topk_idx, y): class DeepseekV2MoEShard (line 563) | class DeepseekV2MoEShard(nn.Module): method __init__ (line 566) | def __init__(self, config): method forward (line 597) | def forward(self, hidden_states): class DeepseekV2MoE (line 623) | class DeepseekV2MoE(nn.Module): method __init__ (line 626) | def __init__(self, config): method forward (line 658) | def forward(self, hidden_states): method moe_infer (line 684) | def moe_infer(self, x, topk_ids, topk_weight): function repeat_kv (line 754) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class DeepseekV2Attention (line 773) | class DeepseekV2Attention(nn.Module): method __init__ (line 776) | def __init__(self, method _init_rope (line 845) | def _init_rope(self): method _shape (line 890) | def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int): method forward (line 894) | def forward( class DeepseekV2FlashAttention2 (line 999) | class DeepseekV2FlashAttention2(DeepseekV2Attention): method __init__ (line 1008) | def __init__(self, *args, **kwargs): method forward (line 1017) | def forward( method _flash_attention_forward (line 1146) | def _flash_attention_forward( method _upad_input (line 1224) | def _upad_input(self, query_layer, key_layer, value_layer, attention_m... class DeepseekV2DecoderLayer (line 1278) | class DeepseekV2DecoderLayer(nn.Module): method __init__ (line 1280) | def __init__(self, config: DeepseekV2Config, layer_idx: int): method forward (line 1305) | def forward( function _load_pretrained_model (line 1367) | def _load_pretrained_model( class DeepseekV2PreTrainedModel (line 1421) | class DeepseekV2PreTrainedModel(PreTrainedModel): method _init_weights (line 1431) | def _init_weights(self, module): method from_pretrained (line 1443) | def from_pretrained(cls, pretrained_model_name_or_path, *args, **kwargs): class DeepseekV2Model (line 1529) | class DeepseekV2Model(DeepseekV2PreTrainedModel): method __init__ (line 1537) | def __init__(self, config: DeepseekV2Config): method get_input_embeddings (line 1557) | def get_input_embeddings(self): method set_input_embeddings (line 1560) | def set_input_embeddings(self, value): method forward (line 1564) | def forward( class DeepseekV2ForCausalLM (line 1718) | class DeepseekV2ForCausalLM(DeepseekV2PreTrainedModel): method __init__ (line 1721) | def __init__(self, config): method get_input_embeddings (line 1731) | def get_input_embeddings(self): method set_input_embeddings (line 1734) | def set_input_embeddings(self, value): method get_output_embeddings (line 1737) | def get_output_embeddings(self): method set_output_embeddings (line 1740) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 1743) | def set_decoder(self, decoder): method get_decoder (line 1746) | def get_decoder(self): method forward (line 1752) | def forward( method prepare_inputs_for_generation (line 1842) | def prepare_inputs_for_generation( method _reorder_cache (line 1901) | def _reorder_cache(past_key_values, beam_idx): class DeepseekV2ForSequenceClassification (line 1925) | class DeepseekV2ForSequenceClassification(DeepseekV2PreTrainedModel): method __init__ (line 1927) | def __init__(self, config): method get_input_embeddings (line 1936) | def get_input_embeddings(self): method set_input_embeddings (line 1939) | def set_input_embeddings(self, value): method forward (line 1943) | def forward( FILE: xtuner-train_internvideo2_5/xtuner/model/transformers_models/deepseek_v2/tokenization_deepseek_fast.py class DeepseekTokenizerFast (line 6) | class DeepseekTokenizerFast(LlamaTokenizerFast): method convert_ids_to_tokens (line 8) | def convert_ids_to_tokens( method _convert_id_to_token (line 35) | def _convert_id_to_token(self, index: int) -> Optional[str]: FILE: xtuner-train_internvideo2_5/xtuner/model/transformers_models/mixtral/configuration_mixtral.py class MixtralConfig (line 22) | class MixtralConfig(PretrainedConfig): method __init__ (line 114) | def __init__( FILE: xtuner-train_internvideo2_5/xtuner/model/transformers_models/mixtral/modeling_mixtral.py function load_balancing_loss_func (line 56) | def load_balancing_loss_func( function _get_unpad_data (line 138) | def _get_unpad_data(attention_mask): class MixtralRMSNorm (line 152) | class MixtralRMSNorm(nn.Module): method __init__ (line 154) | def __init__(self, hidden_size, eps=1e-6): method forward (line 160) | def forward(self, hidden_states): class MixtralRotaryEmbedding (line 170) | class MixtralRotaryEmbedding(nn.Module): method __init__ (line 172) | def __init__(self, method _set_cos_sin_cache (line 194) | def _set_cos_sin_cache(self, seq_len, device, dtype): method forward (line 208) | def forward(self, x, seq_len=None): function rotate_half (line 221) | def rotate_half(x): function apply_rotary_pos_emb (line 229) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids, unsqueeze_dim=1): function repeat_kv (line 258) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class MixtralAttention (line 277) | class MixtralAttention(nn.Module): method __init__ (line 284) | def __init__(self, config: MixtralConfig, layer_idx: Optional[int] = N... method _shape (line 327) | def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int): method forward (line 331) | def forward( class MixtralFlashAttention2 (line 416) | class MixtralFlashAttention2(MixtralAttention): method __init__ (line 426) | def __init__(self, *args, **kwargs): method forward (line 435) | def forward( method _flash_attention_forward (line 567) | def _flash_attention_forward( method _upad_input (line 670) | def _upad_input(self, query_layer, key_layer, value_layer, attention_m... class MixtralSdpaAttention (line 722) | class MixtralSdpaAttention(MixtralAttention): method forward (line 732) | def forward( class MixtralBlockSparseTop2MLP (line 825) | class MixtralBlockSparseTop2MLP(nn.Module): method __init__ (line 827) | def __init__(self, config: MixtralConfig): method forward (line 838) | def forward(self, hidden_states): class MixtralSparseMoeBlock (line 845) | class MixtralSparseMoeBlock(nn.Module): method __init__ (line 856) | def __init__(self, config): method forward (line 873) | def forward(self, hidden_states: torch.Tensor) -> torch.Tensor: class ExpertShard (line 921) | class ExpertShard(nn.Module): method __init__ (line 923) | def __init__(self, config, expert_in_one_shard=1): method forward (line 934) | def forward(self, hidden_states, expert_mask, routing_weights, class MixtralSparseShardMoeBlock (line 955) | class MixtralSparseShardMoeBlock(nn.Module): method __init__ (line 957) | def __init__(self, config): method forward (line 981) | def forward(self, hidden_states: torch.Tensor) -> torch.Tensor: class MixtralDecoderLayer (line 1021) | class MixtralDecoderLayer(nn.Module): method __init__ (line 1023) | def __init__(self, config: MixtralConfig, layer_idx: int): method forward (line 1044) | def forward( function _load_pretrained_model (line 1107) | def _load_pretrained_model( class MixtralPreTrainedModel (line 1162) | class MixtralPreTrainedModel(PreTrainedModel): method _init_weights (line 1172) | def _init_weights(self, module): method from_pretrained (line 1184) | def from_pretrained(cls, pretrained_model_name_or_path, *args, **kwargs): class MixtralModel (line 1268) | class MixtralModel(MixtralPreTrainedModel): method __init__ (line 1276) | def __init__(self, config: MixtralConfig): method get_input_embeddings (line 1294) | def get_input_embeddings(self): method set_input_embeddings (line 1297) | def set_input_embeddings(self, value): method forward (line 1302) | def forward( class MixtralForCausalLM (line 1475) | class MixtralForCausalLM(MixtralPreTrainedModel): method __init__ (line 1478) | def __init__(self, config): method get_input_embeddings (line 1490) | def get_input_embeddings(self): method set_input_embeddings (line 1493) | def set_input_embeddings(self, value): method get_output_embeddings (line 1496) | def get_output_embeddings(self): method set_output_embeddings (line 1499) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 1502) | def set_decoder(self, decoder): method get_decoder (line 1505) | def get_decoder(self): method forward (line 1512) | def forward( method prepare_inputs_for_generation (line 1621) | def prepare_inputs_for_generation( method _reorder_cache (line 1683) | def _reorder_cache(past_key_values, beam_idx): class MixtralForSequenceClassification (line 1708) | class MixtralForSequenceClassification(MixtralPreTrainedModel): method __init__ (line 1710) | def __init__(self, config): method get_input_embeddings (line 1719) | def get_input_embeddings(self): method set_input_embeddings (line 1722) | def set_input_embeddings(self, value): method forward (line 1726) | def forward( FILE: xtuner-train_internvideo2_5/xtuner/model/utils.py function set_obj_dtype (line 14) | def set_obj_dtype(d): function try_build_module (line 20) | def try_build_module(cfg): function traverse_dict (line 33) | def traverse_dict(d): function find_all_linear_names (line 47) | def find_all_linear_names(model): class LoadWoInit (line 61) | class LoadWoInit: method __init__ (line 64) | def __init__(self): method __enter__ (line 73) | def __enter__(self, *args, **kwargs): method __exit__ (line 82) | def __exit__(self, *args, **kwargs): function get_peft_model_state_dict (line 92) | def get_peft_model_state_dict(model, state_dict=None, adapter_name='defa... function prepare_inputs_labels_for_multimodal (line 138) | def prepare_inputs_labels_for_multimodal( function make_inputs_require_grad (line 293) | def make_inputs_require_grad(module, input, output): function guess_load_checkpoint (line 297) | def guess_load_checkpoint(pth_model): FILE: xtuner-train_internvideo2_5/xtuner/parallel/sequence/attention.py function pre_process_for_sequence_parallel_attn (line 16) | def pre_process_for_sequence_parallel_attn(query_states, function post_process_for_sequence_parallel_attn (line 96) | def post_process_for_sequence_parallel_attn(attn_output, function sequence_parallel_wrapper (line 130) | def sequence_parallel_wrapper(local_attn): FILE: xtuner-train_internvideo2_5/xtuner/parallel/sequence/comm.py function _all_to_all (line 9) | def _all_to_all( class _AllToAll (line 25) | class _AllToAll(torch.autograd.Function): method forward (line 36) | def forward(ctx: Any, input: Tensor, sp_group: dist.ProcessGroup, method backward (line 47) | def backward(ctx: Any, grad_output: Tensor) -> Tuple: function all_to_all (line 63) | def all_to_all( function split_for_sequence_parallel (line 90) | def split_for_sequence_parallel(input, dim: int, sp_group: dist.ProcessG... function gather_for_sequence_parallel (line 117) | def gather_for_sequence_parallel(input, dim: int, sp_group: dist.Process... class _GatherForwardSplitBackward (line 144) | class _GatherForwardSplitBackward(torch.autograd.Function): method forward (line 152) | def forward(ctx, input, dim, sp_group, grad_scale): method backward (line 159) | def backward(ctx, grad_output): class _SplitForwardGatherBackward (line 169) | class _SplitForwardGatherBackward(torch.autograd.Function): method forward (line 177) | def forward(ctx, input, dim, sp_group, grad_scale): method backward (line 184) | def backward(ctx, grad_output): function split_forward_gather_backward (line 193) | def split_forward_gather_backward(input, dim, sp_group, grad_scale=None): function gather_forward_split_backward (line 207) | def gather_forward_split_backward(input, dim, sp_group, grad_scale=None): FILE: xtuner-train_internvideo2_5/xtuner/parallel/sequence/data_collate.py function pad_for_sequence_parallel (line 7) | def pad_for_sequence_parallel(tensor, padding_value, dim=-1): function pad_cumulative_len_for_sequence_parallel (line 26) | def pad_cumulative_len_for_sequence_parallel(cumulative_len): FILE: xtuner-train_internvideo2_5/xtuner/parallel/sequence/reduce_loss.py class _ReduceLoss (line 7) | class _ReduceLoss(torch.autograd.Function): method forward (line 10) | def forward(ctx, mean_loss, loss_scale, process_group): method backward (line 22) | def backward(ctx, grad_output): function reduce_sequence_parallel_loss (line 26) | def reduce_sequence_parallel_loss(mean_loss, FILE: xtuner-train_internvideo2_5/xtuner/parallel/sequence/sampler.py class SequenceParallelSampler (line 12) | class SequenceParallelSampler(DefaultSampler): method __init__ (line 14) | def __init__(self, FILE: xtuner-train_internvideo2_5/xtuner/parallel/sequence/setup_distributed.py function init_sequence_parallel (line 17) | def init_sequence_parallel(sequence_parallel_size: int = 1): function init_inner_sequence_parallel (line 56) | def init_inner_sequence_parallel(inner_sequence_parallel_size: int = 1): function is_inner_sequence_parallel_initialized (line 82) | def is_inner_sequence_parallel_initialized(): function get_inner_sequence_parallel_group (line 86) | def get_inner_sequence_parallel_group(): function get_inner_sequence_parallel_world_size (line 90) | def get_inner_sequence_parallel_world_size(): function get_inner_sequence_parallel_rank (line 102) | def get_inner_sequence_parallel_rank(): function get_sequence_parallel_group (line 114) | def get_sequence_parallel_group(): function get_sequence_parallel_world_size (line 119) | def get_sequence_parallel_world_size(): function get_sequence_parallel_rank (line 132) | def get_sequence_parallel_rank(): function get_data_parallel_group (line 145) | def get_data_parallel_group(): function get_data_parallel_world_size (line 152) | def get_data_parallel_world_size(): function get_data_parallel_rank (line 165) | def get_data_parallel_rank(): FILE: xtuner-train_internvideo2_5/xtuner/tools/chat.py function remove_prefix (line 26) | def remove_prefix(state_dict, prefix): function parse_args (line 37) | def parse_args(): function get_input (line 131) | def get_input(): function main (line 146) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/tools/check_custom_dataset.py function parse_args (line 13) | def parse_args(): function is_standard_format (line 22) | def is_standard_format(dataset): function main (line 40) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/tools/copy_cfg.py function parse_args (line 11) | def parse_args(): function add_copy_suffix (line 19) | def add_copy_suffix(string): function main (line 24) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/tools/data_preprocess/arxiv.py function parse_args (line 7) | def parse_args(): function has_intersection (line 25) | def has_intersection(list1, list2): function read_json_file (line 31) | def read_json_file(file_path): function main (line 43) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/tools/data_preprocess/convert_refcoco.py function parse_args (line 8) | def parse_args(): FILE: xtuner-train_internvideo2_5/xtuner/tools/eval_refcoco.py function merge_outputs (line 31) | def merge_outputs(otuputs): function master_print (line 44) | def master_print(msg): function parse_args (line 48) | def parse_args(): function eval_iou (line 110) | def eval_iou(answers): function build_model (line 143) | def build_model(args): function generate (line 233) | def generate( function main (line 299) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/tools/get_data_order.py function parse_args (line 6) | def parse_args(): function save_data_order (line 18) | def save_data_order(data_folder, save_folder, file_type='.bin'): FILE: xtuner-train_internvideo2_5/xtuner/tools/list_cfg.py function parse_args (line 7) | def parse_args(): function main (line 15) | def main(pattern=None): FILE: xtuner-train_internvideo2_5/xtuner/tools/list_dataset_format.py function main (line 5) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/tools/log_dataset.py function parse_args (line 9) | def parse_args(): function main (line 22) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/tools/mmbench.py function parse_args (line 38) | def parse_args(): function master_print (line 95) | def master_print(msg): class MMBenchDataset (line 99) | class MMBenchDataset(Dataset): method __init__ (line 116) | def __init__(self, data_file): method get_image (line 122) | def get_image(self, image): method __len__ (line 130) | def __len__(self): method __getitem__ (line 133) | def __getitem__(self, idx): method load_from_df (line 166) | def load_from_df(self, idx, key): method eval_result (line 173) | def eval_result(self, result_df, show=True): function main (line 271) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/tools/model_converters/merge.py function parse_args (line 12) | def parse_args(): function main (line 43) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/tools/model_converters/modeling_internlm2_reward/configuration_internlm2.py class InternLM2Config (line 28) | class InternLM2Config(PretrainedConfig): method __init__ (line 78) | def __init__( # pylint: disable=W0102 method _rope_scaling_validation (line 135) | def _rope_scaling_validation(self): FILE: xtuner-train_internvideo2_5/xtuner/tools/model_converters/modeling_internlm2_reward/modeling_internlm2.py function _import_flash_attn (line 56) | def _import_flash_attn(): function _get_unpad_data (line 68) | def _get_unpad_data(attention_mask): function _make_causal_mask (line 81) | def _make_causal_mask( function _expand_mask (line 99) | def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Option... class InternLM2RMSNorm (line 114) | class InternLM2RMSNorm(nn.Module): method __init__ (line 115) | def __init__(self, hidden_size, eps=1e-6): method forward (line 123) | def forward(self, hidden_states): class InternLM2RotaryEmbedding (line 132) | class InternLM2RotaryEmbedding(nn.Module): method __init__ (line 133) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method _set_cos_sin_cache (line 147) | def _set_cos_sin_cache(self, seq_len, device, dtype): method forward (line 157) | def forward(self, x, seq_len=None): class InternLM2LinearScalingRotaryEmbedding (line 169) | class InternLM2LinearScalingRotaryEmbedding(InternLM2RotaryEmbedding): method __init__ (line 172) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method _set_cos_sin_cache (line 176) | def _set_cos_sin_cache(self, seq_len, device, dtype): class InternLM2DynamicNTKScalingRotaryEmbedding (line 189) | class InternLM2DynamicNTKScalingRotaryEmbedding(InternLM2RotaryEmbedding): method __init__ (line 194) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method _set_cos_sin_cache (line 198) | def _set_cos_sin_cache(self, seq_len, device, dtype): function rotate_half (line 218) | def rotate_half(x): function apply_rotary_pos_emb (line 226) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids, unsqueeze_dim=1): class InternLM2MLP (line 235) | class InternLM2MLP(nn.Module): method __init__ (line 236) | def __init__(self, config): method forward (line 246) | def forward(self, x): function repeat_kv (line 253) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class InternLM2Attention (line 266) | class InternLM2Attention(nn.Module): method __init__ (line 269) | def __init__(self, config: InternLM2Config): method _init_rope (line 295) | def _init_rope(self): method _shape (line 323) | def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int): method forward (line 326) | def forward( class InternLM2FlashAttention2 (line 415) | class InternLM2FlashAttention2(InternLM2Attention): method forward (line 422) | def forward( method _flash_attention_forward (line 494) | def _flash_attention_forward( method _unpad_input (line 548) | def _unpad_input(self, query_layer, key_layer, value_layer, attention_... class InternLM2DecoderLayer (line 593) | class InternLM2DecoderLayer(nn.Module): method __init__ (line 594) | def __init__(self, config: InternLM2Config): method forward (line 604) | def forward( class InternLM2PreTrainedModel (line 689) | class InternLM2PreTrainedModel(PreTrainedModel): method _init_weights (line 696) | def _init_weights(self, module): class InternLM2Model (line 778) | class InternLM2Model(InternLM2PreTrainedModel): method __init__ (line 788) | def __init__(self, config: InternLM2Config): method get_input_embeddings (line 803) | def get_input_embeddings(self): method set_input_embeddings (line 806) | def set_input_embeddings(self, value): method _prepare_decoder_attention_mask (line 809) | def _prepare_decoder_attention_mask(self, attention_mask, input_shape,... method forward (line 833) | def forward( class InternLM2ForCausalLM (line 967) | class InternLM2ForCausalLM(InternLM2PreTrainedModel): method __init__ (line 972) | def __init__(self, config): method get_input_embeddings (line 981) | def get_input_embeddings(self): method set_input_embeddings (line 984) | def set_input_embeddings(self, value): method get_output_embeddings (line 987) | def get_output_embeddings(self): method set_output_embeddings (line 990) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 993) | def set_decoder(self, decoder): method get_decoder (line 996) | def get_decoder(self): method forward (line 1001) | def forward( method prepare_inputs_for_generation (line 1088) | def prepare_inputs_for_generation( method _reorder_cache (line 1128) | def _reorder_cache(past_key_values, beam_idx): method build_inputs (line 1136) | def build_inputs(self, tokenizer, query: str, history: List[Tuple[str,... method chat (line 1149) | def chat( method stream_chat (line 1185) | def stream_chat( class InternLM2ForRewardModel (line 1271) | class InternLM2ForRewardModel(InternLM2PreTrainedModel): method __init__ (line 1276) | def __init__(self, config): method get_input_embeddings (line 1286) | def get_input_embeddings(self): method set_input_embeddings (line 1289) | def set_input_embeddings(self, value): method get_output_embeddings (line 1292) | def get_output_embeddings(self): method set_output_embeddings (line 1295) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 1298) | def set_decoder(self, decoder): method get_decoder (line 1301) | def get_decoder(self): method forward (line 1306) | def forward( method get_score (line 1386) | def get_score( method get_scores (line 1403) | def get_scores( method compare (line 1428) | def compare( method rank (line 1444) | def rank( class InternLM2ForSequenceClassification (line 1474) | class InternLM2ForSequenceClassification(InternLM2PreTrainedModel): method __init__ (line 1475) | def __init__(self, config): method get_input_embeddings (line 1484) | def get_input_embeddings(self): method set_input_embeddings (line 1487) | def set_input_embeddings(self, value): method forward (line 1491) | def forward( FILE: xtuner-train_internvideo2_5/xtuner/tools/model_converters/pth_to_hf.py function parse_args (line 20) | def parse_args(): function main (line 60) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/tools/model_converters/split.py function parse_args (line 13) | def parse_args(): function main (line 22) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/tools/plugins/api.py function plugins_api (line 5) | def plugins_api(input_str, FILE: xtuner-train_internvideo2_5/xtuner/tools/plugins/calculate.py function Calculate (line 5) | def Calculate(expression): FILE: xtuner-train_internvideo2_5/xtuner/tools/plugins/search.py function parse_results (line 15) | def parse_results(results, k=10): function search (line 26) | def search(api_key, search_term, **kwargs): function Search (line 47) | def Search(q, k=10): FILE: xtuner-train_internvideo2_5/xtuner/tools/plugins/solve.py function Solve (line 11) | def Solve(equations_str): FILE: xtuner-train_internvideo2_5/xtuner/tools/process_untokenized_datasets.py function parse_args (line 15) | def parse_args(): function modify_config (line 23) | def modify_config(config, dataset_save_folder): function process_untokenized_dataset (line 45) | def process_untokenized_dataset(config): FILE: xtuner-train_internvideo2_5/xtuner/tools/process_untokenized_datasets_legacy.py function parse_args (line 42) | def parse_args(): function process_one (line 78) | def process_one(fp, function process_untokenized_dataset (line 109) | def process_untokenized_dataset(folder, FILE: xtuner-train_internvideo2_5/xtuner/tools/process_untokenized_llava_data.py function parse_args (line 13) | def parse_args(): function build_llava_dataset (line 21) | def build_llava_dataset(config): FILE: xtuner-train_internvideo2_5/xtuner/tools/test.py function parse_args (line 16) | def parse_args(): function register_function (line 45) | def register_function(cfg_dict): function main (line 60) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/tools/tokenize_ftdp_datasets.py function chatml_format (line 95) | def chatml_format( function write_bin_meta_bin (line 271) | def write_bin_meta_bin(path, dataset_name, filename, samples): function tokenize_and_save (line 320) | def tokenize_and_save(tokenizer, processed_dir, tokenized_dir): function tokenizer_add_special_tokens (line 389) | def tokenizer_add_special_tokens(tokenizer): function save_new_tokenizer (line 397) | def save_new_tokenizer(tokenizer, save_dir): function parse_args (line 402) | def parse_args(): function main (line 419) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/tools/train.py function parse_args (line 29) | def parse_args(): function register_function (line 65) | def register_function(cfg_dict): function check_cfg (line 80) | def check_cfg(cfg, args): function main (line 127) | def main(): FILE: xtuner-train_internvideo2_5/xtuner/tools/utils.py function get_base_model (line 13) | def get_base_model(model): function get_streamer (line 21) | def get_streamer(model): class DecodeOutputStreamer (line 41) | class DecodeOutputStreamer(BaseStreamer): method __init__ (line 44) | def __init__(self, tokenizer, skip_prompt=True) -> None: method _decode_with_raw_id (line 59) | def _decode_with_raw_id(self, value): method _decode_fallback (line 74) | def _decode_fallback(self, value): method put (line 83) | def put(self, value): method end (line 94) | def end(self): class NoSpaceStreamer (line 100) | class NoSpaceStreamer(DecodeOutputStreamer): method __init__ (line 102) | def __init__(self, tokenizer, skip_prompt=True) -> None: method decode (line 113) | def decode(self, value): function get_stop_criteria (line 123) | def get_stop_criteria( function auto_dtype_of_deepspeed_config (line 133) | def auto_dtype_of_deepspeed_config(ds_config): function is_cn_string (line 152) | def is_cn_string(s): function get_seed_from_checkpoint (line 158) | def get_seed_from_checkpoint(pth_model): FILE: xtuner-train_internvideo2_5/xtuner/utils/fileio.py function patch_func (line 8) | def patch_func(module, fn_name_to_wrap): function patch_fileio (line 23) | def patch_fileio(global_vars=None): function patch_hf_auto_from_pretrained (line 231) | def patch_hf_auto_from_pretrained(petrel_hub): function patch_hf_save_pretrained (line 279) | def patch_hf_save_pretrained(): function patch_deepspeed_engine (line 320) | def patch_deepspeed_engine(): FILE: xtuner-train_internvideo2_5/xtuner/utils/handle_moe_load_and_save.py function print_on_rank0 (line 33) | def print_on_rank0(info): function get_expert_num_per_shard (line 38) | def get_expert_num_per_shard(model): function mix_sort (line 44) | def mix_sort(expert_name): function _get_merged_param_name (line 50) | def _get_merged_param_name(origin_param_name, expert_num_per_shard): function _merge_experts_weight (line 61) | def _merge_experts_weight(state_dict, expert_num_per_shard, order_mapping): function load_state_dict_into_model (line 100) | def load_state_dict_into_model(model_to_load, pretrained_model_path): function _get_origin_param_name (line 172) | def _get_origin_param_name(merged_param_name, expert_num_per_shard, is_w... function _split_param (line 197) | def _split_param(merged_param, is_w1w3): function get_origin_state_dict (line 207) | def get_origin_state_dict(state_dict, model): FILE: xtuner-train_internvideo2_5/xtuner/utils/stop_criteria.py class StopWordStoppingCriteria (line 5) | class StopWordStoppingCriteria(StoppingCriteria): method __init__ (line 8) | def __init__(self, tokenizer, stop_word): method __call__ (line 13) | def __call__(self, input_ids, *args, **kwargs) -> bool: FILE: xtuner-train_internvideo2_5/xtuner/utils/zero_to_any_dtype.py class zero_model_state (line 43) | class zero_model_state: function atoi (line 60) | def atoi(text): function natural_keys (line 64) | def natural_keys(text): function get_model_state_file (line 71) | def get_model_state_file(checkpoint_dir, zero_stage): function get_checkpoint_files (line 88) | def get_checkpoint_files(checkpoint_dir, glob_pattern): function get_optim_files (line 102) | def get_optim_files(checkpoint_dir): function get_model_state_files (line 106) | def get_model_state_files(checkpoint_dir): function parse_model_states (line 110) | def parse_model_states(files, dtype=DEFAULT_DTYPE): function parse_optim_states (line 161) | def parse_optim_states(files, ds_checkpoint_dir, dtype=DEFAULT_DTYPE): function _get_state_dict_from_zero_checkpoint (line 217) | def _get_state_dict_from_zero_checkpoint(ds_checkpoint_dir, function _zero2_merge_frozen_params (line 250) | def _zero2_merge_frozen_params(state_dict, zero_model_states): function _has_callable (line 286) | def _has_callable(obj, fn): function _zero2_merge_trainable_params (line 291) | def _zero2_merge_trainable_params(state_dict, world_size, flat_groups, function _get_state_dict_from_zero2_checkpoint (line 378) | def _get_state_dict_from_zero2_checkpoint(world_size, flat_groups, function zero3_partitioned_param_info (line 403) | def zero3_partitioned_param_info(unpartitioned_numel, world_size): function _zero3_merge_frozen_params (line 410) | def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states): function _zero3_merge_trainable_params (line 457) | def _zero3_merge_trainable_params(state_dict, world_size, flat_groups, function _get_state_dict_from_zero3_checkpoint (line 536) | def _get_state_dict_from_zero3_checkpoint(world_size, flat_groups, function get_state_dict_from_zero_checkpoint (line 561) | def get_state_dict_from_zero_checkpoint(checkpoint_dir, function convert_zero_checkpoint_to_state_dict (line 622) | def convert_zero_checkpoint_to_state_dict(checkpoint_dir, function load_state_dict_from_zero_checkpoint (line 648) | def load_state_dict_from_zero_checkpoint(model, FILE: xtuner-train_internvideo2_5/xtuner/version.py function parse_version_info (line 6) | def parse_version_info(version_str):