Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Alpha-VLLM/LLaMA2-Accessory
/ functions
Functions
1,094 in github.com/Alpha-VLLM/LLaMA2-Accessory
⨍
Functions
1,094
◇
Types & classes
182
↓ 363 callers
Function
print
(*args, **kwargs)
accessory/util/misc.py:52
↓ 61 callers
Method
info
Print information about the VQA annotation file. :return:
accessory/eval_mm/utils/vqa.py:73
↓ 38 callers
Method
encode
(self, s: str, bos: bool, eos: bool)
accessory/model/tokenizer.py:52
↓ 36 callers
Method
from_pretrained
Besides loading the `consolidated.*.pth` model weights, this function also tries to find tokenizer, 'meta.json', and 'config.json' un
accessory/model/meta.py:81
↓ 36 callers
Function
repeat_kv
torch.repeat_interleave(x, dim=2, repeats=n_rep)
accessory/model/LLM/llama.py:80
↓ 23 callers
Function
_extract_into_tensor
Extract values from a 1-D numpy array for a batch of indices. :param arr: the 1-D numpy array. :param timesteps: a tensor of indices into
Large-DiT-ImageNet/diffusion/gaussian_diffusion.py:862
↓ 23 callers
Function
_extract_into_tensor
Extract values from a 1-D numpy array for a batch of indices. :param arr: the 1-D numpy array. :param timesteps: a tensor of indices into
Large-DiT-T2I/diffusion/gaussian_diffusion.py:889
↓ 21 callers
Method
generate
Generate text responses based on input prompts, optionally using images and controlling generation parameters. :param prompts: A bat
accessory/model/meta.py:372
↓ 19 callers
Function
precompute_freqs_cis
(dim: int, end: int, theta: float = 10000.0, scaling=None)
accessory/model/LLM/llama.py:46
↓ 17 callers
Function
apply_rotary_emb
( xq: torch.Tensor, xk: torch.Tensor, freqs_cis: torch.Tensor, )
accessory/model/LLM/llama.py:67
↓ 17 callers
Function
quantize
( model : MetaModel, quant_conf : BitsAndBytesConfig, )
accessory/util/quant.py:95
↓ 16 callers
Method
save
(self, save_dir: str)
accessory/model/tokenizer.py:117
↓ 16 callers
Method
update
(self, **kwargs)
accessory/util/misc.py:216
↓ 14 callers
Function
load_tensor_parallel_model_list
r"""This method accepts a list of checkpoint paths, and load each checkpoint to the model in the order as given in the list. The behaviors of
accessory/util/tensor_parallel.py:425
↓ 13 callers
Method
copy
(self)
accessory/data/conversation/lib.py:69
↓ 12 callers
Method
load_state_dict
(self, state_dict: dict)
accessory/data/falcon.py:48
↓ 11 callers
Method
state_dict
(self)
accessory/util/misc.py:316
↓ 8 callers
Method
decode
(self, t: List[int])
accessory/model/tokenizer.py:114
↓ 8 callers
Function
get_local_world_size
()
Large-DiT-T2I/parallel.py:36
↓ 8 callers
Method
get_prompt
(self)
accessory/data/conversation/lib.py:63
↓ 8 callers
Function
get_transform
(transform_type: str, size=224)
accessory/data/transform.py:68
↓ 7 callers
Method
append_message
(self, role, message)
accessory/data/conversation/lib.py:66
↓ 7 callers
Method
load_state_dict
(self, state_dict)
accessory/util/misc.py:319
↓ 7 callers
Function
save_result
(args, info, prompt, global_config, ds_collections, result_path='', dataset='')
accessory/eval_mm/utils/utils.py:4
↓ 6 callers
Method
__init__
Initialize the Attention module. Args: dim (int): Number of input dimensions. n_heads (int): Number of heads
Large-DiT-ImageNet/models.py:135
↓ 6 callers
Method
__init__
Initialize the Attention module. Args: dim (int): Number of input dimensions. n_heads (int): Number of heads
Large-DiT-T2I/models/model.py:136
↓ 6 callers
Method
_emit_request
(self, request_name:str, *args, **kwargs)
accessory/model/multi_gpu_wrapper.py:294
↓ 6 callers
Function
_save_world
()
accessory/model/multi_gpu_wrapper.py:128
↓ 6 callers
Function
format_prompt
(format_dict: Dict, sys_name="alpaca")
accessory/data/system_prompt.py:3
↓ 6 callers
Function
mean_flat
Take the mean over all non-batch dimensions.
Large-DiT-ImageNet/diffusion/gaussian_diffusion.py:16
↓ 6 callers
Function
mean_flat
Take the mean over all non-batch dimensions.
Large-DiT-T2I/diffusion/gaussian_diffusion.py:16
↓ 6 callers
Function
param_fqn
(param_name)
Large-DiT-ImageNet/grad_norm.py:14
↓ 6 callers
Function
param_fqn
(param_name)
Large-DiT-T2I/grad_norm.py:14
↓ 5 callers
Function
_load_world
(load_dict, load_world)
accessory/model/multi_gpu_wrapper.py:138
↓ 5 callers
Function
ask_question
(prompt, options, default_value=None)
accessory/tools/download.py:34
↓ 5 callers
Function
get_fqn
(module_name: str, param_name: str)
accessory/util/param_group.py:159
↓ 5 callers
Method
load_qas
convert the list of question-answer pairs to a string, which contains the conversation involving all the questions and answers. Whe
accessory/data/conversation/lib.py:78
↓ 5 callers
Function
setup_for_distributed
This function disables printing when not in master process
accessory/util/misc.py:46
↓ 4 callers
Method
__init__
( self, dim: int, hidden_dim: int, num_experts: int, num_experts_per_t
accessory/model/LLM/mixtral_peft.py:233
↓ 4 callers
Method
__init__
( self, dim: int, hidden_dim: int, num_experts: int, num_experts_per_t
accessory/model/LLM/mixtral.py:223
↓ 4 callers
Method
_wrap_model
(self, model)
Large-DiT-ImageNet/diffusion/respace.py:105
↓ 4 callers
Method
_wrap_model
(self, model)
Large-DiT-T2I/diffusion/respace.py:105
↓ 4 callers
Method
call_model_func
(self, request_name:str, *args, **kwargs)
accessory/model/multi_gpu_wrapper.py:260
↓ 4 callers
Method
encode_image
(self, image)
accessory/model/LLM/llama.py:364
↓ 4 callers
Function
floatify
(num: str)
accessory/eval_mm/utils/math_utils.py:468
↓ 4 callers
Method
p_mean_variance
Apply the model to get p(x_{t-1} | x_t), as well as a prediction of the initial x, x_0. :param model: the model, which takes
Large-DiT-ImageNet/diffusion/gaussian_diffusion.py:254
↓ 4 callers
Method
p_mean_variance
Apply the model to get p(x_{t-1} | x_t), as well as a prediction of the initial x, x_0. :param model: the model, which takes
Large-DiT-T2I/diffusion/gaussian_diffusion.py:254
↓ 4 callers
Function
put_response
(response)
accessory/model/multi_gpu_wrapper.py:51
↓ 4 callers
Method
q_posterior_mean_variance
Compute the mean and variance of the diffusion posterior: q(x_{t-1} | x_t, x_0)
Large-DiT-ImageNet/diffusion/gaussian_diffusion.py:232
↓ 4 callers
Method
stream_generate
Generate text in a streaming manner for a single prompt, optionally using an image. :param prompt: The input text prompt for generat
accessory/model/meta.py:470
↓ 3 callers
Method
__init__
(self, args: ModelArgs)
accessory/model/LLM/llama_ens10.py:54
↓ 3 callers
Method
__init__
(self, args: ModelArgs)
accessory/model/LLM/falcon.py:208
↓ 3 callers
Method
__init__
(self, args: ModelArgs)
accessory/model/LLM/llama_ens5.py:54
↓ 3 callers
Method
__init__
(self, args: ModelArgs)
accessory/model/LLM/llama.py:93
↓ 3 callers
Method
__init__
(self, args: ModelArgs)
accessory/model/LLM/llama_qformerv2_peft.py:53
↓ 3 callers
Method
__init__
( self, dim: int, hidden_dim: int, num_experts: int, num_experts_per_t
accessory/model/LLM/mixtral_sparse_ens5.py:230
↓ 3 callers
Method
__init__
(self, args: ModelArgs)
accessory/model/LLM/llama_ens5p2.py:54
↓ 3 callers
Method
__init__
( self, dim: int, hidden_dim: int, num_experts: int, num_experts_per_t
accessory/model/LLM/mixtral_sparse.py:224
↓ 3 callers
Method
__init__
(self, args: ModelArgs)
accessory/model/LLM/llama_ens.py:54
↓ 3 callers
Method
__init__
(self, args: ModelArgs)
accessory/model/LLM/llama_qformerv2.py:48
↓ 3 callers
Method
__init__
(self, args: ModelArgs)
accessory/model/LLM/llama_peft.py:54
↓ 3 callers
Method
__init__
(self, args: ModelArgs)
accessory/model/LLM/llama_ens_light.py:55
↓ 3 callers
Method
__init__
(self, args: ModelArgs)
accessory/model/LLM/llama_adapter.py:66
↓ 3 callers
Method
__init__
(self, args: ModelArgs)
accessory/model/LLM/llama_ens_peft.py:60
↓ 3 callers
Method
__init__
( self, dim: int, hidden_dim: int, num_experts: int, num_experts_per_t
accessory/model/LLM/mixtral_sparse_ens.py:228
↓ 3 callers
Method
__init__
(self, args: ModelArgs, layer_idx: int = None)
accessory/model/LLM/internlm.py:67
↓ 3 callers
Method
__init__
(self, args: ModelArgs)
accessory/model/LLM/llama_ens5_light.py:55
↓ 3 callers
Method
_load_new_file
(self, pre_load=True)
accessory/data/falcon.py:124
↓ 3 callers
Method
_load_new_file
(self, pre_load=True)
accessory/data/falcon_packed.py:126
↓ 3 callers
Method
_predict_eps_from_xstart
(self, x_t, t, pred_xstart)
Large-DiT-ImageNet/diffusion/gaussian_diffusion.py:341
↓ 3 callers
Method
_predict_eps_from_xstart
(self, x_t, t, pred_xstart)
Large-DiT-T2I/diffusion/gaussian_diffusion.py:341
↓ 3 callers
Function
_strip_string
(string)
accessory/eval_mm/utils/math_utils.py:204
↓ 3 callers
Method
_vb_terms_bpd
Get a term for the variational lower-bound. The resulting units are bits (rather than nats, as one might expect). This allows
Large-DiT-ImageNet/diffusion/gaussian_diffusion.py:683
↓ 3 callers
Method
_vb_terms_bpd
Get a term for the variational lower-bound. The resulting units are bits (rather than nats, as one might expect). This allows
Large-DiT-T2I/diffusion/gaussian_diffusion.py:683
↓ 3 callers
Function
colored
(text, color)
accessory/tools/download.py:6
↓ 3 callers
Function
get_request
()
accessory/model/multi_gpu_wrapper.py:54
↓ 3 callers
Method
groups
(self)
accessory/data/alpaca.py:206
↓ 3 callers
Function
is_dist_avail_and_initialized
()
accessory/util/misc.py:64
↓ 3 callers
Function
load_tensor_parallel_shard_state_dict
r"""Load one tensor parallel state dict shard from the disk and post process according to format. Args: path (str): Path to the folde
accessory/util/tensor_parallel.py:200
↓ 3 callers
Method
log_every
(self, iterable, print_freq, header=None, start_iter=0)
accessory/util/misc.py:248
↓ 3 callers
Method
max
(self)
accessory/util/misc.py:195
↓ 3 callers
Function
modulate
(x, shift, scale)
Large-DiT-ImageNet/models.py:28
↓ 3 callers
Function
modulate
(x, shift, scale)
Large-DiT-T2I/models/model.py:28
↓ 3 callers
Function
promote_trainable_params_to_fp32
(model: nn.Module)
accessory/util/tensor_type.py:60
↓ 3 callers
Method
q_posterior_mean_variance
Compute the mean and variance of the diffusion posterior: q(x_{t-1} | x_t, x_0)
Large-DiT-T2I/diffusion/gaussian_diffusion.py:232
↓ 3 callers
Method
q_sample
Diffuse the data for a given number of diffusion steps. In other words, sample from q(x_t | x_0). :param x_start: the initial
Large-DiT-T2I/diffusion/gaussian_diffusion.py:215
↓ 3 callers
Function
reshape_for_broadcast
(freqs_cis: torch.Tensor, x: torch.Tensor)
accessory/model/LLM/llama.py:59
↓ 3 callers
Method
sample
Importance-sample timesteps for a batch. :param batch_size: the number of timesteps. :param device: the torch device to save
Large-DiT-T2I/diffusion/timestep_sampler.py:44
↓ 3 callers
Function
show_score
(args)
light-eval/src/eval_llavabenchmark.py:282
↓ 3 callers
Method
synchronize_between_processes
(self)
accessory/util/misc.py:241
↓ 2 callers
Method
__init__
( self, in_features: int, out_features: int, bias: bool = True, lora_r
accessory/model/peft.py:24
↓ 2 callers
Method
_collect_annotations
(self)
Large-DiT-T2I/data/dataset.py:67
↓ 2 callers
Method
_dcg
(self, rankings: torch.Tensor, relevance: torch.Tensor)
accessory/eval_mm/utils/metric.py:160
↓ 2 callers
Function
_get_grad_norm
Returns the gradient norm of parameters ``param`` s, where the gradients are viewed as a single vector. The returned norm is in FP32 even if
accessory/util/clip_grad.py:23
↓ 2 callers
Method
_get_response
(self)
accessory/model/multi_gpu_wrapper.py:303
↓ 2 callers
Method
_predict_xstart_from_eps
(self, x_t, t, eps)
Large-DiT-ImageNet/diffusion/gaussian_diffusion.py:334
↓ 2 callers
Method
_predict_xstart_from_eps
(self, x_t, t, eps)
Large-DiT-T2I/diffusion/gaussian_diffusion.py:334
↓ 2 callers
Function
_to_float
(text: str)
accessory/eval_mm/utils/metric.py:206
↓ 2 callers
Function
_warmup_beta
(beta_start, beta_end, num_diffusion_timesteps, warmup_frac)
Large-DiT-ImageNet/diffusion/gaussian_diffusion.py:58
↓ 2 callers
Function
_warmup_beta
(beta_start, beta_end, num_diffusion_timesteps, warmup_frac)
Large-DiT-T2I/diffusion/gaussian_diffusion.py:58
next →
1–100 of 1,094, ranked by callers