MCPcopy Create free account

hub / github.com/AnswerDotAI/ModernBERT / types & classes

Types & classes136 in github.com/AnswerDotAI/ModernBERT

↓ 8 callersClassDataSplitConstants
src/convert_dataset.py:66
↓ 4 callersClassGreedyBestFitSequencePacker
src/sequence_packer.py:378
↓ 4 callersClassStableAdamW
StableAdamW optimizer. An AdamW-Adafactor hybrid with learning rate update clipping. This version is modified to only run foreach which has the o
src/optimizer.py:30
↓ 4 callersClassWarmupStableDecayScheduler
r""" Args: t_warmup (str | Time): Warmup time. t_max (str | Time): The duration of this scheduler. Default = ``"1dur"``. a
src/scheduler.py:87
↓ 3 callersClassBertModel
Overall BERT model. Args: config: a BertConfig class instance with the configuration to build a new model Inputs: `input_ids
src/bert_layers/model.py:130
↓ 3 callersClassFlexBertModel
Overall BERT model. Args: config: a BertConfig class instance with the configuration to build a new model Inputs: `input_ids
src/bert_layers/model.py:880
↓ 3 callersClassMaskedLMOutput
Base class for masked language models outputs. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` i
src/bert_layers/model.py:786
↓ 3 callersClassTileMode
src/bert_layers/initialization.py:166
↓ 3 callersClassUnpaddedRotaryEmbedding
The rotary position embeddings applied directly to unpadded sequences.
src/bert_layers/rotary.py:158
↓ 2 callersClassDatasetConstants
src/convert_dataset.py:74
↓ 2 callersClassFlexBertPoolingHead
src/bert_layers/model.py:748
↓ 2 callersClassMaskedLMOutputZLoss
Base class for masked language models outputs. Args: loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when `labels` i
src/bert_layers/model.py:821
↓ 2 callersClassSchedule
src/scheduler.py:43
↓ 2 callersClassSynthTextDirectory
tests/test_utils.py:14
↓ 1 callersClassAblationDirContext
tests/test_eval.py:20
↓ 1 callersClassBatchSizeWarmupScheduler
src/sequence_packer.py:20
↓ 1 callersClassBertAlibiEmbeddings
Construct the embeddings for words, ignoring position. There are no positional embeddings since we use ALiBi and token_type embeddings.
src/bert_layers/embeddings.py:24
↓ 1 callersClassBertAlibiEncoder
A stack of BERT layers providing the backbone of Mosaic BERT. This module is modeled after the Hugging Face BERT's :class:`~transformers.model.be
src/bert_layers/layers.py:73
↓ 1 callersClassBertAlibiLayer
Composes the Mosaic BERT attention and FFN blocks into a single layer.
src/bert_layers/layers.py:33
↓ 1 callersClassBertAlibiUnpadAttention
Chains attention, Dropout, and LayerNorm for Mosaic BERT.
src/bert_layers/attention.py:204
↓ 1 callersClassBertAlibiUnpadSelfAttention
Performs multi-headed self attention on a batch of unpadded sequences. If Flash Attention 2 is installed, this module uses Flash Attention to gre
src/bert_layers/attention.py:60
↓ 1 callersClassBertLMPredictionHead
src/bert_layers/model.py:250
↓ 1 callersClassBertOnlyMLMHead
src/bert_layers/model.py:265
↓ 1 callersClassBertPooler
src/bert_layers/layers.py:226
↓ 1 callersClassBertPredictionHeadTransform
src/bert_layers/layers.py:241
↓ 1 callersClassBertResidualGLU
Applies the FFN at the end of each Mosaic BERT layer. Compared to the default BERT architecture, this block replaces :class:`~transformers.model.
src/bert_layers/mlp.py:25
↓ 1 callersClassBertSelfOutput
Computes the output of the attention layer. This module is modeled after the Hugging Face BERT's :class:`~transformers.model.bert.modeling_be
src/bert_layers/attention.py:180
↓ 1 callersClassBufferedIterable
src/sequence_packer.py:479
↓ 1 callersClassBufferedIterator
src/sequence_packer.py:492
↓ 1 callersClassClassInstantier
src/bert_layers/activation.py:13
↓ 1 callersClassConcatTokensDataset
An IterableDataset that returns token samples for MDSWriter. Returns dicts of {'tokens': bytes} To use data created by this class and writte
src/convert_dataset.py:158
↓ 1 callersClassConcatenatedSequenceCollatorWrapper
Collator wrapper to add sequence_id to batch.
src/text_data.py:255
↓ 1 callersClassCosineInverseSqrtScheduler
r"""Decays the learning rate according to a cosine decay followed by an inverse square root decay, with optional warmup and cooldown. Specificall
src/scheduler.py:140
↓ 1 callersClassDataloaderSpeedMonitor
Measure how long it takes to return a batch from the dataloader.
src/callbacks/dataloader_speed.py:11
↓ 1 callersClassDistributedSamplerPCG64DXSM
src/text_data.py:46
↓ 1 callersClassEfficientCrossEntropy
Torchmetric that grabs the precomputed ce_loss value from the model outputs
src/flex_bert.py:83
↓ 1 callersClassEfficientHuggingFaceModel
src/flex_bert.py:144
↓ 1 callersClassEfficientZLoss
Torchmetric that grabs the precomputed z_loss value from the model outputs
src/flex_bert.py:114
↓ 1 callersClassFALanguageCrossEntropy
Torchmetric that computes cross entropy on language modeling outputs using flash_attn's Cross Entropy. Adds metric state variables: sum_l
src/flex_bert.py:54
↓ 1 callersClassFlexBertCompiledSansPositionEmbeddings
Construct the embeddings from token embeddings without any positional embeddings.
src/bert_layers/embeddings.py:161
↓ 1 callersClassFlexBertConfig
src/bert_layers/configuration_bert.py:42
↓ 1 callersClassFlexBertForMaskedLM
src/bert_layers/model.py:1001
↓ 1 callersClassFlexBertForSequenceClassification
Bert Model transformer with a sequence classification/regression head. This head is just a linear layer on top of the pooled output. Used for,
src/bert_layers/model.py:1249
↓ 1 callersClassFlexBertPredictionHead
src/bert_layers/model.py:726
↓ 1 callersClassFlexBertRopeSchedule
src/algorithms/rope_schedule.py:32
↓ 1 callersClassGlueDirContext
tests/test_glue.py:20
↓ 1 callersClassLogGradNorm
Logs the precomputed L1 and L2 gradient norms from StableAdamW
src/callbacks/log_grad_norm.py:24
↓ 1 callersClassNoConcatDataset
An IterableDataset that returns text samples for MDSWriter. Returns dicts of {'text': bytes}
src/convert_dataset.py:143
↓ 1 callersClassNoStreamingDataset
A dataset class that can read data with raw mds-format (mosaic streaming-format without compression) from local. In comparison with `Streamin
src/text_data.py:447
↓ 1 callersClassOneMinusSqrtScheduler
Decays the learning rate according to a 1 - sqrt function, without an initial warmup phase. The learning rate decays from 1 to alpha_f accord
src/scheduler.py:264
↓ 1 callersClassPackingEfficency
Records the packing efficiency for each batch.
src/callbacks/packing_efficiency.py:10
↓ 1 callersClassScheduledGarbageCollector
Disable automatic garbage collection and collect garbage at interval. Args: batch_interval (int): Number of batches between calls to gc.c
src/callbacks/scheduled_gc.py:22
↓ 1 callersClassStreamingTextDataset
Generic text dataset using MosaicML's StreamingDataset. Args: tokenizer (Tokenizer): HuggingFace tokenizer to tokenize sample
src/text_data.py:99
↓ 1 callersClassSuperGlueDirContext
tests/test_superglue.py:20
↓ 1 callersClassTileLinear
src/bert_layers/initialization.py:381
ClassApplyRotaryEmbUnpad
src/bert_layers/rotary.py:14
ClassBertConfig
src/bert_layers/configuration_bert.py:9
ClassBertForMaskedLM
src/bert_layers/model.py:300
ClassBertForMultipleChoice
Bert Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a softmax) e.g. for RocStories/S
src/bert_layers/model.py:583
ClassBertForNextSentencePrediction
src/bert_layers/model.py:453
ClassBertForPreTraining
src/bert_layers/model.py:290
ClassBertForQuestionAnswering
Bert Model with a span classification head. This is used for extractive question-answering tasks like SQuAD (a linear layers on top of the hi
src/bert_layers/model.py:710
ClassBertForSequenceClassification
Bert Model transformer with a sequence classification/regression head. This head is just a linear layer on top of the pooled output. Used for,
src/bert_layers/model.py:458
ClassBertForTokenClassification
src/bert_layers/model.py:705
ClassBertLMHeadModel
src/bert_layers/model.py:295
ClassBertOnlyNSPHead
src/bert_layers/model.py:275
ClassBoolQJob
BoolQ.
src/evals/superglue_jobs.py:29
ClassCBJob
CB.
src/evals/superglue_jobs.py:119
ClassCBMetric
src/evals/superglue_jobs.py:104
ClassCOLAJob
COLA.
src/evals/glue_jobs.py:255
ClassCOPAJob
COPA.
src/evals/superglue_jobs.py:195
ClassClassificationJob
src/evals/finetuning_jobs.py:224
ClassConcatMode
src/convert_dataset.py:22
ClassEurlexJob
Eurlex multi-label classification.
src/evals/misc_jobs.py:149
ClassEurlexMultilabelF1Score
src/evals/misc_jobs.py:144
ClassFineTuneJob
Encapsulates a fine-tuning job. Tasks should subclass FineTuneJob and implement the get_trainer() method. Args: name (str, optio
src/evals/finetuning_jobs.py:99
ClassFlexBertAbsoluteEmbeddings
Construct the embeddings with absolute positional embeddings.
src/bert_layers/embeddings.py:123
ClassFlexBertAttentionBase
A FlexBERT attention base class for type hints.
src/bert_layers/attention.py:247
ClassFlexBertCompileUnpadPreNormLayer
Composes the FlexBERT attention and MLP blocks into a single layer using pre-normalization.
src/bert_layers/layers.py:282
ClassFlexBertEmbeddingsBase
A FlexBERT embeddings base class for type hints.
src/bert_layers/embeddings.py:106
ClassFlexBertEncoderBase
A FlexBERT base class for type hints.
src/bert_layers/layers.py:596
ClassFlexBertForMultipleChoice
Bert Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a softmax) e.g. for RocStories/S
src/bert_layers/model.py:1380
ClassFlexBertGLU
Applies the GLU at the end of each FlexBERT layer. Compared to the default BERT architecture, this block replaces :class:`~transformers.model.ber
src/bert_layers/mlp.py:131
ClassFlexBertLayerBase
A FlexBERT Layer base class for type hints.
src/bert_layers/layers.py:258
ClassFlexBertMLP
Applies the MLP at the end of each FlexBERT layer. Compared to the default BERT architecture, this block replaces :class:`~transformers.model.ber
src/bert_layers/mlp.py:91
ClassFlexBertMLPBase
A FlexBERT MLP base class for type hints.
src/bert_layers/mlp.py:73
ClassFlexBertPaddedAttention
Performs multi-headed self attention on a batch of padded sequences. This module supports two attention implementations: 1. Flash Attention 2
src/bert_layers/attention.py:585
ClassFlexBertPaddedEncoder
A stack of BERT layers providing the backbone of FlexBERT. This module is modeled after the Hugging Face BERT's :class:`~transformers.model.bert.
src/bert_layers/layers.py:665
ClassFlexBertPaddedParallelAttention
Performs multi-headed self attention on a batch of padded sequences. This module supports two attention implementations: 1. Flash Attention 2
src/bert_layers/attention.py:1413
ClassFlexBertPaddedParallelPreNormLayer
Composes the FlexBERT attention and MLP blocks into a single layer using pre-normalization.
src/bert_layers/layers.py:449
ClassFlexBertPaddedPostNormLayer
Composes the FlexBERT attention and MLP blocks into a single layer using post-normalization.
src/bert_layers/layers.py:531
ClassFlexBertPaddedPreNormLayer
Composes the FlexBERT attention and MLP blocks into a single layer using pre-normalization.
src/bert_layers/layers.py:415
ClassFlexBertPaddedRopeAttention
Performs multi-headed self attention on a batch of padded sequences. This module supports two attention implementations: 1. Flash Attention 2
src/bert_layers/attention.py:934
ClassFlexBertPaddedRopeParallelAttention
Performs multi-headed self attention on a batch of padded sequences. This module supports two attention implementations: 1. Flash Attention 2
src/bert_layers/attention.py:1265
ClassFlexBertParallelGLU
Applies the GLU at the end of each FlexBERT layer using intermediate_ff computed in parallel of the attention. Compared to the default BERT archi
src/bert_layers/mlp.py:166
ClassFlexBertPreTrainedModel
An abstract class to handle custom weights initialization of modules
src/bert_layers/model.py:863
ClassFlexBertSansPositionEmbeddings
Construct the embeddings from token embeddings without any positional embeddings.
src/bert_layers/embeddings.py:183
ClassFlexBertUnpadAttention
Performs multi-headed self attention on a batch of unpadded sequences. If Flash Attention 2 is installed, this module uses Flash Attention to imp
src/bert_layers/attention.py:276
ClassFlexBertUnpadEncoder
A stack of BERT layers providing the backbone of FlexBERT. This module is modeled after the Hugging Face BERT's :class:`~transformers.model.bert.
src/bert_layers/layers.py:613
ClassFlexBertUnpadParallelAttention
Computes the output of the multi-headed self parallel attention on a batch of unpadded sequences If Flash Attention 2 is installed, this module u
src/bert_layers/attention.py:435
next →1–100 of 136, ranked by callers