Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Om-Alve/smolGPT
/ functions
Functions
32 in github.com/Om-Alve/smolGPT
⨍
Functions
32
◇
Types & classes
10
↓ 4 callers
Method
__init__
(self, config)
model.py:138
↓ 3 callers
Method
encode
(self, s: str, bos: bool, eos: bool)
tokenizer.py:18
↓ 2 callers
Method
apply_rotary_emb
(self, x, cos, sin)
model.py:37
↓ 2 callers
Method
decode
(self, tokens: List[int])
tokenizer.py:26
↓ 2 callers
Function
download
()
preprocess.py:35
↓ 2 callers
Method
generate
( self, idx, max_new_tokens, temperature=1.0, top_k=None, top_p=None, min_p=None )
model.py:232
↓ 2 callers
Function
pretokenize
(vocab_size: int)
preprocess.py:101
↓ 2 callers
Function
train_vocab
(vocab_size: int)
preprocess.py:50
↓ 1 callers
Method
configure_optimizers
(self, weight_decay, learning_rate, betas, device_type)
model.py:202
↓ 1 callers
Function
download_file
(url: str, filename: str, chunk_size: int = 1024)
preprocess.py:19
↓ 1 callers
Function
estimate_loss
()
train.py:108
↓ 1 callers
Function
get_lr
(it)
train.py:124
↓ 1 callers
Function
load_model
(args)
sample.py:86
↓ 1 callers
Function
main
()
sample.py:105
↓ 1 callers
Function
parse_args
()
sample.py:9
↓ 1 callers
Function
prepare_dataset
(vocab_size: int)
preprocess.py:110
↓ 1 callers
Function
setup_device
(args)
sample.py:69
Method
__init__
(self, tokenizer_model)
tokenizer.py:8
Method
__init__
(self, split: str, max_seq_len: int)
dataset.py:10
Method
__init__
(self, dim, base=10_000)
model.py:12
Method
__init__
(self, config: GPTConfig)
model.py:48
Method
__init__
(self, config)
model.py:110
Method
__init__
(self, config)
model.py:124
Method
__iter__
(self)
dataset.py:15
Method
_init_weights
(self, module)
model.py:168
Method
forward
(self, q, k)
model.py:21
Method
forward
(self, x)
model.py:72
Method
forward
(self, x)
model.py:119
Method
forward
(self, x)
model.py:131
Method
forward
(self, idx, targets=None)
model.py:176
Method
iter_batches
( batch_size: int, device: str, num_workers: int = 0, **dataset_kwargs )
dataset.py:45
Function
process_shard
(args: tuple, vocab_size: int)
preprocess.py:80