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
_create_batch
Returns a batch of packed sequences with its cumulative seq length information. Or else, returns None if it cannot build a full outg
src/sequence_packer.py:348
↓ 1 callers
Function
_est_progress_denominator
( total_samples: int, chars_per_sample: int, chars_per_token: int, mode: ConcatMode, max_length: int )
src/convert_dataset.py:305
↓ 1 callers
Method
_fill_buffer
Refills the internal buffer. - max_items_to_add: an amount less than or equal to the number of items to add Returns: the nu
src/sequence_packer.py:196
↓ 1 callers
Method
_finish_setup
(self, t_max: Time[int], t_warmup: Time[int], t_cosine: Time[int], t_cooldown: Time[int])
src/scheduler.py:240
↓ 1 callers
Function
_foreach_stableadamw
( params: list[Tensor], grads: list[Tensor], exp_avgs: list[Tensor], exp_avg_sqs: list[Tensor]
src/optimizer.py:250
↓ 1 callers
Method
_generate_batches
Generates batches of packed sequences. The returned generator's iterator will always, when next() is called on it, either:
src/sequence_packer.py:235
↓ 1 callers
Method
_init_group
( self, group: dict[str, Any], params: list[Tensor], grads: list[Tensor],
src/optimizer.py:104
↓ 1 callers
Method
_init_state
(self, group: dict[str, Any], state: dict[Tensor, Any], param: Tensor)
src/optimizer.py:89
↓ 1 callers
Method
_init_weights
(self, reset_params: bool = False)
src/bert_layers/layers.py:601
↓ 1 callers
Method
_init_weights
(self, reset_params: bool = False)
src/bert_layers/mlp.py:81
↓ 1 callers
Method
_init_weights
(self, reset_params: bool = False)
src/bert_layers/embeddings.py:113
↓ 1 callers
Method
_init_weights
(self, reset_params: bool = False)
src/bert_layers/model.py:736
↓ 1 callers
Method
_init_weights
(self, reset_params: bool = False)
src/bert_layers/model.py:771
↓ 1 callers
Method
_init_weights
(self, module: Optional[nn.Module] = None, reset_params: Optional[bool] = None)
src/bert_layers/model.py:1025
↓ 1 callers
Method
_init_weights
(self, module: Optional[nn.Module] = None, reset_params: Optional[bool] = None)
src/bert_layers/model.py:1268
↓ 1 callers
Method
_init_weights
(self, module: Optional[nn.Module] = None, reset_params: Optional[bool] = None)
src/bert_layers/model.py:1403
↓ 1 callers
Function
_make_passage
(doc)
_colbert.py:14
↓ 1 callers
Method
_norm
Apply the RMSNorm normalization to the input tensor. Args: x (torch.Tensor): The input tensor. Returns:
src/bert_layers/normalization.py:44
↓ 1 callers
Method
_packing_efficiency
(self, state: State)
src/callbacks/packing_efficiency.py:25
↓ 1 callers
Function
_print_table
Pretty prints a table given a results dictionary.
eval.py:456
↓ 1 callers
Function
_print_table
Pretty prints a table given a results dictionary.
glue.py:390
↓ 1 callers
Method
_read_binary_tokenized_sample
(self, sample: BatchEncoding)
src/text_data.py:212
↓ 1 callers
Method
_reset_state
(self)
src/sequence_packer.py:174
↓ 1 callers
Function
_setup_gpu_queue
Returns a queue with [0, 1, .. num_gpus].
eval.py:270
↓ 1 callers
Function
_setup_gpu_queue
Returns a queue with [0, 1, .. num_gpus].
glue.py:220
↓ 1 callers
Function
_tile_1d
(pretrained_weights: torch.Tensor, new_weights: torch.Tensor, mode: TileMode)
src/bert_layers/initialization.py:200
↓ 1 callers
Function
_tile_2d
(pretrained_weights: torch.Tensor, new_weights: torch.Tensor, mode: TileMode)
src/bert_layers/initialization.py:232
↓ 1 callers
Method
_tokenize
(self, text_sample)
src/text_data.py:205
↓ 1 callers
Method
_tokenize
(self, text_sample)
src/text_data.py:483
↓ 1 callers
Method
apply
(self, event: Event, state: State, logger: Logger)
src/algorithms/rope_schedule.py:68
↓ 1 callers
Function
benchmark_inference
(model, dataloader, num_warmup_batches=10, gpu_idx=0)
benchmark.py:190
↓ 1 callers
Function
benchmark_training
(model, dataloader, num_warmup_batches=10, gpu_idx=0)
benchmark.py:134
↓ 1 callers
Function
build_algorithm
(name, kwargs)
eval.py:81
↓ 1 callers
Function
build_algorithm
(name, kwargs)
glue.py:73
↓ 1 callers
Function
build_algorithm
(name, kwargs)
sequence_classification.py:90
↓ 1 callers
Function
build_algorithm
(name, kwargs)
main.py:124
↓ 1 callers
Function
build_callback
(name, kwargs)
eval.py:92
↓ 1 callers
Function
build_callback
(name, kwargs)
glue.py:84
↓ 1 callers
Function
build_callback
(name, kwargs)
sequence_classification.py:101
↓ 1 callers
Function
build_callback
(name, kwargs)
main.py:151
↓ 1 callers
Function
build_colbert_index
( dataset_name: str, model_name_or_path: str, checkpoint_path: str, collection: list[str],
src/colbert_beir/index_and_score.py:11
↓ 1 callers
Function
build_dataloader
(dataset, batch_size)
src/convert_dataset.py:315
↓ 1 callers
Function
build_hf_dataset
Build an IterableDataset over the HF C4 or pile source data. Args: dataset_name (str): Dataset name split (str): Split name.
src/convert_dataset.py:247
↓ 1 callers
Function
build_logger
(name, kwargs)
eval.py:112
↓ 1 callers
Function
build_logger
(name, kwargs)
glue.py:104
↓ 1 callers
Function
build_logger
(name, kwargs)
sequence_classification.py:120
↓ 1 callers
Function
build_logger
(name, kwargs)
main.py:181
↓ 1 callers
Function
build_model
(cfg: DictConfig, num_labels: int, multiple_choice: bool = False, **kwargs)
eval.py:184
↓ 1 callers
Function
build_model
( cfg: DictConfig, num_labels: int, multiple_choice: bool = False, **kwargs )
glue.py:126
↓ 1 callers
Function
build_model
(cfg: DictConfig)
sequence_classification.py:210
↓ 1 callers
Function
build_no_streaming_dataset
( cfg: DictConfig, tokenizer: Tokenizer, pad_sequences: bool = True, )
src/text_data.py:344
↓ 1 callers
Function
build_optimizer
(cfg, model)
eval.py:132
↓ 1 callers
Function
build_optimizer
(cfg, model)
sequence_classification.py:140
↓ 1 callers
Function
build_optimizer
(cfg, model)
main.py:215
↓ 1 callers
Function
build_scheduler
(cfg)
eval.py:119
↓ 1 callers
Function
build_scheduler
(cfg)
glue.py:111
↓ 1 callers
Function
build_scheduler
(cfg)
sequence_classification.py:127
↓ 1 callers
Function
build_scheduler
(cfg)
main.py:188
↓ 1 callers
Function
build_streaming_dataset
( cfg: DictConfig, tokenizer: Tokenizer, device_batch_size: int, )
src/text_data.py:293
↓ 1 callers
Function
build_text_dataloader
( cfg: DictConfig, tokenizer: Tokenizer, device_batch_size: int, device_microbatch_size: int,
src/text_data.py:358
↓ 1 callers
Function
build_tokenizer
( om_tokenizer_config: DictConfig, )
src/text_data.py:75
↓ 1 callers
Function
colbert_score
( model_name_or_path: str, dataset_name: str, dataset: ir_datasets.Dataset, int2docid: dict[in
src/colbert_beir/index_and_score.py:34
↓ 1 callers
Function
colbert_train
(model_name_or_path: str, train_params: dict, n_gpu: int, data_path: str)
src/colbert_beir/train.py:6
↓ 1 callers
Method
compiled_head
(self, output: torch.Tensor)
src/bert_layers/model.py:1093
↓ 1 callers
Method
compiled_mlp
(self, hidden_states: torch.Tensor)
src/bert_layers/layers.py:303
↓ 1 callers
Method
compute
(self)
src/evals/superglue_jobs.py:319
↓ 1 callers
Method
compute_final
(self)
src/evals/superglue_jobs.py:322
↓ 1 callers
Function
create_all_datasets
(tokenizer, num_samples=8192)
efficiency/multiprocess_bench.py:78
↓ 1 callers
Function
create_dummy_data
(num_samples, seq_length, vocab_size, model_type)
benchmark.py:239
↓ 1 callers
Function
create_fixed_long_dataset
(tokenizer, num_samples=8192)
efficiency/multiprocess_bench.py:24
↓ 1 callers
Function
create_fixed_short_dataset
(tokenizer, num_samples=8192)
efficiency/multiprocess_bench.py:16
↓ 1 callers
Function
create_symlink_for_newest_checkpoint
Create a symlink to the newest checkpoint file if 'latest-rank0.pt' does not exist.
run_evals.py:332
↓ 1 callers
Function
create_synthetic_text_dataset
(n_samples: int = 16)
tests/test_utils.py:25
↓ 1 callers
Function
create_variable_long_dataset
(tokenizer, num_samples=8192)
efficiency/multiprocess_bench.py:55
↓ 1 callers
Function
create_variable_short_dataset
(tokenizer, num_samples=8192)
efficiency/multiprocess_bench.py:32
↓ 1 callers
Function
download_hub_files
Download specific files or the entire repository from a Hugging Face Hub repository.
run_evals.py:541
↓ 1 callers
Function
download_starting_checkpoint
Downloads the pretrained checkpoints to start from. Currently only supports S3 and URLs
eval.py:243
↓ 1 callers
Function
download_starting_checkpoint
Downloads the pretrained checkpoints to start from. Currently only supports S3 and URLs
glue.py:187
↓ 1 callers
Function
find_best_fit
(remaining_spaces, seq_len)
src/sequence_packer.py:369
↓ 1 callers
Function
find_checkpoint_file
(file_path: str, repo_files: List[str])
run_evals.py:518
↓ 1 callers
Function
flatten_config
(cfg)
generate_eval_config.py:141
↓ 1 callers
Function
format_job_name
Formats the job name for pretty printing.
eval.py:450
↓ 1 callers
Function
format_job_name
Formats the job name for pretty printing.
glue.py:384
↓ 1 callers
Method
forward
Get just the values of `input` which are at `indices`. Arguments: ctx: the autograd context object input: (b, ...) 2+
src/bert_padding.py:22
↓ 1 callers
Function
generate_cos_sin
(seqlen, rotary_dim, device, dtype)
tests/test_rotary.py:27
↓ 1 callers
Function
generate_eval_configs
Generate evaluation configs for each checkpoint.
run_evals.py:383
↓ 1 callers
Function
generate_samples
Generator over samples of a dataloader. Args: loader (DataLoader): A dataloader emitting batches like {key: [sample0_bytes, sample1_bytes,
src/convert_dataset.py:337
↓ 1 callers
Function
generate_seqlen_offsets
(seqlen_offsets_type, batch_size, seqlen, device)
tests/test_rotary.py:35
↓ 1 callers
Function
get_base_folder
(artifact_name)
download_artifacts_from_wandb.py:16
↓ 1 callers
Function
get_checkpoint_name_from_path
To go from checkpoint name to path, replace | with /
eval.py:238
↓ 1 callers
Function
get_checkpoint_name_from_path
To go from checkpoint name to path, replace | with /
glue.py:182
↓ 1 callers
Function
get_counts
(args)
src/data/get_counts_from_hf.py:59
↓ 1 callers
Function
get_counts_for_repo
(repo, args)
src/data/get_counts_from_hf.py:25
↓ 1 callers
Function
get_embedding_layer
(config: FlexBertConfig)
src/bert_layers/embeddings.py:210
↓ 1 callers
Function
get_encoder_layer
(config: FlexBertConfig)
src/bert_layers/layers.py:693
↓ 1 callers
Function
get_gpu_memory_usage
Get memory usage for a specific GPU.
run_evals.py:97
↓ 1 callers
Function
get_loss_fn
(config: FlexBertConfig)
src/bert_layers/loss.py:23
↓ 1 callers
Function
get_model_artifacts
(api, entity, project)
download_artifacts_from_wandb.py:11
↓ 1 callers
Function
get_model_defaults
(model_size: ModelSize)
generate_eval_config.py:46
↓ 1 callers
Method
get_sequence_id_from_batch
(self, batch: Dict[str, torch.Tensor])
src/text_data.py:280
← previous
next →
101–200 of 560, ranked by callers