Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/AnswerDotAI/ModernBERT
/ functions
Functions
560 in github.com/AnswerDotAI/ModernBERT
⨍
Functions
560
◇
Types & classes
136
↳
Endpoints
2
↓ 1 callers
Method
get_trainer
Returns the trainer for the job.
src/evals/finetuning_jobs.py:127
↓ 1 callers
Function
get_wandb_config
(run_name, entity_name, project_name)
generate_eval_config.py:125
↓ 1 callers
Function
index_cos_sin
(cos, sin, seqlen_offsets, seqlen)
tests/test_rotary.py:44
↓ 1 callers
Function
init_from_checkpoint
(cfg: DictConfig, new_model: nn.Module)
main.py:335
↓ 1 callers
Function
init_mlm_model_from_pretrained
Initialize the new model from the pretrained model. This method uses Gopher layer scaling and Phi-style weight tiling as selected by `mode`.
src/bert_layers/model.py:1644
↓ 1 callers
Function
init_model_from_pretrained
Initialize the new model from the pretrained model. This method uses Gopher layer scaling and Phi-style weight tiling as selected by `mode`.
src/bert_layers/model.py:1502
↓ 1 callers
Function
init_run
(args)
wandb_log_live_eval.py:24
↓ 1 callers
Function
kill_process_tree
(pid)
run_evals.py:72
↓ 1 callers
Function
log_config
(cfg: DictConfig)
sequence_classification.py:79
↓ 1 callers
Function
log_config
(cfg: DictConfig)
main.py:113
↓ 1 callers
Function
log_config
(cfg: DictConfig)
src/evals/finetuning_jobs.py:89
↓ 1 callers
Function
main
()
wandb_log_live_eval.py:94
↓ 1 callers
Function
main
(api, args)
download_artifacts_from_wandb.py:29
↓ 1 callers
Function
main
Main: create C4/pile streaming dataset. Args: args (Namespace): Commandline arguments.
src/convert_dataset.py:358
↓ 1 callers
Function
main
()
src/data/mds_conversion.py:38
↓ 1 callers
Function
main
(out_fn, dataset_max_size)
src/data/source_stats.py:26
↓ 1 callers
Function
main
()
examples/train_st_gooaq.py:16
↓ 1 callers
Function
main
()
examples/train_st.py:16
↓ 1 callers
Function
main
()
examples/train_pylate.py:11
↓ 1 callers
Function
manage_jobs
Manage the launching of jobs for each configuration file in the directory.
run_evals.py:243
↓ 1 callers
Method
match
(self, event: Event, state: State)
src/algorithms/rope_schedule.py:65
↓ 1 callers
Function
maybe_decompress_shard
If shard does not have decompressed data, this function decompresses the shard
src/data/mds_conversion.py:17
↓ 1 callers
Function
ordered_yaml_dump
(data, stream=None, Dumper=yaml.Dumper, **kwds)
generate_eval_config.py:110
↓ 1 callers
Function
pad_input
Add padding to sequences. Args: inputs: (total_nnz, ...) or (total_nnz,), where total_nnz = number of tokens selected in attention_m
src/bert_layers/padding.py:48
↓ 1 callers
Function
parse_args
Parse commandline arguments.
src/convert_dataset.py:27
↓ 1 callers
Function
parse_model_string
(s)
wandb_log_live_eval.py:14
↓ 1 callers
Method
print_metrics
Prints fine-tuning results.
src/evals/finetuning_jobs.py:131
↓ 1 callers
Function
process_data
(args)
wandb_log_live_eval.py:33
↓ 1 callers
Function
relative_to_instance
(args)
src/data/relative_prop_to_instance_prop.py:23
↓ 1 callers
Function
reset_trainer
Cleans up memory usage left by trainer.
src/evals/finetuning_jobs.py:69
↓ 1 callers
Function
run_inference_benchmark
(model_name, use_xformers=False, n_iters=10, gpu=0)
efficiency/multiprocess_bench.py:283
↓ 1 callers
Function
run_job_worker
Instantiates the job object and runs it.
eval.py:336
↓ 1 callers
Function
run_job_worker
Instantiates the job object and runs it.
glue.py:284
↓ 1 callers
Function
run_subprocess
(cmd: List[str], verbose: bool = False, show_errors: bool = False)
run_evals.py:138
↓ 1 callers
Function
sample_dataset_from_config
(args)
src/data/sample_dataset_from_config.py:48
↓ 1 callers
Function
sample_hf
(upload_repo, repo_name, split_name, config_name)
src/data/hf_to_mds.py:63
↓ 1 callers
Function
stableadamw
Functional API to apply a StableAdamW optimization step. See `optimi.StableAdamW` for more details. Args: params: Parameters to upda
src/optimizer.py:183
↓ 1 callers
Function
train
(cfg: DictConfig, return_trainer: bool = False, do_train: bool = True)
sequence_classification.py:243
↓ 1 callers
Function
unpad_input
Remove padding from input sequences. Args: inputs: (batch, seqlen, ...) or (batch, seqlen) attention_mask: (batch, seqlen),
src/bert_layers/padding.py:7
↓ 1 callers
Method
unpad_inputs
( self, input_ids: torch.Tensor, attention_mask: torch.Tensor, position_ids: torch.Tensor, labels: tor
src/bert_layers/model.py:1073
↓ 1 callers
Method
update
(self, outputs, labels)
src/evals/superglue_jobs.py:109
↓ 1 callers
Function
update_batch_size_info
(cfg: DictConfig)
sequence_classification.py:35
↓ 1 callers
Function
update_batch_size_info
(cfg: DictConfig)
main.py:51
↓ 1 callers
Function
update_config
( source_config: dict, bos_token_id: int, eos_token_id: int, cls_token_id: int, pad_token_
convert_to_hf.py:22
Method
__call__
(self, examples: List[Any])
src/text_data.py:275
Method
__call__
(self, current_step: int)
src/sequence_packer.py:52
Method
__call__
(self, state: State, ssr: float = 1.0)
src/scheduler.py:111
Method
__call__
(self, state: State, ssr: float = 1.0)
src/scheduler.py:198
Method
__call__
(self, state: State, ssr: float = 1.0)
src/scheduler.py:282
Method
__enter__
(self)
tests/test_superglue.py:24
Method
__enter__
(self)
tests/test_eval.py:24
Method
__enter__
(self)
tests/test_utils.py:15
Method
__enter__
(self)
tests/test_glue.py:24
Method
__exit__
(self, exc_type: Any, exc_value: Any, traceback: Any)
tests/test_superglue.py:28
Method
__exit__
(self, exc_type: Any, exc_value: Any, traceback: Any)
tests/test_eval.py:28
Method
__exit__
(self, exc_type: Any, exc_value: Any, traceback: Any)
tests/test_utils.py:20
Method
__exit__
(self, exc_type: Any, exc_value: Any, traceback: Any)
tests/test_glue.py:28
Method
__getitem__
(self, idx: int)
src/text_data.py:244
Method
__getitem__
(self, key)
src/bert_layers/activation.py:14
Method
__init__
( self, tokenizer: Tokenizer, max_seq_len: int, streams: Optional[Sequence[Str
src/text_data.py:141
Method
__init__
(self, base_collator: Callable, eos_token_id: Optional[int] = None, bos_token_id: Optional[int] = None)
src/text_data.py:258
Method
__init__
( self, params: Iterable[Tensor] | Iterable[dict], lr: float, betas: tuple[flo
src/optimizer.py:53
Method
__init__
(self, dist_sync_on_step: bool = False, ignore_index: int = -100)
src/flex_bert.py:70
Method
__init__
(self, dist_sync_on_step: bool = False)
src/flex_bert.py:89
Method
__init__
( self, min_batch_size: int, max_batch_size: int, warmup_tokens: Union[str, Ti
src/sequence_packer.py:21
Method
__init__
Takes batches of unpacked, unpadded sequences (seqs) to batches of packed and padded sequences (pseqs). Every input batch must be a
src/sequence_packer.py:72
Method
__init__
Args: - iterable: an object which generates a fresh iterator on iter() and which implements len()
src/sequence_packer.py:480
Method
__init__
(self, iterable: Iterable[T], buffer_size: int)
src/sequence_packer.py:493
Method
__init__
( self, t_warmup: Union[str, Time], t_decay: Union[str, Time] = "0.1dur", t_ma
src/scheduler.py:96
Method
__init__
( self, t_warmup: Union[str, Time], t_cooldown: Union[str, Time], t_cosine: Un
src/scheduler.py:173
Method
__init__
( self, t_decay: Union[str, Time] = "0.1dur", t_max: Union[str, Time] = "1dur",
src/scheduler.py:272
Method
__init__
( self, hf_split: str = "train", folder_split: str = "train_small", raw_sample
src/convert_dataset.py:85
Method
__init__
( self, hf_split: str = "validation", folder_split: str = "val_small", raw_sam
src/convert_dataset.py:96
Method
__init__
( self, dataset_name: str, split: str, tokenizer: PreTrainedTokenizerBase,
src/convert_dataset.py:181
Method
__init__
( self, batch_interval: int, gen_1_batch_interval: Optional[int] = None, eval_
src/callbacks/scheduled_gc.py:31
Method
__init__
(self, log_interval: int = 100)
src/callbacks/packing_efficiency.py:13
Method
__init__
(self, log_optimizer_metrics: bool = True, batch_log_interval: int = 10)
src/callbacks/log_grad_norm.py:27
Method
__init__
(self, config)
src/bert_layers/layers.py:36
Method
__init__
(self, config)
src/bert_layers/layers.py:83
Method
__init__
(self, config)
src/bert_layers/layers.py:242
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/layers.py:264
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/layers.py:285
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/layers.py:330
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/layers.py:370
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/layers.py:418
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/layers.py:452
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/layers.py:497
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/layers.py:534
Method
__init__
(self, config: FlexBertConfig)
src/bert_layers/layers.py:623
Method
__init__
(self, config: FlexBertConfig)
src/bert_layers/layers.py:675
Method
__init__
(self, config)
src/bert_layers/attention.py:71
Method
__init__
(self, config)
src/bert_layers/attention.py:207
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/attention.py:250
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/attention.py:286
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/attention.py:445
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/attention.py:595
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/attention.py:724
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/attention.py:944
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/attention.py:1098
Method
__init__
(self, config: FlexBertConfig, layer_id: Optional[int] = None)
src/bert_layers/attention.py:1275
← previous
next →
201–300 of 560, ranked by callers