Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/THUDM/GLM
/ functions
Functions
1,117 in github.com/THUDM/GLM
⨍
Functions
1,117
◇
Types & classes
200
↓ 2 callers
Function
unscaled_init_method
Init method based on N(0, sigma).
mpu/transformer.py:584
↓ 2 callers
Method
update_master_grads
Copy the ``.grad`` attribute from stored references to fp16 parameters to the ``.grad`` attribute of the fp32 master parameters that
fp16/fp16.py:568
↓ 2 callers
Function
wrap_dataset
(dataset)
data_utils/__init__.py:184
↓ 2 callers
Method
write
(self, s)
data_utils/lazy_loader.py:79
↓ 1 callers
Function
BN_convert_float
Utility function for network_to_half(). Retained for legacy purposes.
fp16/fp16util.py:39
↓ 1 callers
Method
DecodeTokens
convert tokens to a string accounting for command and type tokens.
data_utils/tokenization.py:453
↓ 1 callers
Method
EncodeAsIds
Preprocess text and encode as ids. Return a tokenization object with original text, processed text, and id tokenization.
data_utils/tokenization.py:515
↓ 1 callers
Method
EncodeAsTokens
encode text as tokens using text tokenizer
data_utils/tokenization.py:399
↓ 1 callers
Method
IdToToken
convert Id to sentencpiece token
data_utils/tokenization.py:763
↓ 1 callers
Method
IdToToken
(self, Id, type_token=False)
data_utils/tokenization.py:1106
↓ 1 callers
Method
SetTokenizer
(self, tokenizer)
data_utils/datasets.py:393
↓ 1 callers
Method
TokenToId
convert token to Id accounting for command and type tokens
data_utils/tokenization.py:417
↓ 1 callers
Method
TokenToId
ascii character to index
data_utils/tokenization.py:597
↓ 1 callers
Method
TokenToId
(self, token, type_token=False)
data_utils/tokenization.py:1115
↓ 1 callers
Method
TokenToId
(self, token, type_token=False)
data_utils/tokenization.py:1236
↓ 1 callers
Method
Train
train a tokenizer on a data corpus and save model for future use
data_utils/tokenization.py:511
↓ 1 callers
Method
Train
train sentencepiece model on corpus using word frequencies
data_utils/tokenization.py:719
↓ 1 callers
Method
__init__
(self, defaults=None)
configure_data.py:97
↓ 1 callers
Method
__init__
(self, num_layers, vocab_size, hidden_size,
model/modeling_glm.py:47
↓ 1 callers
Method
__init__
(self)
fp16/fp16util.py:32
↓ 1 callers
Method
__init__
(self, text_loader, mask_loader, **kwargs)
data_utils/corpora.py:39
↓ 1 callers
Method
__init__
(self, ds, tokenizer, max_seq_len=1024, mem_len=None, sample_across_doc=True, **kwargs)
data_utils/datasets.py:502
↓ 1 callers
Method
__init__
(self, m , n)
mpu/tests/test_layers.py:179
↓ 1 callers
Method
_batch
extracts samples only pertaining to this worker's batch
data_utils/samplers.py:105
↓ 1 callers
Function
_build_infinite_size_dataloader
Build a looped dataloader with infinite size.
finetune_glm.py:163
↓ 1 callers
Function
_build_key_size_numel_dictionaries
Build the size on rank 0 and broadcast.
mpu/data.py:33
↓ 1 callers
Function
_build_train_valid_dataloaders
Traing and validation dataloaders.
finetune_glm.py:174
↓ 1 callers
Method
_calc_banned_ngram_tokens
Copied from fairseq for no_repeat_ngram in beam_search
generation_utils.py:469
↓ 1 callers
Function
_check_data_types
Check that all the keys have the same target data type.
mpu/data.py:26
↓ 1 callers
Method
_check_overflow
(self)
fp16/fp16.py:290
↓ 1 callers
Method
_clean_text
Performs invalid character removal and whitespace cleanup on text.
data_utils/wordpiece.py:279
↓ 1 callers
Function
_compare
(s1, s2)
tasks/seq2seq/dataset.py:246
↓ 1 callers
Method
_create_examples
(self, path: str, set_type: str, cloze_eval=True)
tasks/superglue/dataset.py:432
↓ 1 callers
Method
_create_examples
(path, set_type, seed=42, max_train_candidates_per_question: int = 10, for_train=False)
tasks/superglue/dataset.py:806
↓ 1 callers
Method
_downscale_master
(self)
fp16/fp16.py:317
↓ 1 callers
Method
_encode
(self, text)
data_utils/tokenization.py:396
↓ 1 callers
Method
_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
data_utils/wordpiece.py:257
↓ 1 callers
Function
_is_control
Checks whether `chars` is a control character.
data_utils/wordpiece.py:365
↓ 1 callers
Function
_is_punctuation
Checks whether `chars` is a punctuation character.
data_utils/wordpiece.py:377
↓ 1 callers
Function
_is_whitespace
(c)
tasks/seq2seq/dataset.py:236
↓ 1 callers
Function
_is_whitespace
Checks whether `chars` is a whitespace character.
data_utils/wordpiece.py:353
↓ 1 callers
Function
_launch_experiment
(gpu, config, args)
scripts/dispatcher.py:224
↓ 1 callers
Method
_load_verbalizer_from_file
(path: str, pattern_id: int)
tasks/superglue/pvp.py:397
↓ 1 callers
Method
_model_grads_to_master_grads
(self)
fp16/fp16.py:313
↓ 1 callers
Method
_rel_shift
(x, zero_triu=False)
mpu/transformer.py:235
↓ 1 callers
Method
_run_split_on_punc
Splits punctuation on a piece of text.
data_utils/wordpiece.py:222
↓ 1 callers
Method
_run_strip_accents
Strips accents from a piece of text.
data_utils/wordpiece.py:211
↓ 1 callers
Method
_step_with_closure
(self, closure)
fp16/fp16.py:467
↓ 1 callers
Method
_tokenize_chinese_chars
Adds whitespace around any CJK character.
data_utils/wordpiece.py:244
↓ 1 callers
Function
_train
Train the model.
finetune_glm.py:193
↓ 1 callers
Function
add_data_args
Train/valid/test data arguments.
arguments.py:265
↓ 1 callers
Function
add_evaluation_args
Evaluation arguments.
arguments.py:221
↓ 1 callers
Function
add_finetune_config_args
(parser)
arguments.py:357
↓ 1 callers
Function
add_fp16_config_args
Mixed precision arguments.
arguments.py:78
↓ 1 callers
Function
add_model_config_args
Model arguments
arguments.py:26
↓ 1 callers
Function
add_text_generate_args
Text generate arguments.
arguments.py:248
↓ 1 callers
Function
add_training_args
Training arguments.
arguments.py:107
↓ 1 callers
Method
allreduce_params
(reduce_after=True, no_scale=False, fp32_allreduce=False)
model/distributed.py:51
↓ 1 callers
Method
apply_defaults
(self, args)
configure_data.py:113
↓ 1 callers
Method
available_patterns
()
tasks/superglue/pvp.py:126
↓ 1 callers
Method
backward
(self, loss, retain_graph=False)
fp16/loss_scaler.py:59
↓ 1 callers
Function
backward_step
Backward step.
train_utils.py:270
↓ 1 callers
Function
blanklm_fix_tokenization
(text)
tasks/seq2seq/evaluate.py:393
↓ 1 callers
Method
bpe
(self, token)
data_utils/tokenization_gpt2.py:185
↓ 1 callers
Function
build_decoder_input
(enc_ids, answer_ids, max_seq_length, max_dec_seq_length, tokenizer)
tasks/data_utils.py:233
↓ 1 callers
Function
build_decoder_sample
(sample, dec_ids, dec_position, dec_masks, dec_target, dec_logit_mask)
tasks/data_utils.py:301
↓ 1 callers
Function
build_lambada_dataset
Build lambada dataset.
tasks/language_model/dataset.py:148
↓ 1 callers
Function
build_lm_dataset
(tokenizer, args)
tasks/language_model/dataset.py:156
↓ 1 callers
Function
build_multi_task_dataset
(args, tokenizer)
configure_data.py:348
↓ 1 callers
Function
build_uni_input_from_ids
(text_a_ids, answer_ids, max_seq_length, tokenizer, args=None, add_cls=True, add_sep=
tasks/data_utils.py:106
↓ 1 callers
Function
build_wikitext103_dataset
(tokenizer, args)
tasks/language_model/dataset.py:172
↓ 1 callers
Function
bytes_to_unicode
Returns list of utf-8 byte and a corresponding list of unicode strings. The reversible bpe codes work on unicode strings. This means you
data_utils/tokenization_gpt2.py:54
↓ 1 callers
Function
chain_configs
@param configs list of configurations
scripts/dispatcher.py:112
↓ 1 callers
Function
checkpoint
Checkpoint a model or part of the model. This has been directly copied from torch.utils.checkpoint.
mpu/random.py:375
↓ 1 callers
Function
clean_text
Remove new lines and multiple spaces and adjust end of sentence dot.
tasks/data_utils.py:32
↓ 1 callers
Method
clip_master_grads
Clips fp32 master gradients via ``torch.nn.utils.clip_grad_norm``. Args: max_norm (float or int): max norm of the gradie
fp16/fp16.py:324
↓ 1 callers
Function
configure_data
add cmdline flags for configuring datasets
configure_data.py:401
↓ 1 callers
Function
convert_glm_checkpoint_to_transformers
(checkpoint_path, copy_dict=None)
scripts/convert_glm_checkpoint_to_transformers.py:17
↓ 1 callers
Method
convert_id_to_token
(self, idx)
data_utils/sp_tokenizer.py:126
↓ 1 callers
Function
convert_module
Converts a module's immediate parameters and buffers to dtype.
fp16/fp16util.py:61
↓ 1 callers
Function
convert_network
Converts a network's parameters and buffers to dtype.
fp16/fp16util.py:77
↓ 1 callers
Method
convert_token_to_id
(self, token)
data_utils/sp_tokenizer.py:123
↓ 1 callers
Method
convert_tokens_to_ids
(self, tokens)
data_utils/sp_tokenizer.py:94
↓ 1 callers
Method
convert_tokens_to_ids
Converts a sequence of tokens into ids using the vocab.
data_utils/tokenization_gpt2.py:237
↓ 1 callers
Method
create_examples
(self, split)
tasks/seq2seq/dataset.py:113
↓ 1 callers
Method
create_masked_lm_predictions
Mask sequence pair for BERT training according to: https://github.com/google-research/bert/blob/master/create_pretraining_data.py#L33
data_utils/datasets.py:1090
↓ 1 callers
Method
create_random_sentencepair
fetches a random sentencepair corresponding to rng state similar to https://github.com/google-research/bert/blob/master/create_pretra
data_utils/datasets.py:951
↓ 1 callers
Method
data_iterator
iterates through data and handles wrap around
data_utils/samplers.py:152
↓ 1 callers
Method
encode
(self, text)
data_utils/tokenization_gpt2.py:269
↓ 1 callers
Function
evaluate
Evaluation.
pretrain_glm.py:387
↓ 1 callers
Function
evaluate
Evaluation.
tasks/language_model/finetune.py:138
↓ 1 callers
Function
evaluate_and_print_results
Evaluate and print results on screen.
tasks/language_model/finetune.py:162
↓ 1 callers
Function
finetune_forward_step
Simple forward step with cross-entropy loss.
finetune_glm.py:81
↓ 1 callers
Function
fp16_to_fp32
Convert fp16 `val` to fp32
fp16/fp16.py:53
↓ 1 callers
Function
fp32_to_fp16
Convert fp32 `val` to fp16
fp16/fp16.py:39
↓ 1 callers
Method
freeze_transformer
(self, tune_prefix_layers=None)
model/modeling_glm.py:97
↓ 1 callers
Method
from_dict
Constructs a `BertConfig` from a Python dictionary of parameters.
model/modeling_bert.py:238
↓ 1 callers
Method
from_json_file
Constructs a `BertConfig` from a json file of parameters.
model/modeling_bert.py:246
↓ 1 callers
Function
gelu
(x)
mpu/transformer.py:339
↓ 1 callers
Function
gelu_impl
OpenAI's gelu implementation.
mpu/transformer.py:333
← previous
next →
201–300 of 1,117, ranked by callers