MCPcopy Create free account

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

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

↓ 1 callersFunctionget_label_list
(labels)
examples/pytorch/token-classification/run_ner.py:333
↓ 1 callersMethodget_label_names
(self)
src/adapters/heads/base.py:114
↓ 1 callersMethodget_metric
(self)
examples/pytorch/dependency-parsing/utils_udp.py:157
↓ 1 callersFunctionget_module_name
(model_type: str)
src/adapters/wrappers/model.py:38
↓ 1 callersMethodget_n_heads
(self, lora: Union[LoRA, IA3, LoRAConfig])
src/adapters/methods/lora.py:526
↓ 1 callersMethodget_parameters
(self, parameters_names=None)
src/adapters/methods/lora.py:147
↓ 1 callersMethodget_prediction_heads_config
(self)
src/adapters/heads/model_mixin.py:236
↓ 1 callersMethodhas
(cls, value)
src/adapters/utils.py:106
↓ 1 callersMethodhas_adapters
(self)
src/adapters/model_mixin.py:628
↓ 1 callersMethodindicate_prefix
(self, prefix_name: str, location_key: str, **kwargs)
src/adapters/methods/prefix_tuning.py:178
↓ 1 callersMethodinit_adapters
(self, model_config, adapters_config)
src/adapters/methods/bottleneck.py:60
↓ 1 callersMethodinit_adapters
(self, model_config, adapters_config)
src/adapters/models/beit/mixin_beit.py:42
↓ 1 callersMethodinit_adapters
(self, model_config, adapters_config)
src/adapters/models/llama/mixin_llama.py:13
↓ 1 callersMethodinit_adapters
(self, model_config, adapters_config)
src/adapters/models/plbart/mixin_plbart.py:81
↓ 1 callersMethodinit_adapters
(self, model_config, adapters_config)
src/adapters/models/bart/mixin_bart.py:88
↓ 1 callersMethodinit_adapters
(self, model_config, adapters_config)
src/adapters/models/mistral/mixin_mistral.py:12
↓ 1 callersMethodinit_adapters
(self, model_config, adapters_config)
src/adapters/models/vit/mixin_vit.py:49
↓ 1 callersMethodinit_adapters
(self, model_config, adapters_config, **kwargs)
src/adapters/models/whisper/mixin_whisper.py:89
↓ 1 callersMethodinit_adapters
(self, model_config, adapters_config)
src/adapters/models/gptj/mixin_gptj.py:28
↓ 1 callersFunctioninit_reft
(model)
src/adapters/methods/reft.py:239
↓ 1 callersFunctioninit_shared_parameters
Create and initialize the parameters shared by all compacter modules
src/adapters/methods/modeling.py:760
↓ 1 callersFunctioninit_shared_vera_parameters
This function creates the shared random matrices A and B that are used across all Vera layers. These matrices are frozen and initialized acco
src/adapters/methods/lora.py:409
↓ 1 callersMethodinit_submodels
(self)
src/adapters/models/encoder_decoder/mixin_encoder_decoder.py:59
↓ 1 callersFunctionis_link_in_dir
(info, base)
src/adapters/utils.py:419
↓ 1 callersMethoditer_attentions
( self, )
src/adapters/model_mixin.py:2042
↓ 1 callersMethoditer_layers
(self)
src/adapters/models/albert/mixin_albert.py:67
↓ 1 callersMethoditer_layers
(self)
src/adapters/models/xmod/mixin_xmod.py:39
↓ 1 callersMethoditer_layers
(self)
src/adapters/models/bert/mixin_bert.py:94
↓ 1 callersFunctionkronecker_product
Copied from rabeehk/compacter seq2seq/hypercomplex/kronecker.py Kronecker product of matrices a and b with leading batch dimensions. Batch d
src/adapters/methods/modeling.py:587
↓ 1 callersMethodload
Loads a pre-trained pytorch adapter module from the local file system or a remote location. Args: adapter_name_or_path (
src/adapters/loading.py:567
↓ 1 callersMethodload
Loads a AdapterFusion module from the given directory. Args: save_directory (str): The directory from where to load the
src/adapters/loading.py:780
↓ 1 callersMethodload
Loads a prediction head module from the given directory. Args: save_directory (str): The directory from where to load th
src/adapters/loading.py:936
↓ 1 callersMethodload_adapter_setup
Loads an adapter setup from the local file system or a remote location. Args: adapter_setup_name_or_path (str): can be either:
src/adapters/model_mixin.py:1294
↓ 1 callersMethodlog_e
(self, s)
src/adapters/methods/modeling.py:549
↓ 1 callersFunctionmain
()
utils/convert_xmod_checkpoint.py:75
↓ 1 callersFunctionmain
()
examples/pytorch/dependency-parsing/run_udp.py:87
↓ 1 callersFunctionmain
()
examples/pytorch/text-generation/run_generation.py:285
↓ 1 callersMethodmean
Averages the given states along the batch size dimension by the given weights. This is e.g. used by the Average composition block. IMPORTANT:
src/adapters/methods/adapter_layer_base.py:325
↓ 1 callersMethodmean
(self, states: List[PrefixTuningState], weights: torch.Tensor)
src/adapters/methods/prefix_tuning.py:553
↓ 1 callersFunctionmultisetattr
(o: object, name: str, value: object)
src/adapters/utils.py:189
↓ 1 callersFunctionparse_adapter_config_string
Parses an adapter configuration string into a list of tuples. Each tuple constists of an adapter config identifier and dictionary.
src/adapters/utils.py:518
↓ 1 callersMethodpost_embedding_forward
(self, module, args, embedding_output)
src/adapters/models/mistral/mixin_mistral.py:43
↓ 1 callersMethodpost_embedding_forward
(self, embedding_output)
src/adapters/models/t5/mixin_t5.py:91
↓ 1 callersMethodpost_forward
Performs computations after the forward pass of the adapter block(s). This e.g. includes applying the residual connection and layer n
src/adapters/methods/modeling.py:241
↓ 1 callersFunctionpostprocess_qa_predictions
Post-processes the predictions of a question-answering model to convert them to answers that are substrings of the original contexts. This is
examples/pytorch/question-answering/utils_qa.py:31
↓ 1 callersFunctionpostprocess_text
(preds, labels)
examples/pytorch/translation/run_translation.py:570
↓ 1 callersFunctionpostprocess_text
(preds, labels)
examples/pytorch/summarization/run_summarization.py:638
↓ 1 callersMethodpre_block
( self, adapter_setup: Union[AdapterCompositionBlock, str], state: BottleneckState,
src/adapters/methods/bottleneck.py:176
↓ 1 callersMethodprepare_decoder_input_ids_from_labels
(self, labels: torch.Tensor)
src/adapters/models/t5/adapter_model.py:185
↓ 1 callersFunctionprepare_jit_inputs
(inputs, model, tokenizer)
examples/pytorch/text-generation/run_generation.py:220
↓ 1 callersFunctionpreprocess_dataset
( dataset: datasets.DatasetDict, tokenizer: PreTrainedTokenizer, label_list: List[str], data_a
examples/pytorch/dependency-parsing/preprocessing.py:16
↓ 1 callersFunctionpull_from_hub
Redirects loading from the archived Hub repository to HuggingFace Model Hub. Args: specifier (str): A string specifying the adapter
src/adapters/utils.py:689
↓ 1 callersMethodrename_func
The callable returned by this method is used to optionally rename the module weights after loading. Args: old_name (str)
src/adapters/loading.py:282
↓ 1 callersMethodrename_func
(self, old_name, new_name)
src/adapters/loading.py:879
↓ 1 callersMethodrename_state_dict
(self, state_dict, *rename_funcs)
src/adapters/loading.py:64
↓ 1 callersMethodrepeat
Repeats the given state along the batch size dimension for the given number of times. This is e.g. used by the Parallel composition block. IMP
src/adapters/methods/adapter_layer_base.py:311
↓ 1 callersFunctionreplace_with_adapter_class
(module: nn.Module, modules_with_adapters)
src/adapters/wrappers/model.py:57
↓ 1 callersMethodreset_adapter
Resets weights of a LoRA module merged using `model.merge_adapter(name)`.
src/adapters/model_mixin.py:1846
↓ 1 callersMethodreset_adapter
(self)
src/adapters/methods/lora.py:883
↓ 1 callersMethodreset_parameters
(self)
src/adapters/methods/modeling.py:681
↓ 1 callersMethodresize_position_embeddings
Resizes position embeddings of the model if :obj:`new_num_position_embeddings != config.max_position_embeddings`. Arguments:
src/adapters/models/distilbert/adapter_model.py:46
↓ 1 callersFunctionrestore_from_jsonl
Restores the model output from a JSON Lines (.jsonl) file as a list of lists for the specified model. Args: config (str): Name of the adap
utils/back_comp/Utils.py:492
↓ 1 callersMethodsave
Saves an adapter and its configuration file to a directory, so that it can be reloaded using the `load()` method. Args:
src/adapters/loading.py:497
↓ 1 callersMethodsave
Saves a AdapterFusion module into the given directory. Args: save_directory (str): The directory to save the weights in.
src/adapters/loading.py:712
↓ 1 callersMethodsave_adapter
( self, save_directory: str, adapter_name: str, with_head: bool = True,
src/adapters/model_mixin.py:2336
↓ 1 callersMethodsave_all_adapter_fusions
Saves all AdapterFusion layers of this model together with their configuration to subfolders of the given location. Args:
src/adapters/model_mixin.py:1371
↓ 1 callersMethodsave_all_heads
Saves all prediction heads of this model to subfolders of the given location. Args: save_directory (str): Path to the base direct
src/adapters/model_mixin.py:2618
↓ 1 callersFunctionsave_to_jsonl
Save model output to a JSON Lines (.jsonl) file as a dictionary. Each line represents one model, where the key is the model name (specified by adapter
utils/back_comp/Utils.py:439
↓ 1 callersMethodset_default_language
(self, language: str)
src/adapters/models/xmod/mixin_xmod.py:55
↓ 1 callersMethodset_input_embeddings
(self, value)
src/adapters/models/beit/mixin_beit.py:59
↓ 1 callersMethodset_output_embeddings
(self, new_embeddings: Union[nn.Module, List[nn.Module]])
src/adapters/heads/model_mixin.py:156
↓ 1 callersMethodset_parameters
(self, parameters)
src/adapters/methods/lora.py:157
↓ 1 callersMethodset_shared_parameters
(self, param)
src/adapters/model_mixin.py:646
↓ 1 callersFunctionsetup
(app)
docs/conf.py:105
↓ 1 callersFunctionsparse_model_config
(model_config)
examples/pytorch/text-generation/run_generation.py:162
↓ 1 callersMethodstore_best_model
(self, output)
examples/pytorch/dependency-parsing/utils_udp.py:281
↓ 1 callersMethodtie_weights
Tie the weights between the input embeddings and the output embeddings. If the :obj:`torchscript` flag is set in the configuration,
src/adapters/heads/model_mixin.py:167
↓ 1 callersMethodto_dict
(self)
src/adapters/configuration/model_adapters_config.py:220
↓ 1 callersMethodto_dict
Converts the config class to a Python dict.
src/adapters/configuration/adapter_config.py:49
↓ 1 callersMethodtrain_model
(self, model, dataset)
tests/test_methods/method_test_impl/composition/test_parallel.py:156
↓ 1 callersMethodtransform
(example_batch)
tests/test_methods/base.py:183
↓ 1 callersMethodtranspose_for_scores_extended
(self, x, attention_heads)
src/adapters/models/deberta_v2/modeling_deberta_v2.py:108
↓ 1 callersMethodunpack
(*tensors: torch.Tensor)
examples/pytorch/dependency-parsing/utils_udp.py:106
↓ 1 callersFunctionurl_to_filename
Generate a local filename from a url. Convert `url` into a hashed filename in a reproducible way. If `etag` is specified, append its hash to
src/adapters/utils.py:209
↓ 1 callersMethodvalidate
Performs simple validations of a list of configurations to check whether they can be combined to a common setup. Args:
src/adapters/configuration/adapter_config.py:782
↓ 1 callersFunctionvalidate_composition
(adapter_composition: AdapterCompositionBlock, level=0, model_type=None)
src/adapters/composition.py:205
↓ 1 callersFunctionwrap_config
Makes required changes to a model config class to allow usage with adapters. Args: config (PretrainedConfig): The config to be wrapp
src/adapters/wrappers/configuration.py:107
MethodT
(w)
src/adapters/methods/lora.py:1196
Method__call__
(self, *args, **kwargs)
examples/pytorch/text-generation/run_generation.py:245
Method__call__
(self, features)
examples/pytorch/multiple-choice/run_swag.py:202
Method__contains__
(self, item)
src/adapters/configuration/model_adapters_config.py:38
Method__delattr__
(self, name)
src/adapters/configuration/adapter_config.py:34
Method__enter__
(self)
src/adapters/context.py:35
Method__enter__
(self)
src/adapters/context.py:103
Method__eq__
(self, o: object)
src/adapters/composition.py:20
Method__eq__
(self, other)
src/adapters/configuration/model_adapters_config.py:239
Method__eq__
(self, other)
src/adapters/configuration/adapter_config.py:46
Method__eq__
(self, other)
src/adapters/configuration/adapter_config.py:833
Method__exit__
(self, type, value, traceback)
src/adapters/context.py:40
Method__exit__
(self, type, value, traceback)
src/adapters/context.py:107
← previousnext →401–500 of 1,559, ranked by callers