MCPcopy Create free account

hub / github.com/adapter-hub/adapters / functions

Functions1,559 in github.com/adapter-hub/adapters

Method__len__
(self)
src/adapters/configuration/adapter_config.py:43
Method__len__
(self)
src/adapters/configuration/adapter_config.py:830
Method__len__
(self)
src/adapters/heads/base.py:57
Method__post_init__
Validate projection attributes after initialization.
src/adapters/interface.py:128
Method__post_init__
(self)
examples/pytorch/multiple-choice/run_swag.py:161
Method__post_init__
(self)
examples/pytorch/translation/run_translation.py:243
Method__post_init__
(self)
examples/pytorch/token-classification/run_ner.py:206
Method__post_init__
(self)
examples/pytorch/text-classification/run_glue.py:146
Method__post_init__
(self)
examples/pytorch/question-answering/run_qa.py:210
Method__post_init__
(self)
examples/pytorch/question-answering/run_seq2seq_qa.py:248
Method__post_init__
(self)
examples/pytorch/summarization/run_summarization.py:276
Method__post_init__
(self)
examples/pytorch/language-modeling/run_mlm.py:152
Method__post_init__
(self)
examples/pytorch/language-modeling/run_mlm.py:234
Method__post_init__
(self)
examples/pytorch/language-modeling/run_clm.py:155
Method__post_init__
(self)
examples/pytorch/language-modeling/run_clm.py:225
Method__repr__
(self)
src/adapters/composition.py:26
Method__repr__
(self)
src/adapters/utils.py:109
Method__setattr__
(self, name, value)
src/adapters/configuration/adapter_config.py:28
Method__setitem__
(self, k, v)
src/adapters/heads/base.py:47
Function_attn_mask_hook_fn
(module, args)
src/adapters/methods/prompt_tuning.py:201
Method_average_invertible_adapter
( self, adapter_name: str, input_adapters: Dict[str, float], combine_strategy:
src/adapters/model_mixin.py:209
Method_check_lora_location
(self, config: LoRAConfig)
src/adapters/methods/lora.py:855
Method_create_model_output
(loss, logits, base_outputs)
src/adapters/heads/language_modeling.py:171
Method_create_model_output
(loss, logits, base_outputs)
src/adapters/heads/language_modeling.py:213
Method_default_init_adapter_methods
Init default adapter methods in base model. This is done in sub-models, so don't do anything here.
src/adapters/model_mixin.py:2091
Method_default_init_adapter_methods
(self, model_config, adapters_config)
src/adapters/models/clip/mixin_clip.py:122
Method_generate_examples
(self, files, split)
tests/fixtures/samples/cifar10/cifar10.py:48
Method_get_head_input
(outputs, cls_out, batch)
src/adapters/heads/model_mixin.py:606
Method_get_lora_shapes
(self, config: LoRAConfig)
src/adapters/methods/lora.py:858
Method_get_lora_shapes
(self, config: LoRAConfig)
src/adapters/methods/lora.py:1146
Method_get_save_kwargs
(self)
src/adapters/composition.py:121
Method_get_save_kwargs
(self)
src/adapters/composition.py:134
Method_get_save_kwargs
(self)
src/adapters/composition.py:161
Method_info
(self)
tests/fixtures/samples/cifar10/cifar10.py:23
Method_init_adapters_submodules
Initializes adapters in all submodules. Since all submodules have been wrapped by the init_submodels method this method doesn't need
src/adapters/model_mixin.py:2084
Method_init_adapters_submodules
(self, model_config, adapters_config)
src/adapters/models/clip/mixin_clip.py:113
Method_init_model_for_train_run
(self, trained_adapter_name, frozen_adapter_name, adapter_config=None)
tests/test_methods/test_on_custom_interface.py:58
Method_load_attr_from_module
(self, model_type, attr)
src/adapters/models/auto/auto_factory.py:7
Method_load_best_model
(self)
src/adapters/trainer.py:222
Method_load_from_checkpoint
(self, resume_from_checkpoint)
src/adapters/trainer.py:167
Method_load_pretrained_model
( cls, model, *args, key_mapping=None, **kwargs, )
src/adapters/heads/model_mixin.py:766
Function_mp_fn
(index)
examples/pytorch/adapterfusion/run_fusion_glue.py:274
Function_mp_fn
(index)
examples/pytorch/multiple-choice/run_swag.py:500
Function_mp_fn
(index)
examples/pytorch/translation/run_translation.py:700
Function_mp_fn
(index)
examples/pytorch/token-classification/run_ner.py:651
Function_mp_fn
(index)
examples/pytorch/text-classification/run_glue.py:640
Function_mp_fn
(index)
examples/pytorch/question-answering/run_qa.py:715
Function_mp_fn
(index)
examples/pytorch/question-answering/run_seq2seq_qa.py:746
Function_mp_fn
(index)
examples/pytorch/summarization/run_summarization.py:773
Function_mp_fn
(index)
examples/pytorch/language-modeling/run_mlm.py:692
Function_mp_fn
(index)
examples/pytorch/language-modeling/run_clm.py:658
Function_prepare_dataset
(batch)
tests/fixtures/audio_datasets/prepare_audio_datasets.py:37
Method_prepare_encoder_decoder_kwargs_for_generation
( self, inputs_tensor: torch.Tensor, model_kwargs, model_input_name: Optional[
src/adapters/model_mixin.py:1859
Method_prepare_model_inputs
(self, *args, **kwargs)
src/adapters/model_mixin.py:1908
Method_reorder_cache
(past, beam_idx)
src/adapters/models/plbart/adapter_model.py:150
Method_reorder_cache
(past, beam_idx)
src/adapters/models/bart/adapter_model.py:146
Method_reorder_cache
(past_key_values, beam_idx)
src/adapters/models/whisper/adapter_model.py:214
Method_reorder_cache
(past, beam_idx)
src/adapters/models/mbart/adapter_model.py:167
Method_reorder_cache
(self, past, beam_idx)
src/adapters/models/mt5/adapter_model.py:189
Method_reorder_cache
(self, past, beam_idx)
src/adapters/models/t5/adapter_model.py:189
Method_reorder_cache
This function is used to re-order the `past_key_values` cache if [`~PretrainedModel.beam_search`] or [`~PretrainedModel.beam_sample`]
examples/pytorch/text-generation/run_generation.py:274
Function_residual_hook_fn
(location_key, module, args)
src/adapters/methods/bottleneck.py:414
Method_resize_token_embeddings
(self, new_num_tokens, pad_to_multiple_of=None, mean_resizing=True)
src/adapters/heads/model_mixin.py:186
Function_resumable_file_manager
()
src/adapters/utils.py:365
Method_save
(self, save_directory, model_config)
src/adapters/interface.py:146
Method_shape
(self, tensor: torch.Tensor, seq_len: int, bsz: int)
src/adapters/models/mbart/modeling_mbart.py:43
Method_split_generators
(self, dl_manager)
tests/fixtures/samples/cifar10/cifar10.py:33
Methodactive_adapters
(self)
src/adapters/model_mixin.py:639
Methodactive_embeddings
(self)
src/adapters/model_mixin.py:385
Methodactive_embeddings
(self)
src/adapters/model_mixin.py:412
Methodactive_head
The active prediction head configuration of this model. Can be either the name of a single available head (string) or a list of multi
src/adapters/heads/model_mixin.py:246
Functionactual_decorator
(target_func)
src/adapters/utils.py:943
Methodadapter
(self)
src/adapters/configuration/adapter_config.py:880
Methodadapter_modules
(self)
src/adapters/methods/adapter_layer_base.py:33
Methodadapter_setup_fn
(model)
tests/test_methods/method_test_impl/base.py:450
Methodadapter_to
Moves the adapter with the given name to the specified device and data type. Args: name (str): The name of the adapter t
src/adapters/heads/model_mixin.py:747
Methodadd_adapter
Adds a new adapter module of the specified type to the model. Args: adapter_name (str): The name of the adapter module t
src/adapters/model_mixin.py:2120
Methodadd_adapter
(self, adapter_name: str, layer_idx: int)
src/adapters/methods/prompt_tuning.py:160
Methodadd_adapter
(self, adapter_name: str, layer_idx: int)
src/adapters/methods/bottleneck.py:69
Methodadd_adapter
(self, adapter_name: str, layer_idx: int, **kwargs)
src/adapters/methods/lora.py:1153
Methodadd_embeddings
( self, name, tokenizer, reference_embedding=None, reference_tokenizer
src/adapters/model_mixin.py:393
Methodadd_fusion_layer
(self, adapter_names: Union[List, str])
src/adapters/methods/adapter_layer_base.py:168
Methodadd_head
(self, model, name, **kwargs)
tests/test_methods/base.py:125
Methodadd_head
(self, model, name, **kwargs)
tests/test_methods/base.py:168
Methodadd_head
(self, model, name, head_type="seq2seq_lm", **kwargs)
tests/test_methods/base.py:206
Methodadd_head
(self, model, name, **kwargs)
tests/test_methods/test_on_bert_generation.py:23
Methodadd_invertible_adapter
Adds an invertible adapter module for the adapter with the given name. If the given adapter does not specify an invertible adapter co
src/adapters/model_mixin.py:197
Methodadd_task_ids
(example_batch)
tests/test_methods/method_test_impl/composition/test_multi_task.py:30
Methodall_generative_model_classes
(self)
tests/test_models/base.py:7
Methodattach_labels
Attaches labels to the input samples.
tests/test_methods/base.py:37
Methodattach_labels
(self, inputs)
tests/test_methods/base.py:241
Methodaverage_adapter
Adds a new adapter module as weighted average of a set of existing adapter modules. Args: adapter_name (str): The name o
src/adapters/model_mixin.py:1693
Methodaverage_adapter
Averages a set of adapter modules into a new adapter module. Args: adapter_name (str): The name of the new (averaged) adapter mod
src/adapters/methods/adapter_layer_base.py:103
Methodaverage_adapter
( self, adapter_name: str, input_adapters: Dict[str, float], combine_strategy:
src/adapters/methods/prefix_tuning.py:388
Methodbuild_generate_input
The generate() functions for inference require different inputs depeding on the model type. E.g. the text models require input_ids, where as the audio
tests/test_methods/base.py:80
Methodcheck_output
(self, want, got, optionflags)
conftest.py:83
Methodcheck_training_gradient_checkpointing
(self, gradient_checkpointing_kwargs=None)
tests/test_models/base.py:13
Methodcom
Performs the composition operation between existing and injected weights.
src/adapters/methods/lora.py:137
Methodcom
Performs the composition operation between existing and injected weights.
src/adapters/methods/lora.py:375
Methodcom_inv
Inverts the composition operation between existing and injected weights.
src/adapters/methods/lora.py:143
← previousnext →601–700 of 1,559, ranked by callers