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
↓ 1 callers
Function
should_split
given split proportions checks if should split Examples: >>> should_split([10,0,0]) False >>> should_split([1,.1,.2]) True
data_utils/__init__.py:35
↓ 1 callers
Function
single_dataset_provider
(split)
tasks/seq2seq/finetune.py:78
↓ 1 callers
Function
split_ds
Split a dataset into subsets given proportions of how much to allocate per split. If a split is 0% returns None for that split. Purpose:
data_utils/datasets.py:193
↓ 1 callers
Method
split_samples
(self, samples, rng)
blocklm_utils.py:283
↓ 1 callers
Function
split_strings
Split strings based on string lengths and given start.
data_utils/lazy_loader.py:97
↓ 1 callers
Function
squad_decode
(example, prediction, tokenizer)
tasks/seq2seq/evaluate.py:218
↓ 1 callers
Function
squad_fix_tokenization
(text)
tasks/seq2seq/evaluate.py:192
↓ 1 callers
Method
state_dict
(self, destination=None, prefix='', keep_vars=False)
model/distributed.py:95
↓ 1 callers
Method
state_dict
(self, destination=None, prefix='', keep_vars=False)
model/downstream.py:15
↓ 1 callers
Function
supported_corpus
checks if corpus name is defined in `corpora.py`
data_utils/__init__.py:159
↓ 1 callers
Method
switch_linear
(self, args)
learning_rates.py:87
↓ 1 callers
Function
test_boradcast_data
(model_parallel_size)
mpu/tests/test_data.py:29
↓ 1 callers
Function
test_column_parallel_linear
(model_parallel_size)
mpu/tests/test_layers.py:187
↓ 1 callers
Function
test_cross_entropy
(model_parallel_size)
mpu/tests/test_cross_entropy.py:60
↓ 1 callers
Function
test_cuda_rng_tracker
(model_parallel_size)
mpu/tests/test_random.py:88
↓ 1 callers
Function
test_get_model_parallel_src_rank
(model_parallel_size_)
mpu/tests/test_initialize.py:65
↓ 1 callers
Function
test_initialize_affine_weight
(model_parallel_size)
mpu/tests/test_layers.py:109
↓ 1 callers
Function
test_initialize_model_parallel
(model_parallel_size)
mpu/tests/test_initialize.py:26
↓ 1 callers
Function
test_model_parallel_cuda_manual_seed
(model_parallel_size)
mpu/tests/test_random.py:159
↓ 1 callers
Function
test_parallel_embedding
(model_parallel_size)
mpu/tests/test_layers.py:31
↓ 1 callers
Function
test_parallel_self_attention
(model_parallel_size)
mpu/tests/test_layers.py:361
↓ 1 callers
Function
test_parallel_transformer_layer
(model_parallel_size)
mpu/tests/test_layers.py:448
↓ 1 callers
Function
test_row_parallel_linear
(model_parallel_size)
mpu/tests/test_layers.py:254
↓ 1 callers
Function
test_set_cuda_rng_state
(model_parallel_size)
mpu/tests/test_random.py:26
↓ 1 callers
Method
to_dict
Serializes this instance to a Python dictionary.
model/modeling_bert.py:255
↓ 1 callers
Method
to_dict
Serialize this instance to a Python dictionary.
tasks/data_utils.py:71
↓ 1 callers
Method
to_json_string
Serializes this instance to a JSON string.
model/modeling_bert.py:260
↓ 1 callers
Method
to_json_string
Serialize this instance to a JSON string.
tasks/data_utils.py:76
↓ 1 callers
Method
tokenize
Tokenize a string.
data_utils/tokenization_gpt2.py:226
↓ 1 callers
Method
tokenizer
(self)
data_utils/datasets.py:310
↓ 1 callers
Function
torch_cross_entropy
(batch_size, seq_length, vocab_size, logits_scale, seed)
mpu/tests/test_cross_entropy.py:31
↓ 1 callers
Function
train
Train the model.
pretrain_glm.py:318
↓ 1 callers
Method
truncate_seq_pair
Truncate sequence pair according to original BERT implementation: https://github.com/google-research/bert/blob/master/create_pretrain
data_utils/datasets.py:1034
↓ 1 callers
Function
update_cmd
@param cmd str @param configs list of dicts
scripts/dispatcher.py:128
↓ 1 callers
Method
update_mems
(self, hiddens, mems, return_memory=False)
mpu/transformer.py:855
↓ 1 callers
Method
update_scale
(self, overflow)
fp16/loss_scaler.py:49
↓ 1 callers
Function
url_to_filename
Convert `url` into a hashed filename in a repeatable way. If `etag` is specified, append its hash to the url's, delimited by a period.
data_utils/file_utils.py:40
↓ 1 callers
Function
vocab_parallel_cross_entropy
Helper function for the cross entropy.
mpu/cross_entropy.py:107
↓ 1 callers
Method
vocab_range_from_global_vocab_size
(global_vocab_size, rank, world_size)
mpu/utils.py:67
↓ 1 callers
Method
vocab_range_from_per_partition_vocab_size
(per_partition_vocab_size, rank, world_size)
mpu/utils.py:60
↓ 1 callers
Function
white_space_fix
(text)
tasks/superglue/evaluate.py:23
↓ 1 callers
Method
write_result
(data, writers)
data_utils/corpora.py:161
↓ 1 callers
Method
zero_grad
Zero fp32 and fp16 parameter grads.
fp16/fp16.py:264
Method
DecodeAsTokens
(self, Ids)
data_utils/tokenization.py:1103
Method
DecodeIds
Convert a list or tokenization object of Ids to a text string
data_utils/tokenization.py:537
Method
DecodeIds
converts ascii ids to tokens before joining them into text
data_utils/tokenization.py:601
Method
DecodeIds
converts ids to a text string
data_utils/tokenization.py:771
Method
DecodeIds
converts ids to wordpiece tokens and joins them as a text string
data_utils/tokenization.py:904
Method
DecodeIds
(self, Ids, type_token=False)
data_utils/tokenization.py:1122
Method
DecodeIds
(self, Ids, type_token=False)
data_utils/tokenization.py:1243
Method
DecodeTokens
Convert a list or tokenization object of tokens to a text string
data_utils/tokenization.py:541
Method
DecodeTokens
just concatenates ascii tokens into text
data_utils/tokenization.py:607
Method
DecodeTokens
converts sentencepiece tokens to a text string
data_utils/tokenization.py:777
Method
DecodeTokens
converts wordpiece tokens to a text string
data_utils/tokenization.py:924
Method
DecodeTokens
(self, Tokens, type_token=False)
data_utils/tokenization.py:1129
Method
DecodeTokens
(self, Tokens, type_token=False)
data_utils/tokenization.py:1265
Method
EncodeAsIds
convert text to ascii 256 Ids
data_utils/tokenization.py:575
Method
EncodeAsIds
convert text to sentencepiece Ids
data_utils/tokenization.py:747
Method
EncodeAsIds
(self, text, process_fn=None)
data_utils/tokenization.py:1020
Method
EncodeAsTokens
Preprocess text and encode as tokens. Return a tokenization object with original text, processed text, and token tokenization.
data_utils/tokenization.py:522
Method
EncodeAsTokens
convert text to ascii 256 characters
data_utils/tokenization.py:584
Method
EncodeAsTokens
convert text to sentencepiece tokens
data_utils/tokenization.py:755
Method
EncodeAsTokens
convert wordpiece token to Id
data_utils/tokenization.py:877
Method
EncodeAsTokens
(self, text, process_fn=None)
data_utils/tokenization.py:1091
Method
EncodeAsTokens
(self, text, process_fn=None)
data_utils/tokenization.py:1214
Method
GetTokenizer
(self)
data_utils/datasets.py:99
Method
GetTokenizer
(self)
data_utils/datasets.py:173
Method
GetTokenizer
(self)
data_utils/datasets.py:402
Method
GetTokenizer
(self)
data_utils/lazy_loader.py:196
Method
IdToToken
Convert an Id to Token. Reverse lookup of self.vocab
data_utils/tokenization.py:529
Method
IdToToken
convert Id to sentencpiece token
data_utils/tokenization.py:885
Method
IdToToken
(self, Id, type_token=False)
data_utils/tokenization.py:1224
Method
SetTokenizer
(self, tokenizer)
data_utils/datasets.py:95
Method
SetTokenizer
(self, tokenizer)
data_utils/datasets.py:170
Method
SetTokenizer
logic to set and remove (set to None) tokenizer. combines preprocessing/tokenization into one callable.
data_utils/lazy_loader.py:184
Method
TokenToId
Convert a Token to Id. Lookup of self.vocab
data_utils/tokenization.py:533
Method
TokenToId
convert sentencpiece token to Id
data_utils/tokenization.py:767
Method
TokenToId
convert sentencpiece token to Id
data_utils/tokenization.py:895
Method
Train
(self, corpus)
data_utils/tokenization.py:564
Method
X
(self)
data_utils/datasets.py:126
Method
X
(self)
data_utils/datasets.py:177
Method
Y
(self)
data_utils/datasets.py:134
Method
Y
(self)
data_utils/datasets.py:183
Method
__call__
(self, name)
utils.py:163
Method
__call__
Torch method for processing logits.
generation_utils.py:395
Method
__call__
(self, input_ids: torch.LongTensor, scores: torch.FloatTensor)
generation_utils.py:410
Method
__call__
(self, input_ids: torch.LongTensor, scores: torch.FloatTensor)
generation_utils.py:437
Method
__call__
(self, input_ids: torch.LongTensor, scores: torch.FloatTensor)
generation_utils.py:459
Method
__call__
run preprocessing and encode text as Ids
data_utils/tokenization.py:269
Method
__call__
(self, text, process_fn=None)
data_utils/tokenization.py:490
Method
__call__
(self, string)
data_utils/lazy_loader.py:114
Method
__getitem__
(self, idx)
configure_data.py:76
Method
__getitem__
(self, idx)
tasks/superglue/dataset.py:97
Method
__getitem__
(self, idx)
tasks/superglue/dataset.py:199
Method
__getitem__
(self, idx)
tasks/seq2seq/dataset.py:449
Method
__getitem__
(self, idx)
tasks/seq2seq/dataset.py:594
Method
__getitem__
(self, idx)
tasks/seq2seq/dataset.py:702
Method
__getitem__
(self, idx)
tasks/seq2seq/dataset.py:822
Method
__getitem__
(self, idx)
tasks/language_model/dataset.py:37
Method
__getitem__
(self, idx)
tasks/language_model/dataset.py:109
← previous
next →
401–500 of 1,117, ranked by callers