MCPcopy Create free account

hub / github.com/ASTRAL-Group/ASTRA / functions

Functions656 in github.com/ASTRAL-Group/ASTRA

↓ 214 callersMethodadd_argument
Assume the first argument is the name of the argument.
minigpt4/common/config.py:220
↓ 179 callersFunctionprint
(*args, **kwargs)
minigpt4/common/dist_utils.py:25
↓ 97 callersMethodget
r"""Get an item from registry with key 'name' Args: name (string): Key whose value needs to be retrieved. default: If
minigpt4/common/registry.py:284
↓ 85 callersMethodfrom_pretrained
Build a pretrained model from default configuration file, specified by model_type. Args: - model_type (str): model type,
minigpt4/models/base_model.py:59
↓ 37 callersMethodgenerate
(self, prompt)
minigpt_utils/generator.py:39
↓ 24 callersMethodfrom_config
(cls, cfg)
minigpt4/models/mini_gpt4.py:232
↓ 21 callersMethodparse_args
()
image_attr/image_attr_minigpt.py:77
↓ 14 callersMethod__init__
(self, config, layer_num)
minigpt4/models/Qformer.py:379
↓ 14 callersMethodget_model_class
(cls, name)
minigpt4/common/registry.py:236
↓ 13 callersMethodget_processor_class
(cls, name)
minigpt4/common/registry.py:244
↓ 12 callersMethodvisualize_attr
(self, attr_index: Optional[NDArray] = None, flip=False)
image_attr/context_partitioner.py:123
↓ 11 callersMethodget_image
(self, mask: Optional[NDArray] = None)
image_attr/context_partitioner.py:116
↓ 10 callersMethodmax
(self)
minigpt4/common/logger.py:65
↓ 9 callersMethodupdate
(self, **kwargs)
minigpt4/common/logger.py:87
↓ 7 callersFunctionis_dist_avail_and_initialized
()
minigpt4/common/dist_utils.py:33
↓ 7 callersMethodtranspose_for_scores
(self, x)
minigpt4/models/Qformer.py:161
↓ 7 callersMethodupdate_context_embs
(self)
minigpt_utils/prompt_wrapper.py:78
↓ 6 callersMethod__init__
( self, hidden_size: int, intermediate_size: int, hidden_act: str, )
minigpt4/models/modeling_llama.py:127
↓ 6 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
minigpt4/models/eva_vit.py:45
↓ 6 callersFunctionchar_to_token
(output_tokens, char_index)
image_attr/utils.py:476
↓ 6 callersMethodget_attributions
Get the attributions for (part of) the response. Arguments: start_idx (int, optional): Start index of th
image_attr/image_attr_qwen.py:239
↓ 6 callersMethodinit_image_query
( self, image: Image, query: str, source_type: str = "patch", generate
image_attr/image_attr_qwen.py:75
↓ 6 callersMethodset_p
(self, p)
image_attr/context_partitioner.py:76
↓ 6 callersMethodspecify_output
(self, jb_output)
image_attr/image_attr_qwen.py:140
↓ 5 callersFunction_compute_logit_probs
(logits, labels)
image_attr/utils.py:122
↓ 5 callersMethodbackward
(ctx, *grads)
minigpt4/models/base_model.py:197
↓ 5 callersMethodregister_path
r"""Register a path to registry with key 'name' Args: name: Key with which the path will be registered. Usage:
minigpt4/common/registry.py:189
↓ 4 callersFunction_build_proc_from_cfg
(cfg)
minigpt4/models/__init__.py:77
↓ 4 callersMethod_build_proc_from_cfg
(cfg)
minigpt4/datasets/builders/base_dataset_builder.py:80
↓ 4 callersFunction_create_vlm_regression_dataset
( num_masks, num_sources, get_query_ids, partitioner, response, response_ids, alpha, base_seed=0 )
image_attr/utils.py:91
↓ 4 callersMethodbuild_processors
(self)
minigpt4/datasets/builders/base_dataset_builder.py:61
↓ 4 callersMethoddefault_config_path
(cls, model_type)
minigpt4/models/base_model.py:75
↓ 4 callersFunctiondownload_cached_file
Download a file from a URL and cache it locally. If the file already exists, it is not downloaded again. If distributed, only the main proces
minigpt4/common/dist_utils.py:117
↓ 4 callersFunctionenhance_level_to_args
(MAX_LEVEL)
minigpt4/processors/randaugment.py:223
↓ 4 callersMethodfit
( self, masks: NDArray, outputs: NDArray, num_output_tokens: int )
image_attr/solver.py:20
↓ 4 callersMethodget_path
(cls, name)
minigpt4/common/registry.py:280
↓ 4 callersFunctionget_rank
()
minigpt4/common/dist_utils.py:47
↓ 4 callersFunctionis_main_process
()
minigpt4/common/dist_utils.py:53
↓ 4 callersMethodlog_every
(self, iterable, print_freq, header=None)
minigpt4/common/logger.py:122
↓ 4 callersFunctionnormalize
(images)
minigpt_utils/visual_attacker.py:13
↓ 3 callersMethod_convert_node_to_json
(self, node)
minigpt4/common/config.py:161
↓ 3 callersMethod_get_query_ids
( self, return_prompt: bool = False, )
image_attr/image_attr_minigpt.py:136
↓ 3 callersMethod_get_query_ids
( self, return_prompt: bool = False, )
image_attr/image_attr_llava.py:94
↓ 3 callersMethod_get_query_ids
( self, return_prompt: bool = False, )
image_attr/image_attr_qwen.py:97
↓ 3 callersFunctionaggregate_logit_probs
Compute sequence-level outputs from token-level logit-probabilities.
image_attr/utils.py:388
↓ 3 callersMethodappend_message
(self, role, message)
minigpt4/conversation/conversation.py:75
↓ 3 callersFunctionconcat_all_gather
Performs all_gather operation on the provided tensors. *** Warning ***: torch.distributed.all_gather has no gradient.
minigpt4/models/base_model.py:221
↓ 3 callersFunctiondenormalize
(images)
minigpt_utils/visual_attacker.py:20
↓ 3 callersMethodencode_img
(self, image)
minigpt4/models/mini_gpt4.py:129
↓ 3 callersMethodget_builder_class
(cls, name)
minigpt4/common/registry.py:232
↓ 3 callersMethodget_source
Get a represention of the source corresponding to a given index.
image_attr/context_partitioner.py:43
↓ 3 callersFunctionget_vlm_attributions_df
( attributions: NDArray[Any], context_partitioner, top_k: Optional[int] = None, )
image_attr/utils.py:449
↓ 3 callersFunctionis_url
(url_or_filename)
minigpt4/common/utils.py:41
↓ 3 callersFunctionload_dataset_config
(cfg_path)
minigpt4/datasets/builders/base_dataset_builder.py:232
↓ 3 callersFunctionmakedir
Create the directory if it does not exist.
minigpt4/common/utils.py:64
↓ 3 callersMethodprompt_wrap
(self, img_embeds, atts_img, prompt)
minigpt4/models/mini_gpt4.py:151
↓ 3 callersMethodregister
r"""Register an item to registry with key 'name' Args: name: Key with which the item will be registered. Usage::
minigpt4/common/registry.py:205
↓ 3 callersMethodstep
(self, cur_epoch, cur_step)
minigpt4/common/optims.py:37
↓ 3 callersMethodunwrap_dist_model
(self, model)
minigpt4/runners/runner_base.py:485
↓ 3 callersMethodvalue
(self)
minigpt4/common/logger.py:69
↓ 3 callersMethodwrap_prompt_simple
(self, text_prompt_template, adv_prompt, batch_size)
minigpt_utils/text_attacker.py:91
↓ 2 callersMethod__init__
(self, context: str)
image_attr/context_partitioner.py:30
↓ 2 callersMethod__init__
(self, prompt="", max_words=50)
minigpt4/processors/blip_processors.py:30
↓ 2 callersMethod_compute_vlm_masks_and_logit_probs
(self)
image_attr/image_attr_minigpt.py:227
↓ 2 callersMethod_compute_vlm_masks_and_logit_probs
(self)
image_attr/image_attr_llava.py:189
↓ 2 callersMethod_compute_vlm_masks_and_logit_probs
(self)
image_attr/image_attr_qwen.py:203
↓ 2 callersFunction_create_mask
(num_sources, alpha, seed)
image_attr/utils.py:65
↓ 2 callersMethod_save_checkpoint
Save the checkpoint at the current epoch.
minigpt4/runners/runner_base.py:575
↓ 2 callersMethod_train_inner_loop
An inner training loop compatible with both epoch-based and iter-based training. When using epoch-based, training stops after one ep
minigpt4/tasks/base_task.py:155
↓ 2 callersFunction_urlretrieve
(url: str, filename: str, chunk_size: int = 1024)
minigpt4/common/utils.py:154
↓ 2 callersMethodadd_meter
(self, name, meter)
minigpt4/common/logger.py:119
↓ 2 callersMethodattack_loss
(self, prompts, targets)
minigpt_utils/visual_attacker.py:184
↓ 2 callersMethodattack_loss
(self, prompts, targets)
minigpt_utils/text_attacker.py:212
↓ 2 callersMethoddevice
(self)
minigpt4/models/base_model.py:26
↓ 2 callersFunctiondownload_url
Download a file from a url and place it in root. Args: url (str): URL to download file from root (str): Directory to place downloa
minigpt4/common/utils.py:167
↓ 2 callersMethodeval_epoch
Evaluate the model on a given split. Args: split_name (str): name of the split to evaluate on. cur_epoch (in
minigpt4/runners/runner_base.py:451
↓ 2 callersMethodformat_arguments
(self)
minigpt4/common/config.py:248
↓ 2 callersMethodformat_help
(self)
minigpt4/common/config.py:251
↓ 2 callersMethodfrom_config
(cls, cfg=None)
minigpt4/processors/base_processor.py:20
↓ 2 callersMethodgenerate_img_embedding
(self, img_prompts)
minigpt_utils/prompt_wrapper.py:118
↓ 2 callersMethodgenerate_text_embedding
(self, text_prompts)
minigpt_utils/prompt_wrapper.py:97
↓ 2 callersMethodget_extended_attention_mask
Makes broadcastable attention and causal masks so that future and masked tokens are ignored. Arguments: attention_mask (
minigpt4/models/Qformer.py:713
↓ 2 callersFunctionget_world_size
()
minigpt4/common/dist_utils.py:41
↓ 2 callersFunctionis_none
(value)
utility_eval/minigpt_mmbench.py:64
↓ 2 callersFunctionis_none
(value)
utility_eval/llava_mmbench.py:48
↓ 2 callersFunctionis_none
(value)
utility_eval/qwen_mmbench.py:51
↓ 2 callersMethodload_checkpoint
Load from a finetuned checkpoint. This should expect no mismatch in the model keys and the checkpoint keys.
minigpt4/models/base_model.py:29
↓ 2 callersMethodload_from_pretrained
(self, url_or_filename)
minigpt4/models/blip2.py:72
↓ 2 callersMethodlog_stats
(self, stats, split_name)
minigpt4/runners/runner_base.py:647
↓ 2 callersMethodmaybe_autocast
(self, dtype=torch.float16)
minigpt4/models/blip2.py:35
↓ 2 callersFunctionmove_to_cuda
(sample)
minigpt4/datasets/data_utils.py:83
↓ 2 callersMethodnext
(self, it)
minigpt4/datasets/datasets/dataloader_utils.py:101
↓ 2 callersFunctionparse_args
()
utility_eval/qwen_mmvet.py:19
↓ 2 callersMethodpatchify
(self)
image_attr/context_partitioner.py:80
↓ 2 callersMethodplot_loss
(self)
minigpt_utils/visual_attacker.py:162
↓ 2 callersMethodpreload
(self, it)
minigpt4/datasets/datasets/dataloader_utils.py:76
↓ 2 callersFunctionprepare_sample
(samples, cuda_enabled=True)
minigpt4/datasets/data_utils.py:90
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
minigpt4/models/modeling_llama.py:109
↓ 2 callersFunctionshear_level_to_args
(MAX_LEVEL, replace_value)
minigpt4/processors/randaugment.py:230
↓ 2 callersMethodsplit_context
Split text into parts and cache the parts and separators.
image_attr/context_partitioner.py:155
next →1–100 of 656, ranked by callers