MCPcopy Create free account

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

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

↓ 1 callersFunction_get_matching_version
(config_entry, org)
src/adapters/utils.py:678
↓ 1 callersMethod_get_save_kwargs
(self)
src/adapters/composition.py:49
↓ 1 callersMethod_init_W
(self, W_left=None, W_right=None, W=None)
src/adapters/methods/modeling.py:672
↓ 1 callersMethod_init_adapters_submodules
(self, model_config, adapters_config)
src/adapters/model_mixin.py:449
↓ 1 callersMethod_init_prompt_embedding
(self, base_model_embeddings: nn.Module)
src/adapters/methods/prompt_tuning.py:76
↓ 1 callersMethod_link_prefix_to_pool
(self, layer)
src/adapters/model_mixin.py:432
↓ 1 callersMethod_load
(cls, path_or_repo_id: str, **kwargs)
src/adapters/interface.py:157
↓ 1 callersMethod_load_adapter_fusions
(self, resume_from_checkpoint)
src/adapters/trainer.py:208
↓ 1 callersMethod_load_adapters
(self, resume_from_checkpoint)
src/adapters/trainer.py:197
↓ 1 callersMethod_load_heads
(self, resume_from_checkpoint)
src/adapters/trainer.py:214
↓ 1 callersMethod_load_module_state_dict
(module, state_dict, start_prefix="")
src/adapters/loading.py:121
↓ 1 callersMethod_merge_subword_tokens
(self, subword_outputs, word_starts)
src/adapters/heads/dependency_parsing.py:134
↓ 1 callersFunction_minimize_dict
(d)
src/adapters/utils.py:139
↓ 1 callersFunction_regex_list_rename_func
(k, rename_list)
src/adapters/head_utils.py:794
↓ 1 callersMethod_rename_legacy_weights
(self, k)
src/adapters/loading.py:406
↓ 1 callersMethod_run_gradient_checkpointing_test_helper
Test that gradient checkpointing produces the same results as normal training Args: adapter_setup_fn: Function that takes
tests/test_methods/method_test_impl/base.py:400
↓ 1 callersMethod_scatter_adapted_states
(self, hidden_states: torch.Tensor, adapted_states: List[torch.Tensor])
src/adapters/methods/reft.py:148
↓ 1 callersMethod_set_layer_hook_for_parallel
(self, layer: nn.Module)
src/adapters/models/albert/mixin_albert.py:60
↓ 1 callersMethod_set_layer_hook_for_parallel
(self, layer: nn.Module)
src/adapters/models/xmod/mixin_xmod.py:31
↓ 1 callersMethod_set_layer_hook_for_parallel
(self, layer: nn.Module)
src/adapters/models/clip/mixin_clip.py:57
↓ 1 callersMethod_set_layer_hook_for_parallel
(self, layer: nn.Module)
src/adapters/models/bert/mixin_bert.py:87
↓ 1 callersMethod_shape
(self, tensor: torch.Tensor, seq_len: int, bsz: int)
src/adapters/models/plbart/modeling_plbart.py:47
↓ 1 callersFunction_split_identifier
(identifier)
src/adapters/utils.py:598
↓ 1 callersMethod_store_fusion_attentions
(self, fusion_name, attentions)
src/adapters/methods/adapter_layer_base.py:81
↓ 1 callersFunction_validate_interface_values
Validates that all values specified in the interface exist in the model. Args: base_model: The base model to validate against
src/adapters/wrappers/model.py:216
↓ 1 callersMethodadapter_fusion_to
Moves the adapter fusion layer with the given name to the specified device and data type. Args: adapter_names (Union[Fus
src/adapters/model_mixin.py:1532
↓ 1 callersMethodadapter_summary
Returns a string summary of all adapters currently added to the model. Each entry in the summary table has the following attributes:
src/adapters/model_mixin.py:1553
↓ 1 callersMethodadd
Parameters ---------- predicted_indices : ``torch.Tensor``, required. A tensor of head index predictions of shape
examples/pytorch/dependency-parsing/utils_udp.py:122
↓ 1 callersMethodadd_adapter
Adds a new adapter module to the layer. Args: adapter_name (str): The name of the new adapter to add. layer_idx (int)
src/adapters/methods/adapter_layer_base.py:90
↓ 1 callersMethodadd_adapter
(self, adapter_name: str, layer_idx: int)
src/adapters/methods/prefix_tuning.py:351
↓ 1 callersMethodadd_adapter
(self, adapter_name: str, layer_idx: int)
src/adapters/methods/invertible.py:22
↓ 1 callersMethodadd_context_args_in_signature
(cls, f)
src/adapters/context.py:130
↓ 1 callersMethodadd_head
Adds a dummy head to the model.
tests/test_methods/base.py:25
↓ 1 callersMethodadd_multiple_choice_head
Adds a multiple choice head on top of the model. Args: head_name (str): The name of the head. num_choices (i
src/adapters/heads/model_mixin.py:414
↓ 1 callersMethodadd_qa_head
Adds a question answering head on top of the model. Args: head_name (str): The name of the head. num_labels
src/adapters/heads/model_mixin.py:455
↓ 1 callersFunctionadjust_length_to_model
(length, max_sequence_length)
examples/pytorch/text-generation/run_generation.py:152
↓ 1 callersMethodapply_weights
(self, hidden_states: torch.Tensor)
src/adapters/methods/lora.py:203
↓ 1 callersMethodattach_labels
(self, inputs)
tests/test_methods/base.py:150
↓ 1 callersMethodattach_labels
(self, inputs)
tests/test_methods/test_on_bert_generation.py:74
↓ 1 callersMethodaverage_head
Adds a new prediction head as a weighted average of a set of existing prediction heads. Args: head_name (str): The name
src/adapters/model_mixin.py:2206
↓ 1 callersMethodaverage_prefix
( self, prefix_name: str, input_adapters: Dict[str, float], combine_strategy:
src/adapters/methods/prefix_tuning.py:215
↓ 1 callersMethodbuild
(self, model)
src/adapters/heads/dependency_parsing.py:79
↓ 1 callersMethodcommon_config_value
Checks whether all adapters in a list share the same config setting for a given attribute and returns the shared value. Args
src/adapters/configuration/model_adapters_config.py:198
↓ 1 callersFunctioncompare_lists_close
Reimplementation of `allclose()` for lists.
utils/back_comp/Utils.py:467
↓ 1 callersMethodcompose_batch_split
For splitting to multiple adapters along the batch size dimension.
src/adapters/methods/adapter_layer_base.py:422
↓ 1 callersFunctioncompute_dora_add_com_inv
This function computes the inverse of the DoRA composition operation i.e the `compute_dora_deltaw` function with the equation w_0' = m * (w_0
src/adapters/methods/lora.py:495
↓ 1 callersFunctioncompute_dora_deltaw
This function calculates the dora update. In the paper, the dora update delta_w is calculated as follows: m * (w_0x + BAx) / ||w_0 + BA||c
src/adapters/methods/lora.py:464
↓ 1 callersFunctionconvert_xmod_checkpoint
(model_name: str, output_dir: str)
utils/convert_xmod_checkpoint.py:15
↓ 1 callersMethodcopy_from
(self, module: nn.Linear)
src/adapters/methods/lora.py:850
↓ 1 callersFunctioncreate_common_voice
Creates a small abstract dataset of 10 samples from the common voice dataset in english.
tests/fixtures/audio_datasets/prepare_audio_datasets.py:9
↓ 1 callersFunctioncreate_common_voice_encoded
Preprocesses the common voice dataset and creates a new encoded version ready for training.
tests/fixtures/audio_datasets/prepare_audio_datasets.py:25
↓ 1 callersFunctioncreate_model
Creates and returns an instance of a specified test model. Args: model_name (str): Specifies which model to instantiate. Raises:
utils/back_comp/Utils.py:142
↓ 1 callersFunctioncreate_speech_commands
Creates a small abstract dataset of 10 samples from the speech commands dataset.
tests/fixtures/audio_datasets/prepare_audio_datasets.py:91
↓ 1 callersFunctioncreate_speech_commands_encoded
Preprocesses the speech commands dataset and creates a new encoded version ready for training.
tests/fixtures/audio_datasets/prepare_audio_datasets.py:109
↓ 1 callersMethodcreate_twin_models
(self, config, adapter_interface, hf_auto_model_class)
tests/test_misc/test_custom_interface_compat.py:74
↓ 1 callersMethodcreate_twin_models
(self)
tests/test_methods/method_test_impl/base.py:202
↓ 1 callersMethodcreate_twin_models
(self)
tests/test_methods/method_test_impl/core/test_adapter_backward_compability.py:12
↓ 1 callersFunctiondecode_tuple
Reconstructs a potentially nested tuple of type `torch.Tensor` as a nested list. Args: tuple_to_decode (tuple): The tuple to decode. R
utils/back_comp/Utils.py:393
↓ 1 callersMethoddelete_adapter
Deletes an adapter module from the layer. Args: adapter_name (str): The name of the adapter to delete.
src/adapters/methods/adapter_layer_base.py:148
↓ 1 callersMethoddelete_adapter
(self, adapter_name: str)
src/adapters/methods/prefix_tuning.py:421
↓ 1 callersMethoddelete_fusion_layer
(self, adapter_names: Union[List, str])
src/adapters/methods/bottleneck.py:134
↓ 1 callersMethoddelete_prefix
(self, prefix_name: str)
src/adapters/methods/prefix_tuning.py:243
↓ 1 callersFunctiondeps_list
(*pkgs)
setup.py:82
↓ 1 callersFunctiondora_merge
This function calculates the weights required to merge with the original pretrained weight matrices.
src/adapters/methods/lora.py:482
↓ 1 callersMethode
(self, s)
src/adapters/methods/modeling.py:546
↓ 1 callersMethodeject_prefix_tuning
Converts the prefix tuning with the given name from the reparameterized form into the flat form. Args: name (str): The n
src/adapters/model_mixin.py:1817
↓ 1 callersMethodenable_prefix
(self, prefix_name: str)
src/adapters/methods/prefix_tuning.py:247
↓ 1 callersMethodextract_input_ids
(self, inputs)
tests/test_methods/base.py:235
↓ 1 callersFunctionfilter_parameters
(model, filter_string)
tests/test_methods/method_test_impl/embeddings/test_adapter_embeddings.py:10
↓ 1 callersFunctionfilter_parameters
(model, filter_string)
tests/test_methods/method_test_impl/composition/test_parallel.py:20
↓ 1 callersFunctionfilter_safe_tarinfos
(members)
src/adapters/utils.py:438
↓ 1 callersFunctionfilter_safe_zipinfos
(members)
src/adapters/utils.py:424
↓ 1 callersMethodforward
(self, embedded_input)
src/adapters/methods/prompt_tuning.py:113
↓ 1 callersMethodforward
(self, hidden_states: Optional[torch.Tensor], layer_input: torch.Tensor)
src/adapters/methods/lora.py:299
↓ 1 callersMethodforward
( self, hidden_states: torch.Tensor, head_mask: Optional[torch.Tensor] = None,
src/adapters/models/beit/modeling_beit.py:197
↓ 1 callersMethodforward
(self, hidden_states: torch.Tensor, input_tensor: torch.Tensor)
src/adapters/models/roberta/modeling_roberta.py:283
↓ 1 callersMethodforward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor] = Non
src/adapters/models/albert/modeling_albert.py:177
↓ 1 callersMethodforward
( self, hidden_states: torch.Tensor, head_mask: Optional[torch.Tensor] = None,
src/adapters/models/vit/modeling_vit.py:116
↓ 1 callersMethodforward
(self, hidden_states: torch.Tensor, input_tensor: torch.Tensor)
src/adapters/models/bert/modeling_bert.py:274
↓ 1 callersMethodforward
( self, input_ids: torch.LongTensor = None, encoder_hidden_states: Optional[torch.FloatTensor] = None,
src/adapters/models/whisper/mixin_whisper.py:76
↓ 1 callersMethodforward
(self, hidden_states: torch.Tensor, input_tensor: torch.Tensor)
src/adapters/models/xlm_roberta/modeling_xlm_roberta.py:283
↓ 1 callersMethodforward
Parameters: x: torch.tensor(bs, seq_length, dim) attn_mask: torch.tensor(bs, seq_length) Returns:
src/adapters/models/distilbert/modeling_distilbert.py:282
↓ 1 callersMethodforward
( self, *args, input_ids: Optional[torch.LongTensor] = None, start_positions:
src/adapters/models/t5/mixin_t5.py:128
↓ 1 callersMethodforward_context
This method is called by the ``ForwardContext`` at the beginning of the forward pass.
src/adapters/model_mixin.py:1410
↓ 1 callersMethodfreeze_adapter
(self, adapter_name: str, freeze: bool = True)
src/adapters/methods/prefix_tuning.py:441
↓ 1 callersFunctiongenerate_dummy_data
Generates dummy data for text and vision transformers. Args: model (str, optional): The name of the transformer model. Defaults to an empt
utils/back_comp/Utils.py:350
↓ 1 callersFunctiongenerate_input
(_question, _context)
examples/pytorch/question-answering/run_seq2seq_qa.py:480
↓ 1 callersMethodgenerate_test_methods
Dynamically create test methods for each adapter config.
tests/test_methods/method_test_impl/composition/test_multi_task.py:273
↓ 1 callersMethodget_adapter_config
(self)
tests/test_misc/test_adapter_composition.py:43
↓ 1 callersMethodget_adapter_fusion
(self, adapter_names: Union[List, str])
src/adapters/methods/bottleneck.py:169
↓ 1 callersFunctionget_adapter_interface
(model_name)
src/adapters/wrappers/interfaces.py:133
↓ 1 callersMethodget_context_adapter_setup
(cls)
src/adapters/context.py:58
↓ 1 callersMethodget_dataset
(self, task_type: str = "seq2seq_lm", **kwargs)
tests/test_methods/base.py:228
↓ 1 callersMethodget_dataset_non_batched
(self, config)
tests/test_methods/base.py:142
↓ 1 callersMethodget_dataset_with_task_ids
(self, tasks)
tests/test_methods/method_test_impl/composition/test_multi_task.py:22
↓ 1 callersFunctionget_default
(num_label)
tests/test_misc/test_adapter_save_id2label.py:10
↓ 1 callersMethodget_encoder
(self)
src/adapters/models/t5/adapter_model.py:56
↓ 1 callersFunctionget_from_cache
Given a URL, look for the corresponding file in the local cache. If it's not there, download it. Then return the path to the cached file.
src/adapters/utils.py:242
↓ 1 callersMethodget_from_config
Get the adapter type from a given adapter config. Args: config: The adapter config. Returns: List[s
src/adapters/interface.py:33
↓ 1 callersMethodget_fusion_regularization_loss
(self)
src/adapters/model_mixin.py:1455
← previousnext →301–400 of 1,559, ranked by callers