MCPcopy Create free account

hub / github.com/FightingFighting/cross-modal-information-flow-in-MLLM / functions

Functions54 in github.com/FightingFighting/cross-modal-information-flow-in-MLLM

↓ 11 callersFunctionread_csv
(path)
vil/merge_lineplot.py:23
↓ 7 callersFunctionfind_token_range
Find the tokens corresponding to the given substring in token_array.
InformationFlow.py:136
↓ 4 callersFunctionmerge
(model_name, operation_path, window)
vil/merge_lineplot.py:134
↓ 3 callersFunctionchange_values
(values, coef_val, only_knockout_question, question_range)
methods.py:29
↓ 3 callersFunctiongenerate_legend
(data, operation_path, model_name, y="relative diff first", palette=None, save_fold=None)
vil/merge_lineplot.py:36
↓ 3 callersFunctiongenerate_plot
(data, save_file, operation_path, model_name, y="relative diff first", layer_num=None, palette=None, save_fold
vil/merge_lineplot.py:67
↓ 3 callersFunctionget_projection
(name, E)
methods.py:119
↓ 2 callersFunctionblockdesc2range
(des, dataset_dict, question_id, input_ids, inputs_embeds_shape, tokenizer, model_name)
InformationFlow.py:233
↓ 2 callersFunctioncreate_data_loader
(questions, image_folder, batch_size, num_workers, tokenizer, image_processor, model_config, task_name, conv_m
InformationFlow.py:129
↓ 2 callersFunctionpatch_hs
(name, position_hs, patch_input)
methods.py:210
↓ 2 callersFunctionrun_original
(model, inps, tokenizer, model_name, mask_tensor=None, args=None)
InformationFlow.py:205
↓ 1 callersFunctionInforFlowAna
(args)
InformationFlow.py:359
↓ 1 callersFunctionblockdesc2range_patches
(des, input_ids, inputs_embeds_shape, central_object_patch_indices, pad_patch_indices, hd_patch_indice, object
InformationFlow.py:314
↓ 1 callersFunctioncache_hiddenstate
(data_loader, questions, model, tokenizer, dataset_dict, model_name)
last_position_answer_prob.py:82
↓ 1 callersFunctioncreate_mask_with_bbox
(image, bboxes)
utils.py:167
↓ 1 callersFunctiondecode_tokens
(tokenizer, token_array)
utils.py:98
↓ 1 callersFunctiongenerate_plot
(data, save_file,x="layer",y="score_all_objects",hue=None, layers=0)
utils.py:141
↓ 1 callersFunctiongenerate_plot_attrscore
(data, save_file, x="layer", ys="", layer_num=0)
last_position_answer_prob.py:30
↓ 1 callersFunctionget_abs_pos
(abs_pos, tgt_size)
methods.py:285
↓ 1 callersFunctionmain
(args)
last_position_answer_prob.py:128
↓ 1 callersFunctionpredict_from_input
(model, inp)
utils.py:122
↓ 1 callersFunctionremove_hooks
(hooks)
methods.py:242
↓ 1 callersFunctionremove_wrapper_llava
(model, hooks)
methods.py:247
↓ 1 callersFunctionrun_original
(model, inps, tokenizer, model_name)
last_position_answer_prob.py:61
↓ 1 callersFunctionset_block_attn_hooks_llava
Only works on llava
methods.py:43
↓ 1 callersFunctionset_proj_hooks
(model)
methods.py:173
↓ 1 callersFunctionset_requires_grad
(requires_grad, *models)
utils.py:129
↓ 1 callersFunctiontrace_with_attn_block_llava
( model, inp, from_to_index_per_layer, # A list of (source index, target index) to
methods.py:252
↓ 1 callersFunctionwrap_attn_forward
(forward_fn, model_, from_to_index_, opposite_, block_desc_)
methods.py:47
Method__getitem__
(self, index)
InformationFlow.py:59
Method__init__
( self, model_name=None, model=None, tokenizer=None, low_cpu_mem_usage=False,
utils.py:38
Method__init__
(self, questions, image_folder, tokenizer, image_processor, model_config, task_name, conv_mode)
InformationFlow.py:40
Method__len__
(self)
InformationFlow.py:114
Method__repr__
String representation of this class.
utils.py:66
Function_merge_heads
(tensor, model)
methods.py:19
Function_split_heads
(tensor, num_heads, attn_head_size)
methods.py:14
Functioncollate_fn
(batch)
InformationFlow.py:118
Functionfind_token_range
Find the tokens corresponding to the given substring in token_array.
utils.py:104
Functionforward_RESAMPLE
(self, x, attn_mask=None)
methods.py:305
Functiongenerate_llava
( self, mask=None, #[5, 3, 336, 336] args=None, inputs: Optional[torch.Tensor] = None,
InformationFlow.py:162
Functionhook
(module, input, output)
methods.py:30
Functionmake_inputs
Prepare inputs to the model.
utils.py:76
Functionpost_hook
(module, input, output)
methods.py:217
Functionpre_hook
(module, input)
methods.py:212
Functionprepare_image_patch_bbx
(self, images, image_sizes=None)
utils.py:236
Functionset_block_attn_add_hooks_llava
(model, values_per_layer, coef_value=0, only_knockout_question=None, question_range=[])
methods.py:28
Functionset_block_mlp_hooks
(model, values_per_layer, coef_value=0)
methods.py:139
Functionset_block_mlp_hooks_llava
(model, values_per_layer, coef_value=0,only_knockout_question=None, question_range=[])
methods.py:158
Functionset_get_attn_proj_hooks
Only works on GPT2
methods.py:111
Functionset_hs_patch_hooks
(model, hs_patch_config, patch_input=False)
methods.py:209
Functionshow_original_image
(image, bounding_boxes, model_name, save_name, question, answer)
utils.py:214
Functionshow_transferred_maskandimage
(mask, img, ind, model_name, save_name)
utils.py:177
Functiontrace_with_proj
(model, inp)
methods.py:323
Functionwrapper_fn
(*args, **kwargs)
methods.py:49