Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/huggingface/transformers
/ types & classes
Types & classes
939 in github.com/huggingface/transformers
⨍
Functions
4,119
◇
Types & classes
939
↳
Endpoints
4
↓ 33 callers
Class
ConfigTester
tests/test_configuration_common.py:22
↓ 21 callers
Class
InputExample
A single training/test example for simple sequence classification. Args: guid: Unique id for the example. text_a: string. Th
src/transformers/data/processors/utils.py:31
↓ 20 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
src/transformers/modeling_bert.py:627
↓ 20 callers
Class
HfArgumentParser
This subclass of `argparse.ArgumentParser` uses type hints on dataclasses to generate arguments. The class is designed to play well with
src/transformers/hf_argparser.py:14
↓ 18 callers
Class
AdamW
Implements Adam algorithm with weight decay fix. Parameters: lr (float): learning rate. Default 1e-3. betas (tuple of 2 floats):
src/transformers/optimization.py:96
↓ 13 callers
Class
PyTorchBenchmark
src/transformers/benchmark/benchmark.py:55
↓ 12 callers
Class
PyTorchBenchmarkArguments
src/transformers/benchmark/benchmark_args.py:36
↓ 10 callers
Class
BartForConditionalGeneration
src/transformers/modeling_bart.py:900
↓ 10 callers
Class
BasicTokenizer
Runs basic tokenization (punctuation splitting, lower casing, etc.).
src/transformers/tokenization_bert.py:351
↓ 10 callers
Class
ReformerConfig
r""" This is the configuration class to store the configuration of a :class:`~transformers.ReformerModel`. It is used to instantiate a
src/transformers/configuration_reformer.py:32
↓ 10 callers
Class
TensorFlowBenchmark
src/transformers/benchmark/benchmark_tf.py:78
↓ 9 callers
Class
MobileBertModel
https://arxiv.org/pdf/2004.02984.pdf
src/transformers/modeling_mobilebert.py:724
↓ 9 callers
Class
ReformerModelWithLMHead
src/transformers/modeling_reformer.py:1704
↓ 9 callers
Class
TFSharedEmbeddings
Construct shared token embeddings.
src/transformers/modeling_tf_utils.py:1616
↓ 9 callers
Class
TensorFlowBenchmarkArguments
src/transformers/benchmark/benchmark_args_tf.py:33
↓ 8 callers
Class
BertLMHeadModel
src/transformers/modeling_bert.py:894
↓ 8 callers
Class
TFBertMainLayer
src/transformers/modeling_tf_bert.py:499
↓ 8 callers
Class
TFMobileBertMainLayer
src/transformers/modeling_tf_mobilebert.py:631
↓ 8 callers
Class
XLNetModel
src/transformers/modeling_xlnet.py:632
↓ 7 callers
Class
AlbertModel
src/transformers/modeling_albert.py:442
↓ 7 callers
Class
BartConfig
r""" Configuration class for Bart. Parameters are renamed from the fairseq implementation
src/transformers/configuration_bart.py:36
↓ 7 callers
Class
ElectraModel
src/transformers/modeling_electra.py:238
↓ 7 callers
Class
ReformerLayer
src/transformers/modeling_reformer.py:1080
↓ 7 callers
Class
ReformerModel
src/transformers/modeling_reformer.py:1509
↓ 7 callers
Class
TFAlbertMainLayer
src/transformers/modeling_tf_albert.py:505
↓ 7 callers
Class
Trainer
Trainer is a simple but feature-complete training and eval loop for PyTorch, optimized for Transformers.
src/transformers/trainer.py:133
↓ 6 callers
Class
BartModel
src/transformers/modeling_bart.py:808
↓ 6 callers
Class
BatchEncoding
BatchEncoding hold the output of the encode and batch_encode methods (tokens, attention_masks, etc). This class is derived from a python Dict
src/transformers/tokenization_utils_base.py:129
↓ 6 callers
Class
DistilBertModel
src/transformers/modeling_distilbert.py:389
↓ 6 callers
Class
EncoderDecoderModel
r""" :class:`~transformers.EncoderDecoder` is a generic model class that will be instantiated as a transformer architecture with one o
src/transformers/modeling_encoder_decoder.py:29
↓ 6 callers
Class
GPT2Model
src/transformers/modeling_gpt2.py:349
↓ 6 callers
Class
HfApi
src/transformers/hf_api.py:98
↓ 6 callers
Class
LongformerModel
This class overrides :class:`~transformers.RobertaModel` to provide the ability to process long sequences following the selfattention approac
src/transformers/modeling_longformer.py:501
↓ 6 callers
Class
RobertaModel
This class overrides :class:`~transformers.BertModel`. Please check the superclass for the appropriate documentation alongside usage examples
src/transformers/modeling_roberta.py:143
↓ 6 callers
Class
SequenceSummary
r""" Compute a single vector summary of a sequence hidden states according to various possibilities: Args of the config class: sum
src/transformers/modeling_utils.py:2020
↓ 6 callers
Class
T5Model
src/transformers/modeling_t5.py:854
↓ 6 callers
Class
TFDistilBertMainLayer
src/transformers/modeling_tf_distilbert.py:416
↓ 6 callers
Class
TFFlaubertMainLayer
src/transformers/modeling_tf_flaubert.py:121
↓ 6 callers
Class
TFRobertaMainLayer
Same as TFBertMainLayer but uses TFRobertaEmbeddings.
src/transformers/modeling_tf_roberta.py:103
↓ 6 callers
Class
TFSequenceSummary
r""" Compute a single vector summary of a sequence hidden states according to various possibilities: Args of the config class: sum
src/transformers/modeling_tf_utils.py:1687
↓ 6 callers
Class
TFXLMMainLayer
src/transformers/modeling_tf_xlm.py:220
↓ 6 callers
Class
TFXLNetMainLayer
src/transformers/modeling_tf_xlnet.py:370
↓ 6 callers
Class
XLMModel
src/transformers/modeling_xlm.py:316
↓ 5 callers
Class
Conv1D
src/transformers/modeling_utils.py:1766
↓ 5 callers
Class
FlaubertModel
src/transformers/modeling_flaubert.py:114
↓ 5 callers
Class
GlueDataset
This will be superseded by a framework-agnostic approach soon.
src/transformers/data/datasets/glue.py:58
↓ 5 callers
Class
MecabTokenizer
Runs basic tokenization with MeCab morphological parser.
src/transformers/tokenization_bert_japanese.py:167
↓ 5 callers
Class
SinusoidalPositionalEmbedding
This module produces sinusoidal positional embeddings of any length.
src/transformers/modeling_bart.py:1250
↓ 5 callers
Class
TFElectraMainLayer
src/transformers/modeling_tf_electra.py:205
↓ 5 callers
Class
TFXxxMainLayer
templates/adding_a_new_model/modeling_tf_xxx.py:92
↓ 5 callers
Class
XxxModel
r""" Outputs: `Tuple` comprising various elements depending on the configuration (config) and inputs: **last_hidden_state**: ``torch.Float
templates/adding_a_new_model/modeling_xxx.py:272
↓ 4 callers
Class
InputExample
A single training/test example for multiple choice Args: example_id: Unique id for the example. question: string. The untoke
examples/multiple-choice/utils_multiple_choice.py:38
↓ 4 callers
Class
LineByLineTextDataset
This will be superseded by a framework-agnostic approach soon.
src/transformers/data/datasets/language_modeling.py:78
↓ 4 callers
Class
MaskedBertModel
The `MaskedBertModel` class replicates the :class:`~transformers.BertModel` class and adds specific inputs to compute the adaptive mask on th
examples/movement-pruning/emmental/modeling_bert_masked.py:470
↓ 4 callers
Class
MaskedLinear
Fully Connected layer with on the fly adaptive mask. If needed, a score matrix is created to store the importance of each associated weight.
examples/movement-pruning/emmental/modules/masked_nn.py:32
↓ 4 callers
Class
OpenAIGPTModel
src/transformers/modeling_openai.py:336
↓ 4 callers
Class
SquadV1Processor
src/transformers/data/processors/squad.py:598
↓ 4 callers
Class
SquadV2Processor
src/transformers/data/processors/squad.py:603
↓ 4 callers
Class
T5LayerNorm
src/transformers/modeling_t5.py:146
↓ 4 callers
Class
TFConv1D
src/transformers/modeling_tf_utils.py:1589
↓ 4 callers
Class
TFT5LayerNorm
src/transformers/modeling_tf_t5.py:58
↓ 4 callers
Class
TFTrainer
src/transformers/trainer_tf.py:31
↓ 4 callers
Class
TransfoXLTokenizer
Transformer-XL tokenizer adapted from Vocab class in https://github.com/kimiyoung/transformer-xl This tokenizer inherits from :class:`~trans
src/transformers/tokenization_transfo_xl.py:73
↓ 4 callers
Class
WordpieceTokenizer
Runs WordPiece tokenization.
src/transformers/tokenization_bert.py:490
↓ 4 callers
Class
XLNetTokenizer
Constructs an XLNet tokenizer. Based on `SentencePiece <https://github.com/google/sentencepiece>`__ This tokenizer inherits from :class:`~tr
src/transformers/tokenization_xlnet.py:53
↓ 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 m
src/transformers/modeling_tf_t5.py:481
↓ 3 callers
Class
AlbertTokenizer
Constructs an ALBERT tokenizer. Based on `SentencePiece <https://github.com/google/sentencepiece>`__ This tokenizer inherits from :class:`~t
src/transformers/tokenization_albert.py:57
↓ 3 callers
Class
BertConfig
r""" This is the configuration class to store the configuration of a :class:`~transformers.BertModel`. It is used to instantiate an BE
src/transformers/configuration_bert.py:53
↓ 3 callers
Class
DataCollatorForLanguageModeling
Data collator used for language modeling. - collates batches of tensors, honoring their tokenizer's pad_token - preprocesses batches for
src/transformers/data/data_collator.py:68
↓ 3 callers
Class
GPT2Config
This is the configuration class to store the configuration of a :class:`~transformers.GPT2Model`. It is used to instantiate an GPT-2
src/transformers/configuration_gpt2.py:35
↓ 3 callers
Class
GlueDataTrainingArguments
Arguments pertaining to what data we are going to input our model for training and eval. Using `HfArgumentParser` we can turn this class
src/transformers/data/datasets/glue.py:24
↓ 3 callers
Class
GradientAccumulator
Gradient accumulation utility. When used with a distribution strategy, the accumulator should be called in a replica context. Gradients will b
src/transformers/optimization_tf.py:199
↓ 3 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__`
src/transformers/benchmark/benchmark_utils.py:137
↓ 3 callers
Class
OpenAIGPTConfig
This is the configuration class to store the configuration of a :class:`~transformers.OpenAIGPTModel`. It is used to instantiate an G
src/transformers/configuration_openai.py:31
↓ 3 callers
Class
RobertaConfig
r""" This is the configuration class to store the configuration of a :class:`~transformers.RobertaModel`. It is used to instantiate an
src/transformers/configuration_roberta.py:36
↓ 3 callers
Class
RobertaEmbeddings
Same as BertEmbeddings with a tiny tweak for positional embeddings indexing.
src/transformers/modeling_roberta.py:46
↓ 3 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
src/transformers/data/processors/squad.py:608
↓ 3 callers
Class
SquadResult
Constructs a SquadResult which can be used to evaluate a model's output on the SQuAD dataset. Args: unique_id: The unique identifier
src/transformers/data/processors/squad.py:733
↓ 3 callers
Class
SummarizationDataset
examples/seq2seq/utils.py:79
↓ 3 callers
Class
T5Config
r""" :class:`~transformers.T5Config` is the configuration class to store the configuration of a `T5Model`. Arguments:
src/transformers/configuration_t5.py:34
↓ 3 callers
Class
T5ForConditionalGeneration
src/transformers/modeling_t5.py:986
↓ 3 callers
Class
TFGPT2MainLayer
src/transformers/modeling_tf_gpt2.py:213
↓ 3 callers
Class
TFGPT2Model
src/transformers/modeling_tf_gpt2.py:489
↓ 3 callers
Class
TFOpenAIGPTMainLayer
src/transformers/modeling_tf_openai.py:206
↓ 3 callers
Class
TFT5Model
src/transformers/modeling_tf_t5.py:869
↓ 3 callers
Class
TextDataset
This will be superseded by a framework-agnostic approach soon.
src/transformers/data/datasets/language_modeling.py:16
↓ 3 callers
Class
TransfoXLConfig
This is the configuration class to store the configuration of a :class:`~transformers.TransfoXLModel`. It is used to instantiate a Tr
src/transformers/configuration_transfo_xl.py:31
↓ 2 callers
Class
AlbertConfig
r""" This is the configuration class to store the configuration of a :class:`~transformers.AlbertModel`. It is used to instantiate an
src/transformers/configuration_albert.py:33
↓ 2 callers
Class
AlbertForPreTraining
src/transformers/modeling_albert.py:581
↓ 2 callers
Class
AlbertMLMHead
src/transformers/modeling_albert.py:700
↓ 2 callers
Class
BartForSequenceClassification
src/transformers/modeling_bart.py:1075
↓ 2 callers
Class
BertEncoder
src/transformers/modeling_bert.py:394
↓ 2 callers
Class
BertForPreTraining
src/transformers/modeling_bert.py:778
↓ 2 callers
Class
BertLMPredictionHead
src/transformers/modeling_bert.py:490
↓ 2 callers
Class
BertModelTester
tests/test_modeling_bert.py:42
↓ 2 callers
Class
BertOnlyMLMHead
src/transformers/modeling_bert.py:510
↓ 2 callers
Class
CTRLConfig
This is the configuration class to store the configuration of a :class:`~transformers.CTRLModel`. It is used to instantiate an CTRL m
src/transformers/configuration_ctrl.py:28
↓ 2 callers
Class
CTRLModel
src/transformers/modeling_ctrl.py:298
↓ 2 callers
Class
CharSpan
Character span in the original string Args: start: index of the first character in the original string end: index of
src/transformers/tokenization_utils_base.py:105
↓ 2 callers
Class
CharacterTokenizer
Runs Character tokenziation.
src/transformers/tokenization_bert_japanese.py:219
next →
1–100 of 939, ranked by callers