SYMBOL INDEX (295 symbols across 63 files) FILE: examples/alora_finetuning/alora_finetuning.py function train_model (line 17) | def train_model( function model_inference (line 162) | def model_inference(model_path: str, adapter_path: str, prompt: str = No... FILE: examples/arrow_multitask/arrow_phi3_mini.py function parse_args (line 99) | def parse_args(): function read_test_dataset (line 120) | def read_test_dataset(ds_name): function extract_input_content (line 139) | def extract_input_content(ds_name, row): function create_multi_choice_options (line 152) | def create_multi_choice_options(row, ds_name): function extract_multi_choice_target_index (line 172) | def extract_multi_choice_target_index(row, ds_name): function set_seed (line 185) | def set_seed(seed: int): function compute_loglike_loss (line 195) | def compute_loglike_loss(logits, labels, reduction="none"): function evaluate_on_multi_choice_batched (line 220) | def evaluate_on_multi_choice_batched( FILE: examples/bdlora_finetuning/chat.py function chat (line 22) | def chat( FILE: examples/boft_controlnet/eval.py function count_txt_files (line 50) | def count_txt_files(directory): function plot_kpts (line 56) | def plot_kpts(image, kpts, color="g"): function generate_landmark2d (line 86) | def generate_landmark2d(dataset, input_dir, pred_lmk_dir, gt_lmk_dir, vi... function landmark_comparison (line 141) | def landmark_comparison(val_dataset, lmk_dir, gt_lmk_dir): function main (line 165) | def main(args): FILE: examples/boft_controlnet/test_controlnet.py function main (line 52) | def main(args): FILE: examples/boft_controlnet/train_controlnet.py function save_adaptor (line 68) | def save_adaptor(accelerator, output_dir, nets_dict): function main (line 87) | def main(args): FILE: examples/boft_controlnet/utils/args_loader.py function get_full_repo_name (line 9) | def get_full_repo_name(model_id: str, organization: Optional[str] = None... function import_model_class_from_model_name_or_path (line 19) | def import_model_class_from_model_name_or_path(pretrained_model_name_or_... function parse_args (line 41) | def parse_args(input_args=None): FILE: examples/boft_controlnet/utils/dataset.py function image_grid (line 13) | def image_grid(imgs, rows, cols): function log_validation (line 24) | def log_validation(val_dataset, text_encoder, unet, controlnet, args, ac... function make_dataset (line 82) | def make_dataset(args, tokenizer, accelerator, split="train"): function collate_fn (line 194) | def collate_fn(examples): FILE: examples/boft_controlnet/utils/light_controlnet.py class ControlNetOutput (line 36) | class ControlNetOutput(BaseOutput): class ControlNetConditioningEmbedding (line 41) | class ControlNetConditioningEmbedding(nn.Module): method __init__ (line 51) | def __init__( method forward (line 73) | def forward(self, conditioning): class ControlNetModel (line 86) | class ControlNetModel(ModelMixin, ConfigMixin): method __init__ (line 90) | def __init__( method attn_processors (line 107) | def attn_processors(self) -> dict[str, AttentionProcessor]: method set_attn_processor (line 131) | def set_attn_processor(self, processor: Union[AttentionProcessor, dict... method set_default_attn_processor (line 162) | def set_default_attn_processor(self): method set_attention_slice (line 169) | def set_attention_slice(self, slice_size): method _set_gradient_checkpointing (line 234) | def _set_gradient_checkpointing(self, module, value=False): method forward (line 238) | def forward( function zero_module (line 260) | def zero_module(module): FILE: examples/boft_controlnet/utils/pipeline_controlnet.py class LightControlNetPipelineOutput (line 33) | class LightControlNetPipelineOutput(BaseOutput): class LightControlNetPipeline (line 50) | class LightControlNetPipeline(StableDiffusionControlNetPipeline): method check_inputs (line 53) | def check_inputs( method __call__ (line 166) | def __call__( FILE: examples/boft_controlnet/utils/tracemalloc.py function b2mb (line 9) | def b2mb(x): class TorchTracemalloc (line 14) | class TorchTracemalloc: method __enter__ (line 15) | def __enter__(self): method cpu_mem_used (line 31) | def cpu_mem_used(self): method peak_monitor_func (line 35) | def peak_monitor_func(self): method __exit__ (line 47) | def __exit__(self, *exc): FILE: examples/boft_controlnet/utils/unet_2d_condition.py class UNet2DConditionOutput (line 27) | class UNet2DConditionOutput(BaseOutput): class UNet2DConditionNewModel (line 37) | class UNet2DConditionNewModel(UNet2DConditionModel): method forward (line 38) | def forward( FILE: examples/boft_dreambooth/train_dreambooth.py function save_adaptor (line 70) | def save_adaptor(accelerator, step, unet, text_encoder, args): function main (line 83) | def main(args): FILE: examples/boft_dreambooth/utils/args_loader.py function import_model_class_from_model_name_or_path (line 10) | def import_model_class_from_model_name_or_path(pretrained_model_name_or_... function get_full_repo_name (line 30) | def get_full_repo_name(model_id: str, organization: Optional[str] = None... function parse_args (line 40) | def parse_args(input_args=None): FILE: examples/boft_dreambooth/utils/dataset.py class DreamBoothDataset (line 9) | class DreamBoothDataset(Dataset): method __init__ (line 15) | def __init__( method __len__ (line 57) | def __len__(self): method __getitem__ (line 60) | def __getitem__(self, index): function collate_fn (line 90) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 112) | class PromptDataset(Dataset): method __init__ (line 115) | def __init__(self, prompt, num_samples): method __len__ (line 119) | def __len__(self): method __getitem__ (line 122) | def __getitem__(self, index): FILE: examples/boft_dreambooth/utils/tracemalloc.py function b2mb (line 9) | def b2mb(x): class TorchTracemalloc (line 14) | class TorchTracemalloc: method __enter__ (line 15) | def __enter__(self): method cpu_mem_used (line 31) | def cpu_mem_used(self): method peak_monitor_func (line 35) | def peak_monitor_func(self): method __exit__ (line 47) | def __exit__(self, *exc): FILE: examples/cartridge_self_study/arxiv_synthesize.py function main (line 22) | def main(): FILE: examples/cartridge_self_study/arxiv_train.py function main (line 26) | def main(): FILE: examples/cartridge_self_study/synthesize.py function synthesize_self_study_jsonl (line 54) | def synthesize_self_study_jsonl( function _synthesize_vllm (line 116) | def _synthesize_vllm( function _synthesize_hf (line 209) | def _synthesize_hf( function main (line 294) | def main(): FILE: examples/cartridge_self_study/train_distill.py class DistillJsonlDataset (line 28) | class DistillJsonlDataset(Dataset): method __init__ (line 29) | def __init__(self, path: str | Path): method __len__ (line 36) | def __len__(self) -> int: method __getitem__ (line 39) | def __getitem__(self, idx: int): class DistillationCollator (line 48) | class DistillationCollator: method __init__ (line 49) | def __init__(self, tokenizer): method __call__ (line 52) | def __call__(self, features): class DistillationTrainer (line 67) | class DistillationTrainer(Trainer): method __init__ (line 68) | def __init__(self, *args, top_k: int = 20, teacher_temperature: float ... method compute_loss (line 73) | def compute_loss(self, model, inputs, return_outputs=False, **kwargs): function main (line 131) | def main(): FILE: examples/causal_language_modeling/peft_lora_clm_accelerate_ds_zero3_offload.py function levenshtein_distance (line 23) | def levenshtein_distance(str1, str2): function get_closest_label (line 44) | def get_closest_label(eval_pred, classes): function b2mb (line 56) | def b2mb(x): class TorchTracemalloc (line 61) | class TorchTracemalloc: method __enter__ (line 62) | def __enter__(self): method cpu_mem_used (line 78) | def cpu_mem_used(self): method peak_monitor_func (line 82) | def peak_monitor_func(self): method __exit__ (line 94) | def __exit__(self, *exc): function main (line 110) | def main(): FILE: examples/conditional_generation/peft_adalora_seq2seq.py function preprocess_function (line 68) | def preprocess_function(examples): FILE: examples/conditional_generation/peft_lora_seq2seq_accelerate_ds_zero3_offload.py function levenshtein_distance (line 17) | def levenshtein_distance(str1, str2): function get_closest_label (line 38) | def get_closest_label(eval_pred, classes): function b2mb (line 50) | def b2mb(x): class TorchTracemalloc (line 55) | class TorchTracemalloc: method __enter__ (line 56) | def __enter__(self): method cpu_mem_used (line 72) | def cpu_mem_used(self): method peak_monitor_func (line 76) | def peak_monitor_func(self): method __exit__ (line 88) | def __exit__(self, *exc): function main (line 104) | def main(): FILE: examples/conditional_generation/peft_lora_seq2seq_accelerate_fsdp.py function main (line 14) | def main(): FILE: examples/corda_finetuning/corda_finetuning.py function get_nb_trainable_parameters (line 38) | def get_nb_trainable_parameters(model) -> tuple[int, int]: class TrainingArguments (line 65) | class TrainingArguments(transformers.TrainingArguments): function safe_save_model_for_hf_trainer (line 89) | def safe_save_model_for_hf_trainer(trainer: transformers.Trainer, output... function smart_tokenizer_and_embedding_resize (line 98) | def smart_tokenizer_and_embedding_resize( function _tokenize_fn (line 121) | def _tokenize_fn(strings: Sequence[str], tokenizer: transformers.PreTrai... function preprocess (line 145) | def preprocess( class DataCollatorForSupervisedDataset (line 164) | class DataCollatorForSupervisedDataset: method __call__ (line 169) | def __call__(self, instances: Sequence[dict]) -> dict[str, torch.Tensor]: function train_tokenize_function (line 184) | def train_tokenize_function(examples, tokenizer, query, response): function train (line 198) | def train(): FILE: examples/corda_finetuning/datautils.py function set_seed (line 30) | def set_seed(seed): function sample_train_loaders (line 35) | def sample_train_loaders(name, tokenizer, nsamples=128, seed=0, seqlen=2... function get_redpajama_train (line 66) | def get_redpajama_train(tokenizer, percent=10, seed=3, batch_size=128, m... function get_english_quote (line 80) | def get_english_quote(dataset_name, tokenizer): function get_qat_dataset (line 86) | def get_qat_dataset(name, tokenizer, data_percent): function get_calib_data (line 106) | def get_calib_data(name, tokenizer, model_id, nsamples, seqlen=2048, see... function get_eval_loaders (line 209) | def get_eval_loaders(name, tokenizer): FILE: examples/corda_finetuning/preprocess.py function run_model (line 30) | def run_model(model, calib_loader): function main (line 37) | def main(args): FILE: examples/delora_finetuning/delora_finetuning.py function train_model (line 17) | def train_model( FILE: examples/dora_finetuning/dora-caching.py function timeit (line 39) | def timeit(logs): function run_benchmark (line 47) | def run_benchmark(model, num_runs): function main (line 66) | def main(model_id, num_runs): FILE: examples/dora_finetuning/dora_finetuning.py function train_model (line 17) | def train_model( FILE: examples/ephemeral_gpu_offloading/load_with_dora.py function main (line 51) | def main(): FILE: examples/eva_finetuning/utils.py class TokenizerMetaMath (line 19) | class TokenizerMetaMath: method format_prompt (line 30) | def format_prompt(self, query): method __init__ (line 37) | def __init__(self, tokenizer_path): method __call__ (line 40) | def __call__(self, examples): method _tokenize_fn (line 45) | def _tokenize_fn(self, prompts, completions): class DataCollator (line 56) | class DataCollator: method __init__ (line 57) | def __init__(self, eos_token_id, max_length=None): method __call__ (line 61) | def __call__(self, batch): FILE: examples/feature_extraction/peft_lora_embedding_semantic_search.py function parse_args (line 42) | def parse_args(): function save_model_hook (line 154) | def save_model_hook(models, weights, output_dir): function load_model_hook (line 161) | def load_model_hook(models, input_dir): class AutoModelForSentenceEmbedding (line 169) | class AutoModelForSentenceEmbedding(nn.Module): method __init__ (line 170) | def __init__(self, model_name, tokenizer, normalize=True): method forward (line 179) | def forward(self, **kwargs): method mean_pooling (line 187) | def mean_pooling(self, model_output, attention_mask): method __getattr__ (line 192) | def __getattr__(self, name: str): function get_cosing_embeddings (line 202) | def get_cosing_embeddings(query_embs, product_embs): function get_loss (line 206) | def get_loss(cosine_score, labels): function main (line 210) | def main(): FILE: examples/fp4_finetuning/finetune_fp4_opt_bnb_peft.py class CastOutputToFloat (line 80) | class CastOutputToFloat(nn.Sequential): method forward (line 81) | def forward(self, x): function print_trainable_parameters (line 93) | def print_trainable_parameters(model): FILE: examples/gralora_finetuning/gralora_finetuning.py function train_model (line 17) | def train_model( FILE: examples/hra_dreambooth/train_dreambooth.py function save_adaptor (line 70) | def save_adaptor(accelerator, step, unet, text_encoder, args): function main (line 83) | def main(args): FILE: examples/hra_dreambooth/utils/args_loader.py function import_model_class_from_model_name_or_path (line 12) | def import_model_class_from_model_name_or_path(pretrained_model_name_or_... function get_full_repo_name (line 32) | def get_full_repo_name(model_id: str, organization: Optional[str] = None... function parse_args (line 42) | def parse_args(input_args=None): FILE: examples/hra_dreambooth/utils/dataset.py class DreamBoothDataset (line 11) | class DreamBoothDataset(Dataset): method __init__ (line 17) | def __init__( method __len__ (line 59) | def __len__(self): method __getitem__ (line 62) | def __getitem__(self, index): function collate_fn (line 92) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 114) | class PromptDataset(Dataset): method __init__ (line 117) | def __init__(self, prompt, num_samples): method __len__ (line 121) | def __len__(self): method __getitem__ (line 124) | def __getitem__(self, index): FILE: examples/hra_dreambooth/utils/tracemalloc.py function b2mb (line 11) | def b2mb(x): class TorchTracemalloc (line 16) | class TorchTracemalloc: method __enter__ (line 17) | def __enter__(self): method cpu_mem_used (line 33) | def cpu_mem_used(self): method peak_monitor_func (line 37) | def peak_monitor_func(self): method __exit__ (line 49) | def __exit__(self, *exc): FILE: examples/int8_training/fine_tune_blip2_int8.py class ImageCaptioningDataset (line 44) | class ImageCaptioningDataset(Dataset): method __init__ (line 45) | def __init__(self, dataset, processor): method __len__ (line 49) | def __len__(self): method __getitem__ (line 52) | def __getitem__(self, idx): function collator (line 61) | def collator(batch): FILE: examples/int8_training/peft_adalora_whisper_large_training.py function parse_args (line 49) | def parse_args(): function load_streaming_dataset (line 280) | def load_streaming_dataset(dataset_name, dataset_config_name, split, **k... function prepare_dataset_wrapper (line 296) | def prepare_dataset_wrapper(do_lower_case, do_remove_punctuation, proces... function save_model_hook (line 322) | def save_model_hook(models, weights, output_dir): function load_model_hook (line 329) | def load_model_hook(models, input_dir): class DataCollatorSpeechSeq2SeqWithPadding (line 337) | class DataCollatorSpeechSeq2SeqWithPadding: method __call__ (line 340) | def __call__(self, features: list[dict[str, Union[list[int], torch.Ten... function get_audio_length_processor (line 364) | def get_audio_length_processor(max_input_length): function evaluation_loop (line 371) | def evaluation_loop(model, eval_dataloader, processor, normalizer, metri... function main (line 423) | def main(): FILE: examples/lily_finetuning/lily_finetuning.py function train_model (line 17) | def train_model( FILE: examples/loftq_finetuning/int8_correction.py class MyLinear8bitLt (line 68) | class MyLinear8bitLt(peft.tuners.lora.bnb.Linear8bitLt): method forward (line 69) | def forward(self, x: torch.Tensor, *args, **kwargs) -> torch.Tensor: function get_logits (line 204) | def get_logits(model, inputs): function mse (line 213) | def mse(a, b, attention_mask=None): function get_model (line 225) | def get_model(*args, **kwargs): FILE: examples/loftq_finetuning/quantize_save_load.py class Shell (line 30) | class Shell(nn.Module): method __init__ (line 31) | def __init__(self, weight, bias=None): function unwrap_model (line 38) | def unwrap_model(model, sub_module_name=".base_layer"): function print_model (line 59) | def print_model(model, name): function arg_parse (line 78) | def arg_parse(): function quantize_and_save (line 121) | def quantize_and_save(): FILE: examples/loftq_finetuning/train_gsm8k_llama.py function parse_args (line 62) | def parse_args(): function main (line 297) | def main(): function extract_answer_number (line 817) | def extract_answer_number(sentence: str) -> float: function compute_accuracy (line 841) | def compute_accuracy(pred: list, gold: list): FILE: examples/lora_dreambooth/convert_kohya_ss_sd_lora_to_peft.py class LoRAInfo (line 25) | class LoRAInfo: method peft_state_dict (line 33) | def peft_state_dict(self) -> dict[str, torch.Tensor]: function construct_peft_loraconfig (line 39) | def construct_peft_loraconfig(info: dict[str, LoRAInfo]) -> LoraConfig: function combine_peft_state_dict (line 78) | def combine_peft_state_dict(info: dict[str, LoRAInfo]) -> dict[str, torc... FILE: examples/lora_dreambooth/convert_peft_sd_lora_to_kohya_ss.py function get_module_kohya_state_dict (line 19) | def get_module_kohya_state_dict( FILE: examples/lora_dreambooth/train_dreambooth.py function import_model_class_from_model_name_or_path (line 53) | def import_model_class_from_model_name_or_path(pretrained_model_name_or_... function parse_args (line 73) | def parse_args(input_args=None): function b2mb (line 406) | def b2mb(x): class TorchTracemalloc (line 411) | class TorchTracemalloc: method __enter__ (line 412) | def __enter__(self): method cpu_mem_used (line 428) | def cpu_mem_used(self): method peak_monitor_func (line 432) | def peak_monitor_func(self): method __exit__ (line 444) | def __exit__(self, *exc): class DreamBoothDataset (line 460) | class DreamBoothDataset(Dataset): method __init__ (line 466) | def __init__( method __len__ (line 508) | def __len__(self): method __getitem__ (line 511) | def __getitem__(self, index): function collate_fn (line 541) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 563) | class PromptDataset(Dataset): method __init__ (line 566) | def __init__(self, prompt, num_samples): method __len__ (line 570) | def __len__(self): method __getitem__ (line 573) | def __getitem__(self, index): function main (line 580) | def main(args): FILE: examples/lora_finetuning_transformer_engine/lora_finetuning_te.py function parse_args (line 46) | def parse_args(): function set_seed (line 101) | def set_seed(seed: int): function build_synthetic_sequences (line 110) | def build_synthetic_sequences(num_samples: int, min_len: int, max_len: i... function ss_char_to_label (line 119) | def ss_char_to_label(char: str) -> int: function tokenize_and_align_labels (line 124) | def tokenize_and_align_labels(sequences, label_strings, tokenizer, max_l... function load_parquet_dataset (line 156) | def load_parquet_dataset(train_path: str, val_path: str, tokenizer, max_... function compute_metrics (line 174) | def compute_metrics(eval_pred): function residue_to_ss_char (line 185) | def residue_to_ss_char(aa: str) -> str: function sequence_to_synthetic_labels (line 194) | def sequence_to_synthetic_labels(sequence: str) -> str: function make_synthetic_dataset (line 199) | def make_synthetic_dataset( function main (line 227) | def main(): FILE: examples/lora_ga_finetuning/lora_ga_finetuning.py function parse_args (line 34) | def parse_args(): function prepare_dataset (line 94) | def prepare_dataset(dataset_name, dataset_config, tokenizer, max_length): function main (line 116) | def main(): FILE: examples/lorafa_finetune/lorafa_finetuning.py function train_model (line 33) | def train_model( FILE: examples/miss_finetuning/miss_finetuning.py class ScriptArguments (line 28) | class ScriptArguments(SFTConfig): FILE: examples/oft_dreambooth/train_dreambooth.py function import_model_class_from_model_name_or_path (line 54) | def import_model_class_from_model_name_or_path(pretrained_model_name_or_... function parse_args (line 74) | def parse_args(input_args=None): function b2mb (line 416) | def b2mb(x): class TorchTracemalloc (line 421) | class TorchTracemalloc: method __enter__ (line 422) | def __enter__(self): method cpu_mem_used (line 438) | def cpu_mem_used(self): method peak_monitor_func (line 442) | def peak_monitor_func(self): method __exit__ (line 454) | def __exit__(self, *exc): class DreamBoothDataset (line 470) | class DreamBoothDataset(Dataset): method __init__ (line 476) | def __init__( method __len__ (line 518) | def __len__(self): method __getitem__ (line 521) | def __getitem__(self, index): function collate_fn (line 551) | def collate_fn(examples, with_prior_preservation=False): class PromptDataset (line 573) | class PromptDataset(Dataset): method __init__ (line 576) | def __init__(self, prompt, num_samples): method __len__ (line 580) | def __len__(self): method __getitem__ (line 583) | def __getitem__(self, index): function main (line 590) | def main(args): FILE: examples/olora_finetuning/olora_finetuning.py function train (line 30) | def train( function generate_prompt (line 145) | def generate_prompt(example): FILE: examples/orthogonal_subspace_learning/osf_continual_learning.py function compute_accuracy_scienceqa (line 51) | def compute_accuracy_scienceqa(model, eval_dataset, tokenizer, data_coll... function compute_accuracy_numglue (line 99) | def compute_accuracy_numglue(model, eval_dataset, tokenizer, data_collat... function compute_accuracy_fomc (line 142) | def compute_accuracy_fomc(model, eval_dataset, tokenizer, data_collator): function evaluate_model (line 190) | def evaluate_model(model, eval_dataset, data_collator, tokenizer, task_n... function train_with_osf (line 218) | def train_with_osf( function train_full_finetuning (line 383) | def train_full_finetuning( function print_results_comparison (line 511) | def print_results_comparison(osf_history, full_history): function main (line 597) | def main(): FILE: examples/orthogonal_subspace_learning/utils.py function load_scienceqa (line 20) | def load_scienceqa(num_train=1000, num_eval=200, seed=42): function load_numglue (line 42) | def load_numglue(num_train=1000, num_eval=200, seed=42): function load_fomc (line 94) | def load_fomc(num_train=1000, num_eval=200, seed=42): function format_scienceqa_for_llama (line 119) | def format_scienceqa_for_llama(examples, tokenizer, max_length=512): function format_numglue_for_llama (line 180) | def format_numglue_for_llama(examples, tokenizer, max_length=512): function format_fomc_for_llama (line 224) | def format_fomc_for_llama(examples, tokenizer, max_length=512): class DataCollatorForCompletionOnly (line 269) | class DataCollatorForCompletionOnly: method __init__ (line 272) | def __init__(self, tokenizer, max_length=512): method __call__ (line 276) | def __call__(self, features): FILE: examples/peanut_finetuning/peanut_finetuning.py function train_model (line 17) | def train_model( FILE: examples/pissa_finetuning/pissa_finetuning.py class ScriptArguments (line 28) | class ScriptArguments(SFTConfig): FILE: examples/psoft_finetuning/psoft_finetuning.py class ScriptArguments (line 28) | class ScriptArguments(SFTConfig): function _dtype_from_bits (line 87) | def _dtype_from_bits(bits: str) -> torch.dtype: function main (line 98) | def main(): FILE: examples/pvera/confidence_interval_generation.py function mean_confidence_interval (line 67) | def mean_confidence_interval(data, confidence=0.95): FILE: examples/qalora_finetuning/qalora_gptq_finetuning.py function load_or_quantize_model (line 24) | def load_or_quantize_model( function tokenize_and_preprocess (line 109) | def tokenize_and_preprocess(examples, tokenizer, max_length: int = 128): function train_model (line 132) | def train_model( FILE: examples/randlora_finetuning/randlora_finetuning.py function train_model (line 18) | def train_model( FILE: examples/road_finetuning/road_finetuning.py function train_model (line 31) | def train_model(