Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/adapter-hub/adapters
/ functions
Functions
1,559 in github.com/adapter-hub/adapters
⨍
Functions
1,559
◇
Types & classes
451
↳
Endpoints
1
↓ 1 callers
Function
get_label_list
(labels)
examples/pytorch/token-classification/run_ner.py:333
↓ 1 callers
Method
get_label_names
(self)
src/adapters/heads/base.py:114
↓ 1 callers
Method
get_metric
(self)
examples/pytorch/dependency-parsing/utils_udp.py:157
↓ 1 callers
Function
get_module_name
(model_type: str)
src/adapters/wrappers/model.py:38
↓ 1 callers
Method
get_n_heads
(self, lora: Union[LoRA, IA3, LoRAConfig])
src/adapters/methods/lora.py:526
↓ 1 callers
Method
get_parameters
(self, parameters_names=None)
src/adapters/methods/lora.py:147
↓ 1 callers
Method
get_prediction_heads_config
(self)
src/adapters/heads/model_mixin.py:236
↓ 1 callers
Method
has
(cls, value)
src/adapters/utils.py:106
↓ 1 callers
Method
has_adapters
(self)
src/adapters/model_mixin.py:628
↓ 1 callers
Method
indicate_prefix
(self, prefix_name: str, location_key: str, **kwargs)
src/adapters/methods/prefix_tuning.py:178
↓ 1 callers
Method
init_adapters
(self, model_config, adapters_config)
src/adapters/methods/bottleneck.py:60
↓ 1 callers
Method
init_adapters
(self, model_config, adapters_config)
src/adapters/models/beit/mixin_beit.py:42
↓ 1 callers
Method
init_adapters
(self, model_config, adapters_config)
src/adapters/models/llama/mixin_llama.py:13
↓ 1 callers
Method
init_adapters
(self, model_config, adapters_config)
src/adapters/models/plbart/mixin_plbart.py:81
↓ 1 callers
Method
init_adapters
(self, model_config, adapters_config)
src/adapters/models/bart/mixin_bart.py:88
↓ 1 callers
Method
init_adapters
(self, model_config, adapters_config)
src/adapters/models/mistral/mixin_mistral.py:12
↓ 1 callers
Method
init_adapters
(self, model_config, adapters_config)
src/adapters/models/vit/mixin_vit.py:49
↓ 1 callers
Method
init_adapters
(self, model_config, adapters_config, **kwargs)
src/adapters/models/whisper/mixin_whisper.py:89
↓ 1 callers
Method
init_adapters
(self, model_config, adapters_config)
src/adapters/models/gptj/mixin_gptj.py:28
↓ 1 callers
Function
init_reft
(model)
src/adapters/methods/reft.py:239
↓ 1 callers
Function
init_shared_parameters
Create and initialize the parameters shared by all compacter modules
src/adapters/methods/modeling.py:760
↓ 1 callers
Function
init_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 callers
Method
init_submodels
(self)
src/adapters/models/encoder_decoder/mixin_encoder_decoder.py:59
↓ 1 callers
Function
is_link_in_dir
(info, base)
src/adapters/utils.py:419
↓ 1 callers
Method
iter_attentions
( self, )
src/adapters/model_mixin.py:2042
↓ 1 callers
Method
iter_layers
(self)
src/adapters/models/albert/mixin_albert.py:67
↓ 1 callers
Method
iter_layers
(self)
src/adapters/models/xmod/mixin_xmod.py:39
↓ 1 callers
Method
iter_layers
(self)
src/adapters/models/bert/mixin_bert.py:94
↓ 1 callers
Function
kronecker_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 callers
Method
load
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 callers
Method
load
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 callers
Method
load
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 callers
Method
load_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 callers
Method
log_e
(self, s)
src/adapters/methods/modeling.py:549
↓ 1 callers
Function
main
()
utils/convert_xmod_checkpoint.py:75
↓ 1 callers
Function
main
()
examples/pytorch/dependency-parsing/run_udp.py:87
↓ 1 callers
Function
main
()
examples/pytorch/text-generation/run_generation.py:285
↓ 1 callers
Method
mean
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 callers
Method
mean
(self, states: List[PrefixTuningState], weights: torch.Tensor)
src/adapters/methods/prefix_tuning.py:553
↓ 1 callers
Function
multisetattr
(o: object, name: str, value: object)
src/adapters/utils.py:189
↓ 1 callers
Function
parse_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 callers
Method
post_embedding_forward
(self, module, args, embedding_output)
src/adapters/models/mistral/mixin_mistral.py:43
↓ 1 callers
Method
post_embedding_forward
(self, embedding_output)
src/adapters/models/t5/mixin_t5.py:91
↓ 1 callers
Method
post_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 callers
Function
postprocess_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 callers
Function
postprocess_text
(preds, labels)
examples/pytorch/translation/run_translation.py:570
↓ 1 callers
Function
postprocess_text
(preds, labels)
examples/pytorch/summarization/run_summarization.py:638
↓ 1 callers
Method
pre_block
( self, adapter_setup: Union[AdapterCompositionBlock, str], state: BottleneckState,
src/adapters/methods/bottleneck.py:176
↓ 1 callers
Method
prepare_decoder_input_ids_from_labels
(self, labels: torch.Tensor)
src/adapters/models/t5/adapter_model.py:185
↓ 1 callers
Function
prepare_jit_inputs
(inputs, model, tokenizer)
examples/pytorch/text-generation/run_generation.py:220
↓ 1 callers
Function
preprocess_dataset
( dataset: datasets.DatasetDict, tokenizer: PreTrainedTokenizer, label_list: List[str], data_a
examples/pytorch/dependency-parsing/preprocessing.py:16
↓ 1 callers
Function
pull_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 callers
Method
rename_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 callers
Method
rename_func
(self, old_name, new_name)
src/adapters/loading.py:879
↓ 1 callers
Method
rename_state_dict
(self, state_dict, *rename_funcs)
src/adapters/loading.py:64
↓ 1 callers
Method
repeat
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 callers
Function
replace_with_adapter_class
(module: nn.Module, modules_with_adapters)
src/adapters/wrappers/model.py:57
↓ 1 callers
Method
reset_adapter
Resets weights of a LoRA module merged using `model.merge_adapter(name)`.
src/adapters/model_mixin.py:1846
↓ 1 callers
Method
reset_adapter
(self)
src/adapters/methods/lora.py:883
↓ 1 callers
Method
reset_parameters
(self)
src/adapters/methods/modeling.py:681
↓ 1 callers
Method
resize_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 callers
Function
restore_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 callers
Method
save
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 callers
Method
save
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 callers
Method
save_adapter
( self, save_directory: str, adapter_name: str, with_head: bool = True,
src/adapters/model_mixin.py:2336
↓ 1 callers
Method
save_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 callers
Method
save_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 callers
Function
save_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 callers
Method
set_default_language
(self, language: str)
src/adapters/models/xmod/mixin_xmod.py:55
↓ 1 callers
Method
set_input_embeddings
(self, value)
src/adapters/models/beit/mixin_beit.py:59
↓ 1 callers
Method
set_output_embeddings
(self, new_embeddings: Union[nn.Module, List[nn.Module]])
src/adapters/heads/model_mixin.py:156
↓ 1 callers
Method
set_parameters
(self, parameters)
src/adapters/methods/lora.py:157
↓ 1 callers
Method
set_shared_parameters
(self, param)
src/adapters/model_mixin.py:646
↓ 1 callers
Function
setup
(app)
docs/conf.py:105
↓ 1 callers
Function
sparse_model_config
(model_config)
examples/pytorch/text-generation/run_generation.py:162
↓ 1 callers
Method
store_best_model
(self, output)
examples/pytorch/dependency-parsing/utils_udp.py:281
↓ 1 callers
Method
tie_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 callers
Method
to_dict
(self)
src/adapters/configuration/model_adapters_config.py:220
↓ 1 callers
Method
to_dict
Converts the config class to a Python dict.
src/adapters/configuration/adapter_config.py:49
↓ 1 callers
Method
train_model
(self, model, dataset)
tests/test_methods/method_test_impl/composition/test_parallel.py:156
↓ 1 callers
Method
transform
(example_batch)
tests/test_methods/base.py:183
↓ 1 callers
Method
transpose_for_scores_extended
(self, x, attention_heads)
src/adapters/models/deberta_v2/modeling_deberta_v2.py:108
↓ 1 callers
Method
unpack
(*tensors: torch.Tensor)
examples/pytorch/dependency-parsing/utils_udp.py:106
↓ 1 callers
Function
url_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 callers
Method
validate
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 callers
Function
validate_composition
(adapter_composition: AdapterCompositionBlock, level=0, model_type=None)
src/adapters/composition.py:205
↓ 1 callers
Function
wrap_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
Method
T
(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
← previous
next →
401–500 of 1,559, ranked by callers