Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/XiangLi1999/PrefixTuning
/ functions
Functions
3,725 in github.com/XiangLi1999/PrefixTuning
⨍
Functions
3,725
◇
Types & classes
1,052
↳
Endpoints
47
↓ 4 callers
Method
rel_attn_core
Core relative positional attention operations.
transformers/src/transformers/modeling_xlnet.py:270
↓ 4 callers
Method
rel_attn_core
Core relative positional attention operations.
transformers/src/transformers/modeling_tf_xlnet.py:130
↓ 4 callers
Method
save_to_csv
(self, result_dict, filename)
transformers/src/transformers/benchmark/benchmark_utils.py:852
↓ 4 callers
Function
separate_process_wrapper_fn
This function wraps another function into its own separated process. In order to ensure accurate memory measurements it is important that t
transformers/src/transformers/benchmark/benchmark_utils.py:64
↓ 4 callers
Method
set_embed_tokens
(self, embed_tokens)
transformers/src/transformers/modeling_tf_t5.py:572
↓ 4 callers
Method
set_input_embeddings
(self, new_embeddings)
transformers/src/transformers/modeling_t5.py:665
↓ 4 callers
Function
set_verbosity
Set the vebosity level for the 🤗 Transformers's root logger. Args: verbosity (:obj:`int`): Logging level, e.g., one of:
transformers/src/transformers/utils/logging.py:139
↓ 4 callers
Function
shift_tokens_right
Shift input ids one token to the right, and wrap the last non pad token (usually <eos>).
transformers/src/transformers/modeling_bart.py:205
↓ 4 callers
Method
store_flos
(self)
transformers/src/transformers/trainer_prefix.py:2683
↓ 4 callers
Method
tokenize
Basic Tokenization of a piece of text. Split on "white spaces" only, for sub-word tokenization, see WordPieceTokenizer. Args:
transformers/src/transformers/tokenization_bert.py:387
↓ 4 callers
Method
tokenize
Converts a string in a sequence of tokens, using the tokenizer. Split in words for word-based vocabulary or sub-words for sub-word-b
transformers/src/transformers/tokenization_utils.py:238
↓ 4 callers
Function
whitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
transformers/src/transformers/tokenization_bert.py:111
↓ 4 callers
Function
write_e2e_src
(prompt_lst, corr_path)
gpt2/run_generation.py:390
↓ 3 callers
Method
__call__
(self, *args, **kwargs)
transformers/src/transformers/pipelines.py:639
↓ 3 callers
Method
__init__
(self, config)
transformers/src/transformers/modeling_ctrl.py:322
↓ 3 callers
Method
__init__
(self, nf, nx, initializer_range=0.02, **kwargs)
transformers/src/transformers/modeling_tf_utils.py:690
↓ 3 callers
Method
__init__
(self, *args, **kwargs)
transformers/src/transformers/tokenization_transfo_xl.py:841
↓ 3 callers
Method
__init__
(self, config)
transformers/src/transformers/modeling_bert_generation.py:275
↓ 3 callers
Method
_create_examples
Creates examples for the training, dev and test sets.
transformers/src/transformers/data/processors/glue.py:191
↓ 3 callers
Method
_create_examples
Creates examples for the training, dev and test sets.
transformers/src/transformers/data/processors/glue.py:233
↓ 3 callers
Method
_create_examples
Creates examples for the training, dev and test sets.
transformers/src/transformers/data/processors/glue.py:287
↓ 3 callers
Method
_create_examples
Creates examples for the training, dev and test sets.
transformers/src/transformers/data/processors/glue.py:330
↓ 3 callers
Method
_create_examples
Creates examples for the training, dev and test sets.
transformers/src/transformers/data/processors/glue.py:372
↓ 3 callers
Method
_create_examples
Creates examples for the training, dev and test sets.
transformers/src/transformers/data/processors/glue.py:462
↓ 3 callers
Method
_create_examples
Creates examples for the training, dev and test sets.
transformers/src/transformers/data/processors/glue.py:504
↓ 3 callers
Method
_create_examples
Creates examples for the training, dev and test sets.
transformers/src/transformers/data/processors/glue.py:546
↓ 3 callers
Method
_force_token_ids_generation
force one of token_ids to be generated by setting prob of all other tokens to 0 (logprob=-float("inf"))
transformers/src/transformers/modeling_bart.py:1520
↓ 3 callers
Method
_get_resized_embeddings
Build a resized Embedding Module from a provided token Embedding Module. Increasing the size will add newly initialized vectors at th
transformers/src/transformers/modeling_utils.py:604
↓ 3 callers
Method
_hash_vectors
(self, vectors, num_hashes, attention_mask, increase_num_buckets=False)
transformers/src/transformers/modeling_reformer.py:609
↓ 3 callers
Method
_hp_search_setup
HP search setup code
transformers/src/transformers/trainer_prefix.py:725
↓ 3 callers
Method
_init_weights
(self, module)
transformers/src/transformers/modeling_bart.py:168
↓ 3 callers
Function
_is_control
Checks whether `char` is a control character.
transformers/src/transformers/tokenization_utils.py:61
↓ 3 callers
Function
_is_punctuation
Checks whether `char` is a punctuation character.
transformers/src/transformers/tokenization_utils.py:73
↓ 3 callers
Function
_is_whitespace
Checks whether `char` is a whitespace character.
transformers/src/transformers/tokenization_utils.py:49
↓ 3 callers
Method
_logit
(x, W, b, proj=None)
transformers/src/transformers/modeling_tf_transfo_xl_utilities.py:110
↓ 3 callers
Function
_make_linear_from_emb
(emb)
transformers/src/transformers/modeling_bart.py:192
↓ 3 callers
Method
_resolve_path
(self, index_path, filename)
transformers/src/transformers/retrieval_rag.py:112
↓ 3 callers
Method
_shape
(self, tensor, seq_len, bsz)
transformers/src/transformers/modeling_bart.py:736
↓ 3 callers
Method
_shape
(self, tensor, seq_len, bsz)
transformers/src/transformers/modeling_fsmt.py:748
↓ 3 callers
Method
_shift_right
(self, input_ids)
transformers/src/transformers/modeling_t5.py:622
↓ 3 callers
Method
_special_token_mask
(self, seq)
transformers/src/transformers/tokenization_pegasus.py:69
↓ 3 callers
Method
_special_token_mask
(self, seq)
transformers/src/transformers/tokenization_marian.py:200
↓ 3 callers
Method
_tensorize_batch
( self, examples: List[Union[List[int], torch.Tensor, Dict[str, torch.Tensor]]] )
transformers/src/transformers/data/data_collator.py:702
↓ 3 callers
Method
_tensorize_batch
( self, examples: List[Union[List[int], torch.Tensor, Dict[str, torch.Tensor]]] )
transformers/src/transformers/data/data_collator.py:908
↓ 3 callers
Method
_tensorize_batch
( self, examples: List[Union[List[int], torch.Tensor, Dict[str, torch.Tensor]]] )
transformers/src/transformers/data/data_collator.py:1125
↓ 3 callers
Method
add_special_tokens
Add a dictionary of special tokens (eos, pad, cls, etc.) to the encoder and link them to class attributes. If special tokens are NOT
transformers/src/transformers/tokenization_utils_base.py:673
↓ 3 callers
Method
batch_encode_plus
Tokenize and prepare for the model a list of sequences or a list of pairs of sequences. .. warning:: This method is depr
transformers/src/transformers/tokenization_utils_base.py:2077
↓ 3 callers
Method
build
(self, input_shape)
transformers/src/transformers/modeling_tf_transfo_xl.py:825
↓ 3 callers
Method
build_vocab
(self)
transformers/src/transformers/tokenization_transfo_xl.py:292
↓ 3 callers
Function
bytes_to_mega_bytes
Utility to convert a number of bytes (int) into a number of mega bytes (int)
transformers/src/transformers/benchmark/benchmark_utils.py:563
↓ 3 callers
Function
check_equal
(marian_cfg, k1, k2)
transformers/src/transformers/convert_marian_to_pytorch.py:505
↓ 3 callers
Method
compute_loss_REINFORCE
How the loss is computed by Trainer. By default, all models return the loss in the first element. Subclass and override for custom b
transformers/src/transformers/trainer_prefix.py:2221
↓ 3 callers
Function
convert
(source_dir: Path, dest_dir)
transformers/src/transformers/convert_marian_to_pytorch.py:695
↓ 3 callers
Method
convert_tokens_to_string
Converts a sequence of tokens (string) in a single string.
transformers/src/transformers/tokenization_t5.py:260
↓ 3 callers
Method
create_optimizer_and_scheduler
Setup the optimizer and the learning rate scheduler. We provide a reasonable default that works well. If you want to use something e
transformers/src/transformers/trainer_prefix.py:549
↓ 3 callers
Function
default_hp_search_backend
()
transformers/src/transformers/integrations.py:83
↓ 3 callers
Method
device
The device used by this process.
transformers/src/transformers/training_args.py:366
↓ 3 callers
Method
encode_plus
Tokenize and prepare for the model a sequence or a pair of sequences. .. warning:: This method is deprecated, ``__call__
transformers/src/transformers/tokenization_utils_base.py:1984
↓ 3 callers
Method
floating_point_ops
For models that inherit from :class:`~transformers.PretrainedModel`, uses that method to compute the number of floating point operati
transformers/src/transformers/trainer_prefix.py:2966
↓ 3 callers
Method
from_dict
Constructs a `ModelCard` from a Python dictionary of parameters.
transformers/src/transformers/modelcard.py:185
↓ 3 callers
Method
get_dataloader
(self, type_path: str, batch_size: int, shuffle: bool = False)
seq2seq/finetune.py:292
↓ 3 callers
Method
get_dataloader
(self, type_path: str, batch_size: int, shuffle: bool = False)
seq2seq/finetune.py:609
↓ 3 callers
Method
get_dataloader
(self, type_path, batch_size, shuffle=False)
seq2seq/lightning_base.py:256
↓ 3 callers
Method
get_dataloader
(self, type_path, batch_size, shuffle=False)
seq2seq/lightning_base.py:557
↓ 3 callers
Function
get_dataset
( args: DataTrainingArguments, tokenizer: PreTrainedTokenizer, evaluate: bool = False, cache_d
gpt2/run_language_modeling.py:383
↓ 3 callers
Function
get_git_info
()
seq2seq/utils.py:371
↓ 3 callers
Method
get_input_embeddings
Returns the model's input embeddings. Returns: :obj:`nn.Module`: A torch module mapping vocabulary to hidden states.
transformers/src/transformers/modeling_utils.py:431
↓ 3 callers
Function
get_linear_schedule_with_warmup
Create a schedule with a learning rate that decreases linearly from the initial lr set in the optimizer to 0, after a warmup period during wh
transformers/src/transformers/optimization.py:71
↓ 3 callers
Method
get_qa_logit_layer
Returns the the linear layer that produces question answering logits. Returns: :obj:`nn.Module`: A torch module mapping
transformers/src/transformers/modeling_lxmert.py:1113
↓ 3 callers
Method
get_qa_logit_layer
Returns the the linear layer that produces question answering logits Returns: :obj:`nn.Module`: A torch module mapping t
transformers/src/transformers/modeling_lxmert.py:1336
↓ 3 callers
Function
grad_status
(model: nn.Module)
seq2seq/utils.py:406
↓ 3 callers
Method
gradients
The accumulated gradients on the current replica.
transformers/src/transformers/optimization_tf.py:309
↓ 3 callers
Function
invert_mask
Turns 1->0, 0->1, False->True, True-> False
transformers/src/transformers/modeling_fsmt.py:276
↓ 3 callers
Method
is_local_process_zero
Whether or not this process is the local (e.g., on one machine if training in a distributed fashion on several machines) main process
transformers/src/transformers/trainer.py:1176
↓ 3 callers
Method
is_local_process_zero
Whether or not this process is the local (e.g., on one machine if training in a distributed fashion on several machines) main process
gpt2/trainer_prefix.py:1272
↓ 3 callers
Function
list_field
(default=None, metadata=None)
transformers/src/transformers/benchmark/benchmark_args_utils.py:29
↓ 3 callers
Function
load_spm
(path: str)
transformers/src/transformers/tokenization_marian.py:217
↓ 3 callers
Function
load_states_from_checkpoint
(model_file: str)
transformers/src/transformers/convert_dpr_original_checkpoint_to_pytorch.py:16
↓ 3 callers
Method
log
Log :obj:`logs` on the various objects watching training. Subclass and override this method to inject custom behavior. Args
transformers/src/transformers/trainer_tf.py:379
↓ 3 callers
Function
make_eval_dict
(exact_scores, f1_scores, qid_list=None)
transformers/src/transformers/data/metrics/squad_metrics.py:108
↓ 3 callers
Method
make_sortish_sampler
(self, batch_size, distributed=False, shuffle=True, **kwargs)
seq2seq/utils.py:138
↓ 3 callers
Method
mask_tokens
Prepare masked tokens inputs/labels/attention_mask for masked language modeling: 80% MASK, 10% random, 10% original. N-gram not appli
transformers/src/transformers/data/data_collator.py:1206
↓ 3 callers
Method
num_parameters
Get number of (optionally, trainable or non-embeddings) parameters in the module. Args: only_trainable (:obj:`bool`, `op
transformers/src/transformers/modeling_utils.py:299
↓ 3 callers
Function
parse_flag_from_env
(key, default=False)
transformers/src/transformers/testing_utils.py:22
↓ 3 callers
Function
pickle_save
pickle.dump(obj, path)
seq2seq/utils.py:345
↓ 3 callers
Function
pipeline
Utility factory method to build a :class:`~transformers.Pipeline`. Pipelines are made of: - A :doc:`tokenizer <tokenizer>` in charg
transformers/src/transformers/pipelines.py:2600
↓ 3 callers
Method
post_attention
Post-attention processing.
transformers/src/transformers/modeling_xlnet.py:322
↓ 3 callers
Method
post_attention
Post-attention processing.
transformers/src/transformers/modeling_tf_xlnet.py:174
↓ 3 callers
Method
prune_heads
(self, heads)
transformers/src/transformers/modeling_gpt2.py:145
↓ 3 callers
Function
remove_ignore_keys_
(state_dict)
transformers/src/transformers/convert_bart_original_pytorch_checkpoint_to_pytorch.py:56
↓ 3 callers
Method
reshape_and_transpose
(self, vector, batch_size)
transformers/src/transformers/modeling_tf_longformer.py:1091
↓ 3 callers
Function
save_json
(content: Union[Dict, List], path: str)
transformers/src/transformers/convert_marian_to_pytorch.py:723
↓ 3 callers
Function
save_json
(content, path, indent=4, **json_dump_kwargs)
seq2seq/utils.py:361
↓ 3 callers
Method
save_model
Will save the model, so you can reload it using :obj:`from_pretrained()`. Will only save from the world_master process (unless in TP
gpt2/trainer_prefix.py:1304
↓ 3 callers
Method
set_epoch
(self, epoch)
seq2seq/utils.py:322
↓ 3 callers
Method
set_src_lang_special_tokens
Reset the special tokens to the source lang setting. No prefix and suffix=[eos, cur_lang_code].
transformers/src/transformers/tokenization_mbart.py:206
↓ 3 callers
Method
split_heads
(self, x)
transformers/src/transformers/modeling_tf_openai.py:128
↓ 3 callers
Method
split_heads
(self, x)
transformers/src/transformers/modeling_tf_gpt2.py:130
↓ 3 callers
Method
split_heads
(self, x, k=False)
transformers/src/transformers/modeling_gpt2.py:202
↓ 3 callers
Method
split_heads
(self, x, k=False)
transformers/src/transformers/modeling_gpt2_adapter.py:194
← previous
next →
201–300 of 3,725, ranked by callers