Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ByteDance-Seed/AHN
/ functions
Functions
289 in github.com/ByteDance-Seed/AHN
⨍
Functions
289
◇
Types & classes
48
↳
Endpoints
2
↓ 1 callers
Function
process_args
(args)
eval/lveval/pred.py:222
↓ 1 callers
Function
process_pt_shard
(src: Path, dst: Path, old: str, new: str, dry: bool)
examples/scripts/utils/rename_sd.py:50
↓ 1 callers
Function
process_pt_shard
(src: Path, dst: Path, old: str, new: str, dry: bool)
examples/scripts/deprecated/rename_sd.py:50
↓ 1 callers
Function
process_safetensors_shard
(src: Path, dst: Path, old: str, new: str, dry: bool)
examples/scripts/utils/rename_sd.py:25
↓ 1 callers
Function
process_safetensors_shard
(src: Path, dst: Path, old: str, new: str, dry: bool)
examples/scripts/deprecated/rename_sd.py:25
↓ 1 callers
Function
read_index_json
If an index file exists (for sharded checkpoints), return {param_key: shard_file}.
examples/scripts/utils/split_weights.py:33
↓ 1 callers
Function
remove_articles
(text)
eval/longbench/metrics.py:25
↓ 1 callers
Function
remove_articles
(text)
eval/lveval/metrics.py:33
↓ 1 callers
Method
reset_parameters
(self)
src/ahn/utils.py:62
↓ 1 callers
Function
rouge_score
(prediction, ground_truth, **kwargs)
eval/longbench/metrics.py:120
↓ 1 callers
Function
scorer
(dataset, predictions, answers, all_classes)
eval/longbench/eval.py:89
↓ 1 callers
Function
scorer
(dataset, predictions, answers, gold_anss)
eval/lveval/eval.py:22
↓ 1 callers
Function
scorer_e
(dataset, predictions, answers, lengths, all_classes)
eval/longbench/eval.py:65
↓ 1 callers
Function
seed_everything
(seed)
eval/longbench/pred.py:217
↓ 1 callers
Function
seed_everything
(seed)
eval/lveval/utils.py:28
↓ 1 callers
Function
single_processing
(datasets, args)
eval/lveval/pred.py:190
↓ 1 callers
Function
str_to_dtype
(name: str)
examples/scripts/inference.py:60
↓ 1 callers
Method
trim_cache
Evict key-value tokens from the cache after compression into memory.
src/ahn/transformer/qwen2_ahn/qwen2_ahn.py:1086
↓ 1 callers
Method
trim_cache
Evict key-value tokens from the cache after compression into memory.
src/ahn/transformer/qwen3_ahn/qwen3_ahn.py:1075
↓ 1 callers
Function
truncate_prompt
(tokenizer, prompt, max_length)
eval/lveval/utils.py:133
Method
__init__
( self, in_features: int, out_features: int, num_groups: int, use_bias
src/ahn/utils.py:30
Method
__init__
(self, num_heads: int, head_dim: int, use_dimwise_pos: bool = False)
src/ahn/utils.py:184
Method
__init__
Qwen3RMSNorm is equivalent to T5LayerNorm
src/ahn/transformer/qwen3/modeling_qwen3.py:64
Method
__init__
(self, config: Qwen3Config, layer_idx: int)
src/ahn/transformer/qwen3/modeling_qwen3.py:174
Method
__init__
(self, config: Qwen3Config, layer_idx: int)
src/ahn/transformer/qwen3/modeling_qwen3.py:258
Method
__init__
(self, config: Qwen3Config, device=None)
src/ahn/transformer/qwen3/modeling_qwen3.py:317
Method
__init__
(self, config: Qwen3Config)
src/ahn/transformer/qwen3/modeling_qwen3.py:476
Method
__init__
(self, config)
src/ahn/transformer/qwen3/modeling_qwen3.py:834
Method
__init__
(self, config)
src/ahn/transformer/qwen3/modeling_qwen3.py:964
Method
__init__
(self, config)
src/ahn/transformer/qwen3/modeling_qwen3.py:1057
Method
__init__
(self, config)
src/ahn/transformer/qwen3/modeling_qwen3.py:1141
Method
__init__
( self, vocab_size=151936, hidden_size=4096, intermediate_size=22016,
src/ahn/transformer/qwen3/configuration_qwen3.py:152
Method
__init__
(self, config: Qwen2Config, layer_idx: int)
src/ahn/transformer/qwen2/modeling_qwen2.py:138
Method
__init__
Qwen2RMSNorm is equivalent to T5LayerNorm
src/ahn/transformer/qwen2/modeling_qwen2.py:212
Method
__init__
(self, config: Qwen2Config, layer_idx: int)
src/ahn/transformer/qwen2/modeling_qwen2.py:232
Method
__init__
(self, config: Qwen2Config, device=None)
src/ahn/transformer/qwen2/modeling_qwen2.py:289
Method
__init__
(self, config: Qwen2Config)
src/ahn/transformer/qwen2/modeling_qwen2.py:448
Method
__init__
(self, config)
src/ahn/transformer/qwen2/modeling_qwen2.py:740
Method
__init__
(self, config)
src/ahn/transformer/qwen2/modeling_qwen2.py:870
Method
__init__
(self, config)
src/ahn/transformer/qwen2/modeling_qwen2.py:963
Method
__init__
(self, config)
src/ahn/transformer/qwen2/modeling_qwen2.py:1047
Method
__init__
( self, vocab_file=None, merges_file=None, tokenizer_file=None, unk_to
src/ahn/transformer/qwen2/tokenization_qwen2_fast.py:83
Method
__init__
( self, vocab_size=151936, hidden_size=4096, intermediate_size=22016,
src/ahn/transformer/qwen2/configuration_qwen2.py:132
Method
__init__
( self, vocab_file, merges_file, errors="replace", unk_token="<|endoft
src/ahn/transformer/qwen2/tokenization_qwen2.py:137
Method
__init__
( self, loss_type: Optional[str] = "ce", _layer_implementation: Optional[str] = "Qwen2
src/ahn/transformer/qwen2_ahn/qwen2_ahn.py:74
Method
__init__
(self, *args, **kwargs)
src/ahn/transformer/qwen2_ahn/qwen2_ahn.py:113
Method
__init__
(self, config, do_train: bool = False)
src/ahn/transformer/qwen2_ahn/qwen2_ahn.py:720
Method
__init__
( self, config: Qwen2Config, layer_idx: int, ahn_cls_name: str = "GatedDeltaNet" )
src/ahn/transformer/qwen2_ahn/qwen2_ahn.py:1049
Method
__init__
( self, loss_type: Optional[str] = "ce", _layer_implementation: Optional[str] = "Qwen3
src/ahn/transformer/qwen3_ahn/qwen3_ahn.py:76
Method
__init__
(self, *args, **kwargs)
src/ahn/transformer/qwen3_ahn/qwen3_ahn.py:115
Method
__init__
(self, config, do_train: bool = False)
src/ahn/transformer/qwen3_ahn/qwen3_ahn.py:713
Method
__init__
( self, config: Qwen3Config, layer_idx: int, ahn_cls_name: str = "GatedDeltaNe
src/ahn/transformer/qwen3_ahn/qwen3_ahn.py:1034
Method
__init__
( self, mode: str = 'chunk', d_model: int = None, hidden_size: int = 1024,
src/ahn/rnn/delta_net.py:82
Method
__init__
( self, num_heads: int = 8, head_dim: int = 128, hidden_size: int = 1024,
src/ahn/rnn/mamba2.py:120
Method
__init__
( self, hidden_size: int = 2048, expand_v: float = 1, head_dim: int = 256,
src/ahn/rnn/gated_deltanet.py:93
Method
_convert_id_to_token
Converts an index (integer) in a token (str) using the vocab.
src/ahn/transformer/qwen2/tokenization_qwen2.py:278
Method
_convert_token_to_id
Converts a token (str) in an id using the vocab.
src/ahn/transformer/qwen2/tokenization_qwen2.py:273
Method
_init_weights
(self, module)
src/ahn/transformer/qwen3/modeling_qwen3.py:385
Method
_init_weights
(self, module)
src/ahn/transformer/qwen2/modeling_qwen2.py:357
Method
_init_weights
(model: nn.Module)
src/ahn/transformer/qwen2_ahn/qwen2_ahn.py:755
Method
_init_weights
(model: nn.Module)
src/ahn/transformer/qwen3_ahn/qwen3_ahn.py:748
Function
_init_worker
(args)
eval/lveval/pred.py:41
Function
_mp_fn
(index)
src/train.py:26
Method
_tokenize
Tokenize a string.
src/ahn/transformer/qwen2/tokenization_qwen2.py:262
Method
_update_model_kwargs_for_generation
( self, outputs: ModelOutput, model_kwargs: Dict[str, Any], is_encoder_decoder
src/ahn/transformer/qwen2_ahn/qwen2_ahn.py:988
Method
_update_model_kwargs_for_generation
( self, outputs: ModelOutput, model_kwargs: Dict[str, Any], is_encoder_decoder
src/ahn/transformer/qwen3_ahn/qwen3_ahn.py:973
Function
apply_mask_to_padding_states
Tunes out the hidden states for padding tokens, see https://github.com/state-spaces/mamba/issues/66
src/ahn/rnn/mamba2.py:49
Function
classification_score
(prediction, ground_truth, **kwargs)
eval/longbench/metrics.py:104
Function
code_sim_score
(prediction, ground_truth, **kwargs)
eval/longbench/metrics.py:94
Function
compare_models
(new_model, model, atol=1e-6, rtol=1e-5)
examples/scripts/utils/model_compare.py:3
Method
convert_tokens_to_string
Converts a sequence of tokens (string) in a single string.
src/ahn/transformer/qwen2/tokenization_qwen2.py:283
Function
count_score
(prediction, ground_truth, **kwargs)
eval/longbench/metrics.py:58
Method
ctx_sliding_window_mask
(b, h, q_idx, kv_idx)
src/ahn/transformer/qwen2_ahn/qwen2_ahn.py:428
Method
ctx_sliding_window_mask
(b, h, q_idx, kv_idx)
src/ahn/transformer/qwen3_ahn/qwen3_ahn.py:431
Function
custom_sort
(s)
eval/lveval/eval.py:17
Method
default_forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
src/ahn/transformer/qwen2_ahn/qwen2_ahn.py:1167
Method
default_forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
src/ahn/transformer/qwen3_ahn/qwen3_ahn.py:1157
Function
dump_preds_results_once
(pred, save_path)
eval/lveval/utils.py:45
Function
eager_attention_forward
( module: nn.Module, query: torch.Tensor, key: torch.Tensor, value: torch.Tensor, attentio
src/ahn/transformer/qwen3/modeling_qwen3.py:145
Function
eager_attention_forward
( module: nn.Module, query: torch.Tensor, key: torch.Tensor, value: torch.Tensor, attentio
src/ahn/transformer/qwen2/modeling_qwen2.py:109
Function
elu_p1
(x)
src/ahn/rnn/delta_net.py:33
Function
elu_p1
(x)
src/ahn/rnn/gated_deltanet.py:37
Function
evaluate
(mix)
eval/lveval/pred.py:88
Method
extra_repr
(self)
src/ahn/transformer/qwen3/modeling_qwen3.py:79
Method
extra_repr
(self)
src/ahn/transformer/qwen2/modeling_qwen2.py:227
Method
forward
(self, x)
src/ahn/utils.py:65
Method
forward
( self, hidden_states: torch.Tensor, q_states: torch.Tensor, k_states: torch.T
src/ahn/utils.py:158
Method
forward
( self, pos_ratio: torch.FloatTensor, h_mem: torch.Tensor, h_local: torch.Tensor )
src/ahn/utils.py:198
Method
forward
(self, hidden_states)
src/ahn/transformer/qwen3/modeling_qwen3.py:72
Method
forward
(self, x)
src/ahn/transformer/qwen3/modeling_qwen3.py:94
Method
forward
( self, hidden_states: torch.Tensor, position_embeddings: Tuple[torch.Tensor, torch.Te
src/ahn/transformer/qwen3/modeling_qwen3.py:206
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
src/ahn/transformer/qwen3/modeling_qwen3.py:273
Method
forward
(self, x, position_ids)
src/ahn/transformer/qwen3/modeling_qwen3.py:336
Method
forward
( self, input_ids: Optional[torch.LongTensor] = None, attention_mask: Optional[torch.T
src/ahn/transformer/qwen3/modeling_qwen3.py:500
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*): Labels for computing the masked lan
src/ahn/transformer/qwen3/modeling_qwen3.py:865
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the sequence classification/regression
src/ahn/transformer/qwen3/modeling_qwen3.py:981
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the sequence classification/regression
src/ahn/transformer/qwen3/modeling_qwen3.py:1086
Method
forward
r""" start_positions (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for position (index) of the start of the la
src/ahn/transformer/qwen3/modeling_qwen3.py:1157
Method
forward
(self, x)
src/ahn/transformer/qwen2/modeling_qwen2.py:58
Method
forward
( self, hidden_states: torch.Tensor, position_embeddings: Tuple[torch.Tensor, torch.Te
src/ahn/transformer/qwen2/modeling_qwen2.py:152
← previous
next →
101–200 of 289, ranked by callers