Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/VizuaraAILabs/truly-open-gpt-oss
/ functions
Functions
69 in github.com/VizuaraAILabs/truly-open-gpt-oss
⨍
Functions
69
◇
Types & classes
9
↓ 19 callers
Function
rank0_print
(*args, **kwargs)
train.py:76
↓ 13 callers
Function
is_dist
()
train.py:73
↓ 9 callers
Function
is_dist
()
export_to_safetensors.py:50
↓ 8 callers
Method
reset_parameters
(self)
model.py:335
↓ 7 callers
Function
is_dist
()
sample.py:55
↓ 5 callers
Method
__init__
(self, cfg: ModelConfig)
model.py:310
↓ 3 callers
Method
get_batch
(self)
train.py:90
↓ 3 callers
Function
rank0_print
(*args, **kwargs)
sample.py:58
↓ 3 callers
Function
sharded_ckpt_path
(prefix: str, rank: int)
train.py:287
↓ 3 callers
Function
sharded_path
(in_dir, prefix, rank)
export_to_safetensors.py:57
↓ 2 callers
Method
_kv_expand
(self, kv: torch.Tensor)
model.py:230
↓ 2 callers
Function
_massage_cfg_for_model
Turn nested dicts into expected types (e.g., rope_scaling dict -> RopeScalingConfig).
export_to_safetensors.py:79
↓ 2 callers
Method
apply
(self, x: torch.Tensor, positions: torch.Tensor)
model.py:169
↓ 2 callers
Function
encode_corpus
(texts: List[str], enc)
prepare.py:48
↓ 2 callers
Function
gpt_oss_20b_config
()
model.py:510
↓ 2 callers
Function
rank0_print
(*a, **k)
export_to_safetensors.py:53
↓ 2 callers
Function
save_ckpt_sharded
(prefix: str, iter_n: int, best_v: float)
train.py:290
↓ 2 callers
Function
sharded_path
(out_dir, prefix, rank)
sample.py:76
↓ 2 callers
Function
write_memmap
(path: str, tokens: np.ndarray)
prepare.py:57
↓ 1 callers
Method
_build_local_mask
(T: int, device, win: int)
model.py:239
↓ 1 callers
Function
_massage_cfg_for_model
Normalize nested fields so model.py (RotaryEmbedding etc.) gets attribute-like objects.
sample.py:109
↓ 1 callers
Method
_update_cache
(self, seqlen: int, device, dtype)
model.py:153
↓ 1 callers
Function
apply_repetition_penalty
(logits, generated_ids, penalty)
sample.py:98
↓ 1 callers
Method
build_causal_mask
(T: int, device, dtype=torch.bool)
model.py:451
↓ 1 callers
Function
build_config
(name: str)
train.py:109
↓ 1 callers
Function
build_model_from_cfg
(cfg_dict: dict, device: str, args)
export_to_safetensors.py:94
↓ 1 callers
Function
build_model_from_config
(cfg: dict, device: str, args)
sample.py:121
↓ 1 callers
Function
evaluate
()
train.py:378
↓ 1 callers
Function
generate_collective
All ranks participate in forward passes (FSDP requirement). Rank 0 samples next token id and broadcasts to all ranks so sequences stay in syn
sample.py:165
↓ 1 callers
Function
get_args
()
train.py:32
↓ 1 callers
Function
get_args
()
sample.py:27
↓ 1 callers
Function
get_args
()
export_to_safetensors.py:37
↓ 1 callers
Function
get_lr
(it: int)
train.py:369
↓ 1 callers
Function
get_o200k_harmony_tokenizer
Try to get 'o200k_harmony'. If not present, fall back to 'o200k_base' and warn, but write the actual tokenizer name into meta.json so the
prepare.py:24
↓ 1 callers
Function
init_dist
()
sample.py:62
↓ 1 callers
Function
load_ckpt_full
(single_path: str)
train.py:335
↓ 1 callers
Function
load_ckpt_sharded
(prefix: str)
train.py:316
↓ 1 callers
Function
load_tokenizer
(meta_path: str)
train.py:97
↓ 1 callers
Function
main
()
train.py:160
↓ 1 callers
Function
main
()
sample.py:232
↓ 1 callers
Function
main
()
prepare.py:64
↓ 1 callers
Function
main
()
export_to_safetensors.py:170
↓ 1 callers
Function
parse_size
(s: str)
export_to_safetensors.py:61
↓ 1 callers
Method
reset_parameters
(self)
model.py:142
↓ 1 callers
Method
reset_parameters
(self)
model.py:216
↓ 1 callers
Method
reset_parameters
(self)
model.py:456
↓ 1 callers
Function
sample_text_collective
All ranks enter (so FSDP collectives don't deadlock). Only rank 0 returns the decoded text; others return "".
train.py:120
↓ 1 callers
Function
shard_state_dict_for_hf
Split a full weights dict into shards <= max_shard_bytes. Returns: shards: { filename -> {param_name: tensor, ...} } index: {"me
export_to_safetensors.py:127
↓ 1 callers
Function
swiglu
(x: torch.Tensor, clip: Optional[float] = None)
model.py:114
↓ 1 callers
Function
top_k_filter
(logits, k)
sample.py:79
↓ 1 callers
Function
top_p_filter
(logits, top_p)
sample.py:85
Method
__init__
(self, data_dir: str, split: str, block_size: int, batch_size: int, device: str, seed: int)
train.py:81
Method
__init__
(self, dim: int, eps: float = 1e-5)
model.py:98
Method
__init__
(self, head_dim: int, rope_theta: float, scale_cfg: RopeScalingConfig)
model.py:127
Method
__init__
(self, cfg: ModelConfig)
model.py:184
Method
__init__
(self, cfg: ModelConfig)
model.py:400
Method
__init__
(self, cfg: ModelConfig)
model.py:430
Method
__post_init__
(self)
model.py:77
Function
_fsdp_param_init_fn
(m: torch.nn.Module)
train.py:211
Function
_param_init_fn
(m: torch.nn.Module)
sample.py:148
Function
_param_init_fn
(m: torch.nn.Module)
export_to_safetensors.py:111
Method
forward
(self, x: torch.Tensor)
model.py:103
Method
forward
( self, x: torch.Tensor, # (B,T,H) positions: torch.Tensor, # (B,T
model.py:246
Method
forward
(self, x: torch.Tensor)
model.py:345
Method
forward
( self, x: torch.Tensor, positions: torch.Tensor, causal_mask: torch.Tensor,
model.py:414
Method
forward
( self, input_ids: torch.Tensor, # (B,T) labels: Optional[torch.Tenso
model.py:469
Method
group_size
(self)
model.py:89
Method
reset_parameters
(self)
model.py:109
Method
reset_parameters
(self)
model.py:407