Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ASTRAL-Group/ASTRA
/ functions
Functions
656 in github.com/ASTRAL-Group/ASTRA
⨍
Functions
656
◇
Types & classes
97
↳
Endpoints
1
↓ 214 callers
Method
add_argument
Assume the first argument is the name of the argument.
minigpt4/common/config.py:220
↓ 179 callers
Function
print
(*args, **kwargs)
minigpt4/common/dist_utils.py:25
↓ 97 callers
Method
get
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 callers
Method
from_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 callers
Method
generate
(self, prompt)
minigpt_utils/generator.py:39
↓ 24 callers
Method
from_config
(cls, cfg)
minigpt4/models/mini_gpt4.py:232
↓ 21 callers
Method
parse_args
()
image_attr/image_attr_minigpt.py:77
↓ 14 callers
Method
__init__
(self, config, layer_num)
minigpt4/models/Qformer.py:379
↓ 14 callers
Method
get_model_class
(cls, name)
minigpt4/common/registry.py:236
↓ 13 callers
Method
get_processor_class
(cls, name)
minigpt4/common/registry.py:244
↓ 12 callers
Method
visualize_attr
(self, attr_index: Optional[NDArray] = None, flip=False)
image_attr/context_partitioner.py:123
↓ 11 callers
Method
get_image
(self, mask: Optional[NDArray] = None)
image_attr/context_partitioner.py:116
↓ 10 callers
Method
max
(self)
minigpt4/common/logger.py:65
↓ 9 callers
Method
update
(self, **kwargs)
minigpt4/common/logger.py:87
↓ 7 callers
Function
is_dist_avail_and_initialized
()
minigpt4/common/dist_utils.py:33
↓ 7 callers
Method
transpose_for_scores
(self, x)
minigpt4/models/Qformer.py:161
↓ 7 callers
Method
update_context_embs
(self)
minigpt_utils/prompt_wrapper.py:78
↓ 6 callers
Method
__init__
( self, hidden_size: int, intermediate_size: int, hidden_act: str, )
minigpt4/models/modeling_llama.py:127
↓ 6 callers
Method
__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
minigpt4/models/eva_vit.py:45
↓ 6 callers
Function
char_to_token
(output_tokens, char_index)
image_attr/utils.py:476
↓ 6 callers
Method
get_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 callers
Method
init_image_query
( self, image: Image, query: str, source_type: str = "patch", generate
image_attr/image_attr_qwen.py:75
↓ 6 callers
Method
set_p
(self, p)
image_attr/context_partitioner.py:76
↓ 6 callers
Method
specify_output
(self, jb_output)
image_attr/image_attr_qwen.py:140
↓ 5 callers
Function
_compute_logit_probs
(logits, labels)
image_attr/utils.py:122
↓ 5 callers
Method
backward
(ctx, *grads)
minigpt4/models/base_model.py:197
↓ 5 callers
Method
register_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 callers
Function
_build_proc_from_cfg
(cfg)
minigpt4/models/__init__.py:77
↓ 4 callers
Method
_build_proc_from_cfg
(cfg)
minigpt4/datasets/builders/base_dataset_builder.py:80
↓ 4 callers
Function
_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 callers
Method
build_processors
(self)
minigpt4/datasets/builders/base_dataset_builder.py:61
↓ 4 callers
Method
default_config_path
(cls, model_type)
minigpt4/models/base_model.py:75
↓ 4 callers
Function
download_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 callers
Function
enhance_level_to_args
(MAX_LEVEL)
minigpt4/processors/randaugment.py:223
↓ 4 callers
Method
fit
( self, masks: NDArray, outputs: NDArray, num_output_tokens: int )
image_attr/solver.py:20
↓ 4 callers
Method
get_path
(cls, name)
minigpt4/common/registry.py:280
↓ 4 callers
Function
get_rank
()
minigpt4/common/dist_utils.py:47
↓ 4 callers
Function
is_main_process
()
minigpt4/common/dist_utils.py:53
↓ 4 callers
Method
log_every
(self, iterable, print_freq, header=None)
minigpt4/common/logger.py:122
↓ 4 callers
Function
normalize
(images)
minigpt_utils/visual_attacker.py:13
↓ 3 callers
Method
_convert_node_to_json
(self, node)
minigpt4/common/config.py:161
↓ 3 callers
Method
_get_query_ids
( self, return_prompt: bool = False, )
image_attr/image_attr_minigpt.py:136
↓ 3 callers
Method
_get_query_ids
( self, return_prompt: bool = False, )
image_attr/image_attr_llava.py:94
↓ 3 callers
Method
_get_query_ids
( self, return_prompt: bool = False, )
image_attr/image_attr_qwen.py:97
↓ 3 callers
Function
aggregate_logit_probs
Compute sequence-level outputs from token-level logit-probabilities.
image_attr/utils.py:388
↓ 3 callers
Method
append_message
(self, role, message)
minigpt4/conversation/conversation.py:75
↓ 3 callers
Function
concat_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 callers
Function
denormalize
(images)
minigpt_utils/visual_attacker.py:20
↓ 3 callers
Method
encode_img
(self, image)
minigpt4/models/mini_gpt4.py:129
↓ 3 callers
Method
get_builder_class
(cls, name)
minigpt4/common/registry.py:232
↓ 3 callers
Method
get_source
Get a represention of the source corresponding to a given index.
image_attr/context_partitioner.py:43
↓ 3 callers
Function
get_vlm_attributions_df
( attributions: NDArray[Any], context_partitioner, top_k: Optional[int] = None, )
image_attr/utils.py:449
↓ 3 callers
Function
is_url
(url_or_filename)
minigpt4/common/utils.py:41
↓ 3 callers
Function
load_dataset_config
(cfg_path)
minigpt4/datasets/builders/base_dataset_builder.py:232
↓ 3 callers
Function
makedir
Create the directory if it does not exist.
minigpt4/common/utils.py:64
↓ 3 callers
Method
prompt_wrap
(self, img_embeds, atts_img, prompt)
minigpt4/models/mini_gpt4.py:151
↓ 3 callers
Method
register
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 callers
Method
step
(self, cur_epoch, cur_step)
minigpt4/common/optims.py:37
↓ 3 callers
Method
unwrap_dist_model
(self, model)
minigpt4/runners/runner_base.py:485
↓ 3 callers
Method
value
(self)
minigpt4/common/logger.py:69
↓ 3 callers
Method
wrap_prompt_simple
(self, text_prompt_template, adv_prompt, batch_size)
minigpt_utils/text_attacker.py:91
↓ 2 callers
Method
__init__
(self, context: str)
image_attr/context_partitioner.py:30
↓ 2 callers
Method
__init__
(self, prompt="", max_words=50)
minigpt4/processors/blip_processors.py:30
↓ 2 callers
Method
_compute_vlm_masks_and_logit_probs
(self)
image_attr/image_attr_minigpt.py:227
↓ 2 callers
Method
_compute_vlm_masks_and_logit_probs
(self)
image_attr/image_attr_llava.py:189
↓ 2 callers
Method
_compute_vlm_masks_and_logit_probs
(self)
image_attr/image_attr_qwen.py:203
↓ 2 callers
Function
_create_mask
(num_sources, alpha, seed)
image_attr/utils.py:65
↓ 2 callers
Method
_save_checkpoint
Save the checkpoint at the current epoch.
minigpt4/runners/runner_base.py:575
↓ 2 callers
Method
_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 callers
Function
_urlretrieve
(url: str, filename: str, chunk_size: int = 1024)
minigpt4/common/utils.py:154
↓ 2 callers
Method
add_meter
(self, name, meter)
minigpt4/common/logger.py:119
↓ 2 callers
Method
attack_loss
(self, prompts, targets)
minigpt_utils/visual_attacker.py:184
↓ 2 callers
Method
attack_loss
(self, prompts, targets)
minigpt_utils/text_attacker.py:212
↓ 2 callers
Method
device
(self)
minigpt4/models/base_model.py:26
↓ 2 callers
Function
download_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 callers
Method
eval_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 callers
Method
format_arguments
(self)
minigpt4/common/config.py:248
↓ 2 callers
Method
format_help
(self)
minigpt4/common/config.py:251
↓ 2 callers
Method
from_config
(cls, cfg=None)
minigpt4/processors/base_processor.py:20
↓ 2 callers
Method
generate_img_embedding
(self, img_prompts)
minigpt_utils/prompt_wrapper.py:118
↓ 2 callers
Method
generate_text_embedding
(self, text_prompts)
minigpt_utils/prompt_wrapper.py:97
↓ 2 callers
Method
get_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 callers
Function
get_world_size
()
minigpt4/common/dist_utils.py:41
↓ 2 callers
Function
is_none
(value)
utility_eval/minigpt_mmbench.py:64
↓ 2 callers
Function
is_none
(value)
utility_eval/llava_mmbench.py:48
↓ 2 callers
Function
is_none
(value)
utility_eval/qwen_mmbench.py:51
↓ 2 callers
Method
load_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 callers
Method
load_from_pretrained
(self, url_or_filename)
minigpt4/models/blip2.py:72
↓ 2 callers
Method
log_stats
(self, stats, split_name)
minigpt4/runners/runner_base.py:647
↓ 2 callers
Method
maybe_autocast
(self, dtype=torch.float16)
minigpt4/models/blip2.py:35
↓ 2 callers
Function
move_to_cuda
(sample)
minigpt4/datasets/data_utils.py:83
↓ 2 callers
Method
next
(self, it)
minigpt4/datasets/datasets/dataloader_utils.py:101
↓ 2 callers
Function
parse_args
()
utility_eval/qwen_mmvet.py:19
↓ 2 callers
Method
patchify
(self)
image_attr/context_partitioner.py:80
↓ 2 callers
Method
plot_loss
(self)
minigpt_utils/visual_attacker.py:162
↓ 2 callers
Method
preload
(self, it)
minigpt4/datasets/datasets/dataloader_utils.py:76
↓ 2 callers
Function
prepare_sample
(samples, cuda_enabled=True)
minigpt4/datasets/data_utils.py:90
↓ 2 callers
Function
rotate_half
Rotates half the hidden dims of the input.
minigpt4/models/modeling_llama.py:109
↓ 2 callers
Function
shear_level_to_args
(MAX_LEVEL, replace_value)
minigpt4/processors/randaugment.py:230
↓ 2 callers
Method
split_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