Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/XiangLi1999/PrefixTuning
/ types & classes
Types & classes
1,052 in github.com/XiangLi1999/PrefixTuning
⨍
Functions
3,725
◇
Types & classes
1,052
↳
Endpoints
47
↓ 21 callers
Class
BaseModelOutput
Base class for model's outputs, with potential hidden states and attentions. Args: last_hidden_state (:obj:`torch.FloatTensor` o
transformers/src/transformers/modeling_outputs.py:10
↓ 21 callers
Class
InputExample
A single training/test example for simple sequence classification. Args: guid: Unique id for the example. text_a: string. Th
transformers/src/transformers/data/processors/utils.py:31
↓ 17 callers
Class
Conv1D
1D-convolutional layer as defined by Radford et al. for OpenAI GPT (and also used in GPT-2). Basically works like a linear layer but the wei
transformers/src/transformers/modeling_utils.py:1073
↓ 14 callers
Class
Memory
`Memory` NamedTuple have a single field `bytes` and you can get a human readable str of the number of mega bytes by calling `__repr__` -
transformers/src/transformers/benchmark/benchmark_utils.py:137
↓ 13 callers
Class
TFBaseModelOutput
Base class for model's outputs, with potential hidden states and attentions. Args: last_hidden_state (:obj:`tf.Tensor` of shape
transformers/src/transformers/modeling_tf_outputs.py:10
↓ 12 callers
Class
BertModel
The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of cross-attention is added betwee
transformers/src/transformers/modeling_bert.py:712
↓ 11 callers
Class
MaskedLMOutput
Base class for masked language models outputs. Args: loss (:obj:`torch.FloatTensor` of shape :obj:`(1,)`, `optional`, returned w
transformers/src/transformers/modeling_outputs.py:221
↓ 11 callers
Class
SequenceClassifierOutput
Base class for outputs of sentence classification models. Args: loss (:obj:`torch.FloatTensor` of shape :obj:`(1,)`, `optional`,
transformers/src/transformers/modeling_outputs.py:331
↓ 10 callers
Class
QuestionAnsweringModelOutput
Base class for outputs of question answering models. Args: loss (:obj:`torch.FloatTensor` of shape :obj:`(1,)`, `optional`, retu
transformers/src/transformers/modeling_outputs.py:472
↓ 10 callers
Class
TokenClassifierOutput
Base class for outputs of token classification models. Args: loss (:obj:`torch.FloatTensor` of shape :obj:`(1,)`, `optional`, re
transformers/src/transformers/modeling_outputs.py:443
↓ 9 callers
Class
BatchEncoding
Holds the output of the :meth:`~transformers.tokenization_utils_base.PreTrainedTokenizerBase.encode_plus` and :meth:`~transformers.tokenizati
transformers/src/transformers/tokenization_utils_base.py:148
↓ 9 callers
Class
MultipleChoiceModelOutput
Base class for outputs of multiple choice models. Args: loss (:obj:`torch.FloatTensor` of shape `(1,)`, `optional`, returned whe
transformers/src/transformers/modeling_outputs.py:412
↓ 9 callers
Class
TFBertMainLayer
transformers/src/transformers/modeling_tf_bert.py:508
↓ 9 callers
Class
TFQuestionAnsweringModelOutput
Base class for outputs of question answering models. Args: loss (:obj:`tf.Tensor` of shape :obj:`(1,)`, `optional`, returned whe
transformers/src/transformers/modeling_tf_outputs.py:473
↓ 9 callers
Class
TFSharedEmbeddings
r""" Construct shared token embeddings. The weights of the embedding layer is usually shared with the weights of the linear decoder when doin
transformers/src/transformers/modeling_tf_utils.py:713
↓ 8 callers
Class
BaseModelOutputWithPooling
Base class for model's outputs that also contains a pooling of the last hidden states. Args: last_hidden_state (:obj:`torch.Floa
transformers/src/transformers/modeling_outputs.py:36
↓ 8 callers
Class
SequenceSummary
r""" Compute a single vector summary of a sequence hidden states. Args: config (:class:`~transformers.PretrainedConfig`):
transformers/src/transformers/modeling_utils.py:1413
↓ 8 callers
Class
TFConv1D
1D-convolutional layer as defined by Radford et al. for OpenAI GPT (and also used in GPT-2). Basically works like a linear layer but the wei
transformers/src/transformers/modeling_tf_utils.py:673
↓ 8 callers
Class
TFMaskedLMOutput
Base class for masked language models outputs. Args: loss (:obj:`tf.Tensor` of shape :obj:`(1,)`, `optional`, returned when :obj
transformers/src/transformers/modeling_tf_outputs.py:225
↓ 8 callers
Class
TFMobileBertMainLayer
transformers/src/transformers/modeling_tf_mobilebert.py:679
↓ 8 callers
Class
TFMultipleChoiceModelOutput
Base class for outputs of multiple choice models. Args: loss (:obj:`tf.Tensor` of shape `(1,)`, `optional`, returned when :obj:`
transformers/src/transformers/modeling_tf_outputs.py:413
↓ 8 callers
Class
TFSequenceClassifierOutput
Base class for outputs of sentence classification models. Args: loss (:obj:`tf.Tensor` of shape :obj:`(1,)`, `optional`, returne
transformers/src/transformers/modeling_tf_outputs.py:332
↓ 8 callers
Class
TFTokenClassifierOutput
Base class for outputs of token classification models. Args: loss (:obj:`tf.Tensor` of shape :obj:`(1,)`, `optional`, returned w
transformers/src/transformers/modeling_tf_outputs.py:444
↓ 7 callers
Class
BaseModelOutputWithPast
Base class for model's outputs that may also contain a past key/values (to speed up sequential decoding). Args: last_hidden_stat
transformers/src/transformers/modeling_outputs.py:68
↓ 7 callers
Class
MobileBertModel
https://arxiv.org/pdf/2004.02984.pdf
transformers/src/transformers/modeling_mobilebert.py:812
↓ 7 callers
Class
TFAlbertMainLayer
transformers/src/transformers/modeling_tf_albert.py:466
↓ 7 callers
Class
TFElectraMainLayer
transformers/src/transformers/modeling_tf_electra.py:450
↓ 7 callers
Class
TFSequenceSummary
Compute a single vector summary of a sequence hidden states. Args: config (:class:`~transformers.PretrainedConfig`): The
transformers/src/transformers/modeling_tf_utils.py:812
↓ 6 callers
Class
AlbertModel
transformers/src/transformers/modeling_albert.py:584
↓ 6 callers
Class
ElectraModel
transformers/src/transformers/modeling_electra.py:670
↓ 6 callers
Class
FlaubertModel
transformers/src/transformers/modeling_flaubert.py:135
↓ 6 callers
Class
RobertaModel
The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of cross-attention is added betwee
transformers/src/transformers/modeling_roberta.py:551
↓ 6 callers
Class
TFDistilBertMainLayer
transformers/src/transformers/modeling_tf_distilbert.py:395
↓ 6 callers
Class
TFFlaubertMainLayer
transformers/src/transformers/modeling_tf_flaubert.py:346
↓ 6 callers
Class
TFRobertaMainLayer
transformers/src/transformers/modeling_tf_roberta.py:452
↓ 6 callers
Class
TFXLMMainLayer
transformers/src/transformers/modeling_tf_xlm.py:228
↓ 6 callers
Class
TFXLNetMainLayer
transformers/src/transformers/modeling_tf_xlnet.py:417
↓ 6 callers
Class
XLMModel
transformers/src/transformers/modeling_xlm.py:402
↓ 6 callers
Class
XLNetModel
transformers/src/transformers/modeling_xlnet.py:935
↓ 5 callers
Class
AdamW
Implements Adam algorithm with weight decay fix as introduced in `Decoupled Weight Decay Regularization <https://arxiv.org/abs/1711.05101>`__
transformers/src/transformers/optimization.py:219
↓ 5 callers
Class
BasicTokenizer
Constructs a BasicTokenizer that will run basic tokenization (punctuation splitting, lower casing, etc.). Args: do_lower_case (:obj:
transformers/src/transformers/tokenization_bert.py:359
↓ 5 callers
Class
CausalLMOutputWithPast
Base class for causal language model (or autoregressive) outputs. Args: loss (:obj:`torch.FloatTensor` of shape :obj:`(1,)`, `op
transformers/src/transformers/modeling_outputs.py:185
↓ 5 callers
Class
DistilBertModel
transformers/src/transformers/modeling_distilbert.py:433
↓ 5 callers
Class
LongformerModel
This class copied code from :class:`~transformers.RobertaModel` and overwrote standard self-attention with longformer self-attention to provi
transformers/src/transformers/modeling_longformer.py:1067
↓ 5 callers
Class
TFBaseModelOutputWithPooling
Base class for model's outputs that also contains a pooling of the last hidden states. Args: last_hidden_state (:obj:`tf.Tensor`
transformers/src/transformers/modeling_tf_outputs.py:36
↓ 5 callers
Class
TFFunnelMainLayer
Base model with decoder
transformers/src/transformers/modeling_tf_funnel.py:843
↓ 5 callers
Class
TrainOutput
transformers/src/transformers/trainer_utils.py:59
↓ 4 callers
Class
BartModel
transformers/src/transformers/modeling_bart.py:1201
↓ 4 callers
Class
CausalLMOutput
Base class for causal language model (or autoregressive) outputs. Args: loss (:obj:`torch.FloatTensor` of shape :obj:`(1,)`, `op
transformers/src/transformers/modeling_outputs.py:156
↓ 4 callers
Class
EvalPrediction
Evaluation output (always contains labels), to be used to compute metrics. Parameters: predictions (:obj:`np.ndarray`): Predictions
transformers/src/transformers/trainer_utils.py:40
↓ 4 callers
Class
FunnelModel
transformers/src/transformers/modeling_funnel.py:967
↓ 4 callers
Class
Identity
r"""A placeholder identity operator that is argument-insensitive.
transformers/src/transformers/modeling_utils.py:53
↓ 4 callers
Class
PredictionOutput
transformers/src/transformers/trainer_utils.py:53
↓ 4 callers
Class
ReformerModel
transformers/src/transformers/modeling_reformer.py:1979
↓ 4 callers
Class
Seq2SeqLMOutput
Base class for sequence-to-sequence language models outputs. Args: loss (:obj:`torch.FloatTensor` of shape :obj:`(1,)`, `optiona
transformers/src/transformers/modeling_outputs.py:250
↓ 4 callers
Class
SquadExample
A single training/test example for the Squad dataset, as loaded from disk. Args: qas_id: The example's unique identifier que
transformers/src/transformers/data/processors/squad.py:672
↓ 4 callers
Class
T5LayerNorm
transformers/src/transformers/modeling_t5.py:156
↓ 4 callers
Class
T5Stack
transformers/src/transformers/modeling_t5.py:644
↓ 4 callers
Class
TFT5LayerNorm
transformers/src/transformers/modeling_tf_t5.py:68
↓ 4 callers
Class
TFT5MainLayer
transformers/src/transformers/modeling_tf_t5.py:540
↓ 4 callers
Class
_NoLayerEmbedTokens
this class wraps a the TFSharedEmbeddingTokens layer into a python 'no-keras-layer' class to avoid problem with weight restoring. Also it mak
transformers/src/transformers/modeling_tf_t5.py:505
↓ 3 callers
Class
Adapter
transformers/src/transformers/modeling_gpt2_adapter.py:261
↓ 3 callers
Class
Attention
Multi-headed attention from 'Attention Is All You Need' paper
transformers/src/transformers/modeling_bart.py:702
↓ 3 callers
Class
Attention
Multi-headed attention from 'Attention Is All You Need' paper
transformers/src/transformers/modeling_fsmt.py:722
↓ 3 callers
Class
DPRConfig
r""" :class:`~transformers.DPRConfig` is the configuration class to store the configuration of a `DPRModel`. This is the configuration cl
transformers/src/transformers/configuration_dpr.py:30
↓ 3 callers
Class
DPREncoder
transformers/src/transformers/modeling_dpr.py:143
↓ 3 callers
Class
DataCollatorForKeywordLanguageModeling
Data collator used for language modeling. - collates batches of tensors, honoring their tokenizer's pad_token - preprocesses batches for
transformers/src/transformers/data/data_collator.py:1097
↓ 3 callers
Class
DataCollatorWithPadding
Data collator that will dynamically pad the inputs received. Args: tokenizer (:class:`~transformers.PreTrainedTokenizer` or :class:`
transformers/src/transformers/data/data_collator.py:71
↓ 3 callers
Class
GPT2Model
transformers/src/transformers/modeling_gpt2.py:491
↓ 3 callers
Class
HPSearchBackend
transformers/src/transformers/trainer_utils.py:134
↓ 3 callers
Class
LxmertIntermediate
transformers/src/transformers/modeling_lxmert.py:429
↓ 3 callers
Class
LxmertOutput
transformers/src/transformers/modeling_lxmert.py:441
↓ 3 callers
Class
LxmertSelfAttentionLayer
transformers/src/transformers/modeling_lxmert.py:408
↓ 3 callers
Class
MemoryState
`MemoryState` are namedtuples listing frame + CPU/GPU memory with the following fields: - `frame` (`Frame`): the current frame (see above) -
transformers/src/transformers/benchmark/benchmark_utils.py:149
↓ 3 callers
Class
OpenAIGPTModel
transformers/src/transformers/modeling_openai.py:405
↓ 3 callers
Class
PipelineException
Raised by a :class:`~transformers.Pipeline` when handling __call__. Args: task (:obj:`str`): The task of the pipeline. model
transformers/src/transformers/pipelines.py:113
↓ 3 callers
Class
Seq2SeqModelOutput
Base class for model encoder's outputs that also contains : pre-computed hidden states that can speed up sequential decoding. Args:
transformers/src/transformers/modeling_outputs.py:104
↓ 3 callers
Class
TFBertMLMHead
transformers/src/transformers/modeling_tf_bert.py:481
↓ 3 callers
Class
TFFunnelBaseLayer
Base model without decoder
transformers/src/transformers/modeling_tf_funnel.py:752
↓ 3 callers
Class
TFGPT2MainLayer
transformers/src/transformers/modeling_tf_gpt2.py:207
↓ 3 callers
Class
TFLongformerMainLayer
transformers/src/transformers/modeling_tf_longformer.py:1225
↓ 3 callers
Class
TFLxmertIntermediate
transformers/src/transformers/modeling_tf_lxmert.py:361
↓ 3 callers
Class
TFLxmertOutput
transformers/src/transformers/modeling_tf_lxmert.py:380
↓ 3 callers
Class
TFLxmertSelfAttentionLayer
transformers/src/transformers/modeling_tf_lxmert.py:417
↓ 3 callers
Class
TFOpenAIGPTMainLayer
transformers/src/transformers/modeling_tf_openai.py:190
↓ 3 callers
Class
TrainingArguments
TrainingArguments is the subset of the arguments we use in our example scripts **which relate to the training loop itself**. Using :clas
transformers/src/transformers/training_args.py:36
↓ 3 callers
Class
TruncationStrategy
Possible values for the ``truncation`` argument in :meth:`PreTrainedTokenizerBase.__call__`. Useful for tab-completion in an IDE.
transformers/src/transformers/tokenization_utils_base.py:88
↓ 2 callers
Class
Adafactor
AdaFactor pytorch implementation can be used as a drop in replacement for Adam original fairseq code: https://github.com/pytorch/fairseq/blob
transformers/src/transformers/optimization.py:321
↓ 2 callers
Class
AlbertMLMHead
transformers/src/transformers/modeling_albert.py:824
↓ 2 callers
Class
Attention
transformers/src/transformers/modeling_gpt2.py:120
↓ 2 callers
Class
Attention
transformers/src/transformers/modeling_gpt2_adapter.py:120
↓ 2 callers
Class
BartForConditionalGeneration
transformers/src/transformers/modeling_bart.py:1355
↓ 2 callers
Class
BertAttention
transformers/src/transformers/modeling_bert.py:299
↓ 2 callers
Class
BertEncoder
transformers/src/transformers/modeling_bert.py:434
↓ 2 callers
Class
BertGenerationEncoder
The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of cross-attention is added betwee
transformers/src/transformers/modeling_bert_generation.py:255
↓ 2 callers
Class
BertLMPredictionHead
transformers/src/transformers/modeling_bert.py:530
↓ 2 callers
Class
BertOnlyMLMHead
transformers/src/transformers/modeling_bert.py:550
↓ 2 callers
Class
BestRun
The best run found by an hyperparameter search (see :class:`~transformers.Trainer.hyperparameter_search`). Parameters: run_id (:obj:
transformers/src/transformers/trainer_utils.py:73
↓ 2 callers
Class
BottleneckLayer
transformers/src/transformers/modeling_mobilebert.py:410
↓ 2 callers
Class
CharSpan
Character span in the original string. Args: start (:obj:`int`): Index of the first character in the original string. end (:
transformers/src/transformers/tokenization_utils_base.py:122
next →
1–100 of 1,052, ranked by callers