MCPcopy Create free account

hub / github.com/THUDM/GLM / functions

Functions1,117 in github.com/THUDM/GLM

↓ 353 callersMethodappend
(self, other)
data_utils/tokenization.py:113
↓ 107 callersFunctionprint_rank_0
(message)
utils.py:44
↓ 92 callersMethodget_command
get command token corresponding to `name`
data_utils/tokenization.py:277
↓ 80 callersMethodextend
(self, other)
data_utils/tokenization.py:126
↓ 63 callersMethodshortenable
Return an instance of this string that is marked as shortenable
tasks/superglue/pvp.py:100
↓ 59 callersMethodEncodeAsIds
encode text using text tokenizer and shift Id values for command tokens
data_utils/tokenization.py:325
↓ 40 callersMethodwrite
given a generator of metrics for each of the data points X_i, write the metrics, text, and labels to a csv file
data_utils/datasets.py:333
↓ 37 callersFunctionpunctuation_standardization
(string: str)
data_utils/corpora.py:31
↓ 36 callersMethodDecodeIds
convert Ids to tokens accounting for command and type tokens, tokens are joined and returned as a string.
data_utils/tokenization.py:427
↓ 26 callersMethodexists
check if the filepath for a text tokenizer exists
data_utils/tokenization.py:507
↓ 26 callersMethodload
(module, prefix='')
model/modeling_bert.py:831
↓ 24 callersMethodprocess_sample
(cls, text, tokenizer, tokenize)
data_utils/corpora.py:169
↓ 23 callersMethod__init__
(self, config)
model/modeling_bert.py:513
↓ 22 callersMethodencode
Encode an input example using this pattern-verbalizer pair. :param example: the input example to encode :param priming: whet
tasks/superglue/pvp.py:166
↓ 19 callersMethodstart
Start the timer.
utils.py:125
↓ 15 callersMethodapply
(self, args, tokenizer)
configure_data.py:103
↓ 14 callersFunctiondivide
Ensure that numerator is divisible by the denominator and return the division value.
mpu/utils.py:26
↓ 14 callersFunctionset_random_seed
Set random seed for reproducability.
mpu/tests/commons.py:33
↓ 14 callersMethodstop
Stop the timer.
utils.py:132
↓ 13 callersFunctionget_model_parallel_group
Get the model parallel group the caller rank belongs to.
mpu/initialize.py:88
↓ 13 callersFunctionprint_separator
(message)
mpu/tests/commons.py:75
↓ 13 callersMethodremove_final_punc
Remove the final punctuation mark
tasks/superglue/pvp.py:105
↓ 11 callersFunctionbuild_input_from_ids
(text_a_ids, text_b_ids, answer_ids, max_seq_length, tokenizer, args=None, add_cls=True,
tasks/data_utils.py:144
↓ 11 callersFunctionbuild_sample
Convert to numpy and return a sample consumed by the batch producer.
tasks/data_utils.py:266
↓ 11 callersFunctionget_model_parallel_world_size
Return world size for the model parallel group.
mpu/initialize.py:102
↓ 10 callersMethodIdToToken
convert Id to token accounting for command and type tokens
data_utils/tokenization.py:407
↓ 10 callersMethodencode
(self, text)
data_utils/sp_tokenizer.py:82
↓ 10 callersMethodlowercase_first
Lowercase the first character
tasks/superglue/pvp.py:112
↓ 9 callersMethodbackward
(ctx, *args)
mpu/random.py:332
↓ 9 callersMethoddecode
(self, tokens)
data_utils/sp_tokenizer.py:85
↓ 9 callersFunctionget_model_parallel_rank
Return my rank for the model parallel group.
mpu/initialize.py:107
↓ 9 callersFunctionload_weights
Loads weights from src to dst via in place copy. src is a huggingface gpt2model, while dst is one of our models. dst2src=True loads param
utils.py:414
↓ 9 callersMethodreplace_prompt_tokens
(self, parts_a, parts_b)
tasks/superglue/pvp.py:129
↓ 9 callersMethodstate_dict
(self, destination=None, prefix='', keep_vars=False)
fp16/fp16.py:78
↓ 8 callersMethod_create_examples
(self, path: str, set_type: str, hypothesis_name: str = "hypothesis", premise_name: s
tasks/superglue/dataset.py:325
↓ 8 callersMethodclose
(self)
data_utils/lazy_loader.py:91
↓ 7 callersMethodadd
Add a new hypothesis to the list.
generation_utils.py:362
↓ 7 callersMethodget_labels
(self)
tasks/superglue/dataset.py:375
↓ 7 callersFunctionget_verbalization_ids
Get the token ids corresponding to a verbalization :param word: the verbalization :param tokenizer: the tokenizer to use :param forc
tasks/superglue/pvp.py:1369
↓ 7 callersMethodload_state_dict
(self, state_dict, strict=True)
fp16/fp16.py:81
↓ 7 callersFunctionmake_data_loader
(dataset, tokenizer, batch_size, num_iters, args, shuffle=False, block_collate=False)
configure_data.py:154
↓ 7 callersFunctionread_tsv
(path, **kwargs)
tasks/superglue/dataset.py:60
↓ 6 callersMethod__init__
(self, hidden_size, output_dropout_prob, init_method, output_layer_init_method=None)
mpu/transformer.py:362
↓ 6 callersMethod_create_examples
(self, *args, **kwargs)
tasks/superglue/dataset.py:315
↓ 6 callersFunctionexists_scatter
(path, scatter_num=64, data_type='data')
data_utils/lazy_loader.py:54
↓ 6 callersMethodfork
Fork the cuda rng state, perform operations, and exit with the original state.
mpu/random.py:169
↓ 6 callersMethodfrom_pretrained
Instantiate a PreTrainedBertModel from a pre-trained model file. Download and cache the pre-trained model file if needed.
data_utils/wordpiece.py:138
↓ 6 callersFunctionget_cuda_rng_tracker
Get cuda rng tracker.
mpu/random.py:193
↓ 6 callersFunctionnum_special_tokens_to_add
(text_a_ids, text_b_ids, answer_ids, add_cls, add_sep, add_piece, add_eos=True)
tasks/data_utils.py:93
↓ 6 callersMethodstep
If no closure is supplied, :attr:`step` should be called after ``fp16_optimizer_obj.backward(loss)``. :attr:`step` updates t
fp16/fp16.py:411
↓ 6 callersMethodtruncate
Truncate two sequences of text to a predefined total maximum length
tasks/superglue/pvp.py:338
↓ 5 callersFunction_set_cuda_rng_state
Sets the random number generator state of the current GPU. Argumentss: new_state (torch.ByteTensor): The desired state This function
mpu/random.py:85
↓ 5 callersFunctionexists_lazy
Check if we've already made a lazy version of this file for the `data_type` field.
data_utils/lazy_loader.py:34
↓ 5 callersFunctionget_lazy_path
Gets directory path where lazy files are stored.
data_utils/lazy_loader.py:27
↓ 5 callersFunctioninitialize_distributed
Initialize torch.distributed.
mpu/tests/commons.py:41
↓ 5 callersMethodlog
Log a group of timers.
utils.py:168
↓ 5 callersMethodmaybe_print
(self, msg)
fp16/fp16.py:254
↓ 5 callersFunctionsave_checkpoint
Save a model checkpoint.
utils.py:224
↓ 5 callersMethodset_command_tokens
(self, command_tokens)
data_utils/tokenization.py:80
↓ 5 callersMethodverbalize
Return all verbalizations for a given label. :param label: the label :return: the list of verbalizations
tasks/superglue/pvp.py:381
↓ 4 callersMethodSetTokenizer
(self, tokenizer)
data_utils/datasets.py:297
↓ 4 callersFunction_initialize_affine_weight
Initialize affine weight for model parallel. Build the master weight on all processes and scatter the relevant chunk.
mpu/layers.py:36
↓ 4 callersMethod_seq_length
(parts: List[Tuple[List[int], bool]], only_shortenable: bool = False)
tasks/superglue/pvp.py:330
↓ 4 callersMethod_transpose_for_scores
Transpose a 3D tensor [b, s, np*hn] into a 4D tensor with size [b, np, s, hn].
mpu/transformer.py:224
↓ 4 callersFunctionbuild_data_loader
Data loader. Note that batch-size is the local (per GPU) batch-size.
tasks/data_utils.py:362
↓ 4 callersFunctionevaluate_and_print_results
Helper function to evaluate and dump results on screen.
pretrain_glm.py:441
↓ 4 callersFunctionfinetune
Main finetune function used across all tasks.
finetune_glm.py:282
↓ 4 callersFunctionget_checkpoint_name
(checkpoints_path, iteration, release=False, zero=False)
utils.py:194
↓ 4 callersFunctionget_masks_and_position_ids
(data, eod_token, reset_position_ids,
pretrain_glm.py:47
↓ 4 callersMethodget_states
Get rng states. Copy the dictionary so we have direct pointers to the states, not just a pointer to the dictionary.
mpu/random.py:138
↓ 4 callersMethodget_text_len
(self, idx)
data_utils/datasets.py:164
↓ 4 callersFunctionload_checkpoint
Load a model checkpoint.
utils.py:327
↓ 4 callersFunctionnormalize_answer
Lower text and remove punctuation, articles and extra whitespace.
tasks/superglue/evaluate.py:17
↓ 4 callersFunctionsplit_tensor_along_last_dim
Split a tensor along its last dimension. Arguments: tensor: input tensor. num_partitions: number of partitions to split the tensor
mpu/utils.py:33
↓ 4 callersMethodtokenize
(self, text)
data_utils/sp_tokenizer.py:89
↓ 3 callersMethodGetTokenizer
(self)
data_utils/datasets.py:306
↓ 3 callersMethod__init__
(self, language_model: GLMModel, take_softmax=True, length_penalty=0.0)
model/downstream.py:9
↓ 3 callersMethod__init__
(self, args)
tasks/superglue/dataset.py:227
↓ 3 callersMethod__init__
(self, num_embeddings, embedding_dim, init_method=init.xavier_normal_, keep_
mpu/layers.py:140
↓ 3 callersMethod_create_examples
(path, set_type, for_train=False)
tasks/superglue/dataset.py:708
↓ 3 callersMethod_create_examples
(path: str, set_type: str)
tasks/superglue/dataset.py:903
↓ 3 callersMethod_create_examples
(path: str, set_type: str)
tasks/superglue/dataset.py:1175
↓ 3 callersMethod_create_examples
(self, path: str, set_type: str)
tasks/superglue/dataset.py:1342
↓ 3 callersMethod_create_examples
(self, path: str, set_type: str, cloze_eval=True)
tasks/superglue/dataset.py:1370
↓ 3 callersMethod_create_examples
(path: str, set_type: str)
tasks/superglue/dataset.py:1412
↓ 3 callersMethod_model_params_to_master_params
(self)
fp16/fp16.py:307
↓ 3 callersMethod_transpose_for_scores
Transpose a 3D tensor [b, s, np*hn] into a 4D tensor with size [b, np, s, hn].
mpu/transformer.py:98
↓ 3 callersMethodbackward
:attr:`backward` performs the following conceptual steps: 1. fp32_loss = loss.float() (see first Note below) 2. scaled_loss
fp16/fp16.py:506
↓ 3 callersMethodcontains_sentence_end
(self, tok)
blocklm_utils.py:76
↓ 3 callersMethodcontains_sentence_end
(self, tok)
data_utils/datasets.py:698
↓ 3 callersMethodcumsum
(sequence)
data_utils/datasets.py:68
↓ 3 callersMethodelapsed
Calculate the elapsed time.
utils.py:144
↓ 3 callersMethodencode
(self, example: InputExample, tokenizer, seq_length, args)
tasks/superglue/dataset.py:268
↓ 3 callersFunctionget_args
Parse all the args.
arguments.py:398
↓ 3 callersFunctionget_batch
get_batch subdivides the source data into chunks of length args.seq_length. If source is equal to the example output of the data loading exam
pretrain_glm.py:144
↓ 3 callersMethodget_lr
(self)
learning_rates.py:40
↓ 3 callersFunctionget_scatter_path
(path, scatter_rank)
data_utils/lazy_loader.py:48
↓ 3 callersFunctioninitialize_distributed
Initialize torch.distributed.
pretrain_glm.py:476
↓ 3 callersFunctionlm_forward_step
Forward step.
tasks/language_model/finetune.py:33
↓ 3 callersMethodpad_seq
(self, seq, pad_id=None)
data_utils/datasets.py:563
next →1–100 of 1,117, ranked by callers