MCPcopy Create free account

hub / github.com/GCYZSL/MoLA / functions

Functions226 in github.com/GCYZSL/MoLA

↓ 1 callersMethodgenerate_prompt
( self, instruction: str, input: Union[None, str] = None, labe
evaluation_scienceqa.py:48
↓ 1 callersFunctionget_answer
(problem, options)
preparation_scienceqa_data.py:30
↓ 1 callersFunctionget_choice_text
(probelm, options)
preparation_scienceqa_data.py:21
↓ 1 callersFunctionget_context_text
(problem, use_caption)
preparation_scienceqa_data.py:12
↓ 1 callersMethodget_eval_dataloader
Returns the evaluation [`~torch.utils.data.DataLoader`]. Subclass and override this method if you want to inject some custom behavio
src/mola_trainer_hacked.py:920
↓ 1 callersFunctionget_lecture_text
(problem)
preparation_scienceqa_data.py:34
↓ 1 callersMethodget_optimizer_cls_and_kwargs
Returns the optimizer class and optimizer parameters based on the training arguments. Args: args (`transformers.training
src/mola_trainer_hacked.py:1093
↓ 1 callersFunctionget_peft_model_state_dict_moe
Get the state dict of the Peft model. Args: model ([`PeftModel`]): The Peft model. When using torch.nn.DistributedDataParallel, Deep
src/mola_peft_model_hacked.py:64
↓ 1 callersMethodget_prompt_embedding_to_save
Returns the prompt embedding to save when saving the model. Only applicable when `peft_config.peft_type != PeftType.LORA`.
src/mola_peft_model_hacked.py:404
↓ 1 callersMethodget_response
(self, output: str)
evaluation_scienceqa.py:70
↓ 1 callersFunctionget_solution_text
(problem)
preparation_scienceqa_data.py:40
↓ 1 callersMethodget_test_dataloader
Returns the test [`~torch.utils.data.DataLoader`]. Subclass and override this method if you want to inject some custom behavior.
src/mola_trainer_hacked.py:970
↓ 1 callersMethodget_train_dataloader
Returns the training [`~torch.utils.data.DataLoader`]. Will use no sampler if `train_dataset` does not implement `__len__`, a random
src/mola_trainer_hacked.py:841
↓ 1 callersMethodipex_optimize_model
(self, model, training=False, dtype=torch.float32)
src/mola_trainer_hacked.py:1338
↓ 1 callersMethodload_adapter
(self, model_id: str, adapter_name: str, is_trainable: bool = False, **kwargs: Any)
src/mola_peft_model_hacked.py:552
↓ 1 callersFunctionload_balancing_loss_func
r""" Computes auxiliary load balancing loss as in Switch Transformer - implemented in Pytorch. See Switch Transformer (https://arxiv.org/abs/
src/mola_modeling_llama_hacked.py:22
↓ 1 callersFunctionmain
()
evaluation_scienceqa.py:74
↓ 1 callersMethodprint_trainable_parameters
Prints the number of trainable parameters in the model.
src/mola_peft_model_hacked.py:461
↓ 1 callersMethodreset_lora_parameters_MoE
(self, adapter_name)
src/mola_lora_hacked.py:740
↓ 1 callersMethodtorch_jit_model_eval
(self, model, dataloader, training=False)
src/mola_trainer_hacked.py:1300
↓ 1 callersMethodupdate_layer_conv2d
(self, adapter_name, r, lora_alpha, lora_dropout, init_lora_weights)
src/mola_lora_hacked.py:584
Method__call__
(self, input_ids, scores)
utils/callbacks.py:19
Method__enter__
(self)
utils/callbacks.py:71
Method__exit__
(self, exc_type, exc_val, exc_tb)
utils/callbacks.py:74
Method__getattr__
Forward missing attributes to the wrapped module.
src/mola_peft_model_hacked.py:480
Method__getattr__
Forward missing attributes to the wrapped module.
src/mola_lora_hacked.py:353
Method__init__
(self, template_name: str = "", verbose: bool = False)
evaluation_scienceqa.py:34
Method__init__
(self, callback_func=None)
utils/callbacks.py:16
Method__init__
(self, func, kwargs={}, callback=None)
utils/callbacks.py:32
Method__init__
(self, template_name: str = "", verbose: bool = False)
utils/prompter.py:13
Method__init__
( self, model: Union[PreTrainedModel, nn.Module] = None, args: TrainingArguments = Non
src/mola_trainer_hacked.py:296
Method__init__
(self, model, peft_config: PeftConfig, adapter_name="default")
src/mola_peft_model_hacked.py:763
Method__init__
(self, model, peft_config: PeftConfig, adapter_name="default", number_experts= [8] * 32, top_k=[2] * 32)
src/mola_peft_model_hacked.py:948
Method__init__
(self, model, peft_config: PeftConfig, adapter_name="default")
src/mola_peft_model_hacked.py:1116
Method__init__
(self, model, peft_config: PeftConfig = None, adapter_name="default")
src/mola_peft_model_hacked.py:1350
Method__init__
(self, model, peft_config: PeftConfig = None, adapter_name="default")
src/mola_peft_model_hacked.py:1520
Method__init__
(self, in_features: int, out_features: int, **kwargs)
src/mola_lora_hacked.py:544
Method__init__
(self, in_features: int, out_features: int, **kwargs)
src/mola_lora_hacked.py:643
Method__init__
( self, adapter_name: str, in_features: int, out_features: int, r: int
src/mola_lora_hacked.py:765
Method__init__
LlamaRMSNorm is equivalent to T5LayerNorm
src/mola_modeling_llama_hacked.py:165
Method__init__
(self, dim, max_position_embeddings=2048, base=10000, device=None)
src/mola_modeling_llama_hacked.py:185
Method__init__
( self, hidden_size: int, num_heads: int, config: LlamaConfig, ##modified
src/mola_modeling_llama_hacked.py:280
Method__init__
(self, config: LlamaConfig)
src/mola_modeling_llama_hacked.py:456
Method__init__
(self, config: LlamaConfig)
src/mola_modeling_llama_hacked.py:664
Method__init__
(self, config)
src/mola_modeling_llama_hacked.py:958
Method__init__
(self, config)
src/mola_modeling_llama_hacked.py:1146
Method__init__
(self, config)
src/mola_modeling_llama_hacked.py:1390
Method__iter__
(self)
utils/callbacks.py:61
Method__next__
(self)
utils/callbacks.py:64
Method__post_init__
(self)
src/mola_lora_hacked.py:94
Method_callback
(val)
utils/callbacks.py:40
Method_init_weights
(self, module)
src/mola_modeling_llama_hacked.py:576
Method_inner_training_loop
( self, batch_size=None, args=None, resume_from_checkpoint=None, trial=None, ignore_keys_for_eval=None
src/mola_trainer_hacked.py:1645
Method_reorder_cache
(past_key_values, beam_idx)
src/mola_modeling_llama_hacked.py:1137
Method_reorder_cache
(past_key_values, beam_idx)
src/mola_modeling_llama_hacked.py:1366
Method_set_gradient_checkpointing
(self, module, value=False)
src/mola_modeling_llama_hacked.py:587
Method_shape
(self, tensor: torch.Tensor, seq_len: int, bsz: int)
src/mola_modeling_llama_hacked.py:320
Methodactive_peft_config
(self)
src/mola_peft_model_hacked.py:679
Methodadd_weighted_adapter
(self, adapters, weights, adapter_name)
src/mola_lora_hacked.py:459
Methodauto_wrapper_callable
(m, *args, **kwargs)
src/mola_trainer_hacked.py:1502
Methodcreate_custom_forward
(module)
src/mola_modeling_llama_hacked.py:898
Methodcustom_forward
(*inputs)
src/mola_modeling_llama_hacked.py:899
Methoddisable_adapter
Disables the adapter module.
src/mola_peft_model_hacked.py:494
Methodevaluation_loop
Prediction/evaluation loop, shared by `Trainer.evaluate()` and `Trainer.predict()`. Works both with or without labels.
src/mola_trainer_hacked.py:3042
Methodforward
Forward pass of the model.
src/mola_peft_model_hacked.py:487
Methodforward
( self, input_ids=None, attention_mask=None, inputs_embeds=None, label
src/mola_peft_model_hacked.py:778
Methodforward
( self, input_ids=None, attention_mask=None, inputs_embeds=None, label
src/mola_peft_model_hacked.py:952
Methodforward
( self, input_ids=None, attention_mask=None, inputs_embeds=None, decod
src/mola_peft_model_hacked.py:1123
Methodforward
( self, input_ids=None, attention_mask=None, inputs_embeds=None, label
src/mola_peft_model_hacked.py:1365
Methodforward
( self, input_ids=None, attention_mask=None, token_type_ids=None, posi
src/mola_peft_model_hacked.py:1535
Methodforward
(self, x: torch.Tensor)
src/mola_lora_hacked.py:831
Methodforward
(self, hidden_states)
src/mola_modeling_llama_hacked.py:173
Methodforward
(self, x, seq_len=None)
src/mola_modeling_llama_hacked.py:199
Methodforward
(self, x)
src/mola_modeling_llama_hacked.py:246
Methodforward
Input shape: Batch x Time x Channel
src/mola_modeling_llama_hacked.py:323
Methodforward
Args: hidden_states (`torch.FloatTensor`): input to the layer of shape `(batch, seq_len, embed_dim)` attention_mask (
src/mola_modeling_llama_hacked.py:478
Methodforward
r""" Args: input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`): Indices of input sequence toke
src/mola_modeling_llama_hacked.py:711
Methodforward
r""" Args: input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`): Indices of input sequence toke
src/mola_modeling_llama_hacked.py:986
Methodforward
r""" Args: input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`): Indices of input sequence toke
src/mola_modeling_llama_hacked.py:1184
Methodforward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the sequence classification/regression
src/mola_modeling_llama_hacked.py:1406
Methodgenerate
(self, **kwargs)
src/mola_peft_model_hacked.py:1234
Functiongenerate_and_tokenize_prompt
(data_point)
mola_training.py:173
Functiongenerate_and_tokenize_prompt_meta
(data_point)
mola_training_instruction.py:170
Methodgentask
()
utils/callbacks.py:45
Methodget_decoder
(self)
src/mola_modeling_llama_hacked.py:982
Methodget_decoder
(self)
src/mola_modeling_llama_hacked.py:1179
Methodget_input_embeddings
(self)
src/mola_modeling_llama_hacked.py:967
Methodget_input_embeddings
(self)
src/mola_modeling_llama_hacked.py:1164
Methodget_input_embeddings
(self)
src/mola_modeling_llama_hacked.py:1399
Methodget_output_embeddings
(self)
src/mola_modeling_llama_hacked.py:973
Methodget_output_embeddings
(self)
src/mola_modeling_llama_hacked.py:1170
Functionget_peft_config
Returns a Peft config object from a dictionary. Args: config_dict (`Dict[str, Any]`): Dictionary containing the configuration parame
src/mola_mapping_hacked.py:61
Methodget_peft_config_as_dict
(self, inference: bool = False)
src/mola_lora_hacked.py:360
Methodget_response
(self, output: str)
utils/prompter.py:73
Methodhyperparameter_search
Launch an hyperparameter search using `optuna` or `Ray Tune` or `SigOpt`. The optimized quantity is determined by `compute_objective`
src/mola_trainer_hacked.py:2461
Methodmake_inputs_require_grad
(module, input, output)
src/mola_peft_model_hacked.py:398
Functionmark_only_lora_B_as_trainable
(model: nn.Module, bias: str = "none")
src/mola_lora_hacked.py:525
Methodmerge_adapter
(self)
src/mola_lora_hacked.py:388
Methodmerge_and_unload
r""" This method merges the LoRa layers into the base model. This is needed if someone wants to use the base model as a standalone mod
src/mola_lora_hacked.py:406
Methodopt_load_hook
(mod, opt)
src/mola_trainer_hacked.py:2433
← previousnext →101–200 of 226, ranked by callers