Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Edward-Sun/SLM
/ functions
Functions
31 in github.com/Edward-Sun/SLM
⨍
Functions
31
◇
Types & classes
7
↓ 3 callers
Method
__init__
Constructs SLMConfig.
codes/model.py:24
↓ 2 callers
Method
restore
(self, uchars, segments)
codes/tokenization.py:107
↓ 2 callers
Method
to_json_string
Serializes this instance to a JSON string.
codes/model.py:77
↓ 1 callers
Method
_is_chinese_char
Checks whether uchar is the codepoint of a CJK character.
codes/tokenization.py:119
↓ 1 callers
Method
from_dict
Constructs a `SLMConfig` from a Python dictionary of parameters.
codes/model.py:58
↓ 1 callers
Method
from_json_file
Constructs a `SLMConfig` from a json file of parameters.
codes/model.py:66
↓ 1 callers
Method
get_init_states
(self, batch_size)
codes/model.py:345
↓ 1 callers
Function
main
(args)
codes/run.py:118
↓ 1 callers
Method
one_shot_iterator
Transform a PyTorch Dataloader into python iterator
codes/dataloader.py:141
↓ 1 callers
Method
padding_collate
(batch)
codes/dataloader.py:102
↓ 1 callers
Function
parse_args
(args=None)
codes/run.py:30
↓ 1 callers
Method
sent_tokenize
(self, sent)
codes/tokenization.py:48
↓ 1 callers
Function
set_logger
Write logs to checkpoint and console
codes/run.py:95
↓ 1 callers
Method
to_dict
Serializes this instance to a Python dictionary.
codes/model.py:72
↓ 1 callers
Method
to_json_file
Serializes this instance to a JSON file.
codes/model.py:81
↓ 1 callers
Method
tokenize
Tokenize uchar
codes/tokenization.py:144
↓ 1 callers
Method
word2id
(self, word)
codes/tokenization.py:39
Method
__getitem__
(self, index)
codes/dataloader.py:78
Method
__init__
(self, vocab_file, max_seq_length=32, segment_token=' ',
codes/tokenization.py:9
Method
__init__
(self, input_files, tokenizer, is_training=False,
codes/dataloader.py:15
Method
__init__
(self, dataloader)
codes/dataloader.py:132
Method
__init__
Constructor for BertModel.
codes/model.py:91
Method
__init__
(self, input_size, hidden_size, layer_number, dropout_rate)
codes/model.py:321
Method
__init__
(self, hidden_size, output_size, layer_number, dropout_rate)
codes/model.py:350
Method
__len__
(self)
codes/dataloader.py:72
Method
__next__
(self)
codes/dataloader.py:136
Method
forward
(self, x, lengths, segments=None, mode='unsupervised')
codes/model.py:145
Method
forward
(self, rnn_input, lengths, init_states)
codes/model.py:337
Method
forward
(self, rnn_input, init_states)
codes/model.py:364
Method
id2word
(self, _id)
codes/tokenization.py:45
Method
single_collate
(batch)
codes/dataloader.py:128