Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ZinYY/TreeLoRA
/ functions
Functions
425 in github.com/ZinYY/TreeLoRA
⨍
Functions
425
◇
Types & classes
69
↓ 1 callers
Function
_prepare_prompt_learning_config
(peft_config, model_config)
utils/my_peft/mapping.py:62
↓ 1 callers
Function
_set_adapter
(model, adapter_name)
utils/my_peft/utils/other.py:139
↓ 1 callers
Method
_set_budget_scheduler
(self, model)
utils/my_peft/tuners/adalora.py:545
↓ 1 callers
Method
_setup_prompt_encoder
(self, adapter_name)
utils/my_peft/peft_model.py:184
↓ 1 callers
Method
_update_fisher
(self)
model/Regular/EWC.py:38
↓ 1 callers
Method
_update_previous_params
(self)
model/Regular/EWC.py:49
↓ 1 callers
Function
_z3_params_to_fetch
(param_list)
utils/module/lora.py:107
↓ 1 callers
Method
add_adapter
(self, adapter_name, config=None)
utils/my_peft/tuners/adalora.py:100
↓ 1 callers
Method
add_adapter
(self, adapter_name, config=None)
utils/my_peft/tuners/lora.py:158
↓ 1 callers
Method
add_adapter
Add an adapter with the given name and config.
utils/my_peft/tuners/adaption_prompt.py:169
↓ 1 callers
Function
add_task_prompt
Add task prompt and end prompt to each item in the data
assist_scripts/extract_down_sample_datasets.py:88
↓ 1 callers
Function
bleu_score
(reference, hypothesis, gram)
metrics.py:20
↓ 1 callers
Method
budget_schedule
(self, step: int)
utils/my_peft/tuners/adalora.py:556
↓ 1 callers
Method
build_node
(self, grads_tensor)
utils/kd_lora_tree.py:27
↓ 1 callers
Function
caculate_f1
(results, data)
metrics.py:131
↓ 1 callers
Function
caculate_fuzz
(results, data)
metrics.py:147
↓ 1 callers
Function
caculate_sari
(inputs, results, data)
metrics.py:162
↓ 1 callers
Method
calculate_importance_scores
Calculate and return importance scores
utils/TaSL/importance_scorer.py:92
↓ 1 callers
Function
consolidate_parameters
Consolidate parameters from current and previous tasks based on importance scores Args: current_weights: Dictionary of current task
utils/TaSL/consolidation.py:58
↓ 1 callers
Function
create_dataset
(local_rank, dataset_name, output_path, seed, add_sys_prefix=False, for_backbone=False, sam
utils/data/data_utils.py:265
↓ 1 callers
Method
decoder_call
(self, batch, return_tensors)
utils/data/data_collator.py:62
↓ 1 callers
Method
decoder_call
(self, batch, return_tensors)
inference/HHH/HHH_data_collator.py:55
↓ 1 callers
Method
disable_adapter_layers
(self)
utils/my_peft/tuners/lora.py:316
↓ 1 callers
Method
enable_adapter_layers
(self)
utils/my_peft/tuners/lora.py:313
↓ 1 callers
Method
end_task
(self, task_id)
utils/kd_lora_tree.py:126
↓ 1 callers
Method
evaluate
(self, round)
model/Replay/MbPAplusplus.py:240
↓ 1 callers
Method
evaluate_one_task
(self, round, infer_task_id, task)
model/Dynamic_network/DualPrompt.py:127
↓ 1 callers
Function
f1_score
(list1, list2)
metrics.py:113
↓ 1 callers
Method
from_json_file
r""" Loads a configuration file from a json file. Args: path_json_file (`str`): The path to the json file
utils/my_peft/utils/config.py:121
↓ 1 callers
Method
from_pretrained
r""" This method loads the configuration of your adapter model from a directory. Args: pretrained_model_name_or_path (`st
utils/my_peft/utils/config.py:87
↓ 1 callers
Method
fuse_lora_weight
(self)
utils/module/lora.py:66
↓ 1 callers
Method
generate_pseudo_data
(self, dataloader, task_name)
model/Replay/LFPT5.py:93
↓ 1 callers
Function
getInitialPrompt
(tokenizer, prompt_token_number)
model/Replay/LFPT5.py:15
↓ 1 callers
Method
get_answer
(self, sample)
utils/data/raw_datasets.py:34
↓ 1 callers
Function
get_cmd
(args, step_num)
train.py:151
↓ 1 callers
Method
get_dataloader
(self, task, pseudo_prompts, pseudo_answers)
model/Replay/LFPT5.py:60
↓ 1 callers
Method
get_eval_data
(self)
utils/data/raw_datasets.py:26
↓ 1 callers
Function
get_generator
(path)
inference/chatbot.py:32
↓ 1 callers
Method
get_keys
(self,batch)
model/Replay/MbPAplusplus.py:126
↓ 1 callers
Method
get_lora_param_names
Identify all LoRA parameters in the model
utils/TaSL/importance_scorer.py:54
↓ 1 callers
Method
get_loss
(self, _grad_current, loss, task_id, prev_id_matrix)
utils/kd_lora_tree.py:264
↓ 1 callers
Function
get_model_response
(generator, user_input, max_new_tokens)
inference/chatbot.py:68
↓ 1 callers
Method
get_neighbours
Returns samples from buffer using nearest neighbour approach
model/Replay/MbPAplusplus.py:75
↓ 1 callers
Function
get_optimizer
(model)
training/replay.py:335
↓ 1 callers
Function
get_optimizer
(model)
training/main.py:517
↓ 1 callers
Function
get_peft_model_state_dict
Get the state dict of the Peft model. Args: model ([`PeftModel`]): The Peft model. When using torch.nn.DistributedDataParallel, Deep
utils/my_peft/utils/save_and_load.py:22
↓ 1 callers
Method
get_prompt
(self, sample)
utils/data/raw_datasets.py:30
↓ 1 callers
Method
get_prompt_embedding_to_save
Returns the prompt embedding to save when saving the model. Only applicable when `peft_config.peft_type != PeftType.LORA`.
utils/my_peft/peft_model.py:219
↓ 1 callers
Function
get_random_demonstrations
(dem_num, infer_dataset, length_limit, task)
inference/ICL.py:324
↓ 1 callers
Function
get_random_demonstrations
(dem_num, infer_dataset, length_limit, task, tokenizer)
inference/infer_part.py:173
↓ 1 callers
Function
get_raw_dataset
(dataset_name, output_path, seed, local_rank, for_backbone=False)
utils/data/data_utils.py:213
↓ 1 callers
Function
get_task_name
Extract task name from file path
assist_scripts/extract_down_sample_datasets.py:79
↓ 1 callers
Method
get_test_data
(self)
utils/data/raw_datasets.py:108
↓ 1 callers
Method
get_train_data
(self)
utils/data/raw_datasets.py:23
↓ 1 callers
Function
get_user_input
(user_input)
inference/chatbot.py:61
↓ 1 callers
Method
init_fisher
(self)
model/Regular/EWC.py:32
↓ 1 callers
Method
insert_grad
(self, _grad_current)
utils/kd_lora_tree.py:173
↓ 1 callers
Function
is_adaption_prompt_trainable
Return True if module is trainable under adaption prompt fine-tuning.
utils/my_peft/tuners/adaption_prompt.py:99
↓ 1 callers
Function
is_serializable
(obj)
training/main.py:608
↓ 1 callers
Function
launch_cmd
(args, step_num, cmd)
train.py:168
↓ 1 callers
Function
llama_apply_rotary_pos_emb
Apply rotary position embedding to query states in the Llama model. This function was adapted from: https://github.com/huggingface/trans
utils/my_peft/tuners/adaption_prompt.py:44
↓ 1 callers
Function
llama_rotate_half
Rotate half the hidden dims of the input. This function was duplicated verbatim from: https://github.com/huggingface/transformers/blob/1
utils/my_peft/tuners/adaption_prompt.py:29
↓ 1 callers
Method
load_adapter
(self, model_id, adapter_name, is_trainable=False, **kwargs)
utils/my_peft/peft_model.py:344
↓ 1 callers
Function
load_json
(file_path)
assist_scripts/extract_down_sample_datasets.py:61
↓ 1 callers
Function
main
(args)
train.py:186
↓ 1 callers
Function
main
()
inference/ICL.py:209
↓ 1 callers
Function
main
(args)
inference/chatbot.py:85
↓ 1 callers
Function
main
()
inference/infer_single.py:146
↓ 1 callers
Function
main
()
inference/infer_multi_command.py:146
↓ 1 callers
Function
main
()
inference/infer_part.py:207
↓ 1 callers
Function
main
()
training/replay.py:202
↓ 1 callers
Function
main
()
training/main.py:246
↓ 1 callers
Method
mask_to_budget
(self, model, budget)
utils/my_peft/tuners/adalora.py:600
↓ 1 callers
Method
mask_using_rank_pattern
(self, model, rank_pattern)
utils/my_peft/tuners/adalora.py:664
↓ 1 callers
Method
new_epoch_init
(self, train_dataloader_len)
utils/kd_lora_tree.py:117
↓ 1 callers
Method
new_input_old_model_logits
(self, i_task)
model/Regular/LwF.py:38
↓ 1 callers
Function
orthonormalize
(vectors, normalize=True, start_idx=0)
model/Regular/OGD.py:16
↓ 1 callers
Function
parse_args
()
train.py:45
↓ 1 callers
Function
parse_args
()
inference/ICL.py:127
↓ 1 callers
Function
parse_args
()
inference/chatbot.py:17
↓ 1 callers
Function
parse_args
()
inference/infer_single.py:53
↓ 1 callers
Function
parse_args
()
inference/infer_multi_command.py:32
↓ 1 callers
Function
parse_args
()
inference/infer_part.py:69
↓ 1 callers
Function
parse_args
()
training/replay.py:57
↓ 1 callers
Function
parse_args
()
training/main.py:64
↓ 1 callers
Function
parse_results_dir
(dir_path, inference_tasks)
inference/collect_results.py:49
↓ 1 callers
Method
penalty
(self)
model/Regular/EWC.py:54
↓ 1 callers
Function
prediction
(model, infer_dataloader)
inference/infer_single.py:152
↓ 1 callers
Function
prediction
(model, infer_dataloader)
inference/infer_part.py:213
↓ 1 callers
Function
prepare_config
Prepare the config based on the llama model type.
utils/my_peft/tuners/adaption_prompt.py:118
↓ 1 callers
Function
process_dataset
(root_dir)
assist_scripts/extract_down_sample_datasets.py:110
↓ 1 callers
Function
process_directory
(directory_path)
assist_scripts/format_json.py:53
↓ 1 callers
Function
process_response
(response, num_rounds)
inference/chatbot.py:73
↓ 1 callers
Method
project2cone2
Solves the GEM dual QP described in the paper given a proposed gradient "gradient", and a memory of task gradients "memories"
model/Regular/GEM.py:43
↓ 1 callers
Method
project_vec
(self,gradient)
model/Regular/OGD.py:56
↓ 1 callers
Method
push
Add the examples as key-value pairs to the memory dictionary with content,attention_mask,label tuple as value and key determined by k
model/Replay/MbPAplusplus.py:42
↓ 1 callers
Function
random_sample
Randomly sample n items from data. If data has fewer items than n, return all data
assist_scripts/extract_down_sample_datasets.py:72
↓ 1 callers
Function
replay
(i_task, epochs)
training/replay.py:404
↓ 1 callers
Method
replay_with_neighbors
(self, R_input_ids, R_attn_masks, R_labels, base_weights)
model/Replay/MbPAplusplus.py:203
↓ 1 callers
Method
reset_lora_parameters
(self, adapter_name)
utils/my_peft/tuners/adalora.py:358
← previous
next →
101–200 of 425, ranked by callers