SYMBOL INDEX (39 symbols across 5 files) FILE: attack/attack_model.py class AttackModel (line 27) | class AttackModel: method __init__ (line 28) | def __init__(self, target_model, tokenizer, datasets, reference_model,... method llm_eval (line 44) | def llm_eval(self, model, data_loader, cfg, idx_rate, perturb_fn=None,... method eval_perturb (line 74) | def eval_perturb(self, model, dataset, cfg): method data_prepare (line 121) | def data_prepare(self, kind, cfg): method feat_prepare (line 169) | def feat_prepare(self, info_dict, cfg): method conduct_attack (line 193) | def conduct_attack(self, cfg): method tokenize_and_mask (line 204) | def tokenize_and_mask(self, text, span_length, pct, idx_rate, ceil_pct... method count_masks (line 236) | def count_masks(texts): method replace_masks (line 239) | def replace_masks(self, texts): method extract_fills (line 248) | def extract_fills(self, texts): method apply_extracted_fills (line 260) | def apply_extracted_fills(self, masked_texts, extracted_fills): method sentence_perturbation (line 278) | def sentence_perturbation(self, texts, idx_rate): method eval_attack (line 300) | def eval_attack(y_true, y_scores, plot=True, path=None): FILE: attack/utils.py function get_logger (line 9) | def get_logger(name: str, level: Literal["info", "warning", "debug"]) ->... class Dict (line 22) | class Dict(dict): method __getattr__ (line 23) | def __getattr__(self, name): method __setattr__ (line 27) | def __setattr__(self, name, value): method __setitem__ (line 31) | def __setitem__(self, key, value): function check_files_exist (line 35) | def check_files_exist(*file_paths): function create_folder (line 51) | def create_folder(folder_path): function save_dict_to_npz (line 59) | def save_dict_to_npz(my_dict, file_path): function load_dict_from_npz (line 77) | def load_dict_from_npz(file_path): function ndarray_to_tensor (line 92) | def ndarray_to_tensor(*ndarrays): function tensor_to_ndarray (line 106) | def tensor_to_ndarray(*tensors): function convert_labels_to_one_hot (line 120) | def convert_labels_to_one_hot(labels, num_classes): function get_file_names (line 136) | def get_file_names(folder_path): function extract (line 149) | def extract(v, t, x_shape): FILE: data/prepare.py function packing_texts (line 12) | def packing_texts(examples): function dataset_prepare (line 52) | def dataset_prepare(args, tokenizer=None, num_of_sequences=1024, chars_p... FILE: ft_llms/llama_patch.py function compute_flash_attention (line 21) | def compute_flash_attention(flash_attn, q, k, v, attention_mask=None, he... function llama_forward_with_flash_attn (line 64) | def llama_forward_with_flash_attn( function _prepare_decoder_attention_mask (line 185) | def _prepare_decoder_attention_mask(self, attention_mask, input_shape, i... function replace_attn_with_flash_attn (line 190) | def replace_attn_with_flash_attn(): function unplace_flash_attn_with_attn (line 205) | def unplace_flash_attn_with_attn(): function upcast_layer_for_flash_attention (line 214) | def upcast_layer_for_flash_attention(model, torch_dtype): FILE: ft_llms/utils.py function get_logger (line 10) | def get_logger(name: str, level: Literal["info", "warning", "debug"]) ->... function print_trainable_parameters (line 23) | def print_trainable_parameters(model): function constantlengthdatasetiter (line 37) | def constantlengthdatasetiter(self):