Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/OpenSparseLLMs/Linear-MoE
/ functions
Functions
1,498 in github.com/OpenSparseLLMs/Linear-MoE
⨍
Functions
1,498
◇
Types & classes
227
Method
checkpoint_handler
(forward_func)
linear_moe/model/deepseek_v2/hybrid/hybrid_transformer_block.py:222
Method
checkpoint_handler
(forward_func)
linear_moe/model/llama3/hybrid/hybrid_transformer_block.py:236
Method
cls
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:59
Method
contains_sentence_end
(self, idx)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:308
Function
contiguous
(fn)
linear_moe/utils.py:8
Method
convert_tokens_to_ids
(self, tokens)
linear_moe/tokenizer/jiebabpe_tokenizer.py:72
Method
convert_tokens_to_string
Converts a sequence of tokens in a single string.
linear_moe/tokenizer/tokenization_qwen_vl.py:266
Method
convert_tokens_to_string
Converts a sequence of tokens (string) in a single string.
linear_moe/tokenizer/tokenization_baichuan.py:106
Method
convert_tokens_to_string
Converts a sequence of tokens (string) in a single string.
linear_moe/tokenizer/tokenization_yi.py:119
Method
create_token_type_ids_from_sequences
Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An ALBERT sequence pair mask has the
linear_moe/tokenizer/tokenization_baichuan.py:200
Method
create_token_type_ids_from_sequences
Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An ALBERT sequence pair mask has the
linear_moe/tokenizer/tokenization_yi.py:224
Function
cross_entropy_loss_func
(labels, output_tensor)
linear_moe/finetune_utils.py:50
Method
custom
(start: int, end: int)
linear_moe/model/mixtral/transformer_block.py:220
Method
custom
(start: int, end: int)
linear_moe/model/mixtral/hybrid/hybrid_transformer_block.py:212
Method
custom
(start: int, end: int)
linear_moe/model/qwen2/transformer_block.py:220
Method
custom
(start: int, end: int)
linear_moe/model/qwen2/hybrid/hybrid_transformer_block.py:212
Method
custom
(start: int, end: int)
linear_moe/model/deepseek_v2/transformer_block.py:209
Method
custom
(start: int, end: int)
linear_moe/model/deepseek_v2/hybrid/hybrid_transformer_block.py:196
Method
custom
(start, end)
linear_moe/model/llama3/transformer_legacy.py:1615
Method
custom
(start: int, end: int)
linear_moe/model/llama3/hybrid/hybrid_transformer_block.py:212
Method
custom_forward
( hidden_states, attention_mask, context, cont
linear_moe/model/mixtral/transformer_block.py:221
Method
custom_forward
( hidden_states, attention_mask, context, cont
linear_moe/model/mixtral/hybrid/hybrid_transformer_block.py:213
Method
custom_forward
(*inputs)
linear_moe/model/mixtral/transformer/attention.py:125
Method
custom_forward
( hidden_states, attention_mask, context, cont
linear_moe/model/qwen2/transformer_block.py:221
Method
custom_forward
( hidden_states, attention_mask, context, cont
linear_moe/model/qwen2/hybrid/hybrid_transformer_block.py:213
Method
custom_forward
(*inputs)
linear_moe/model/qwen2/transformer/attention.py:125
Method
custom_forward
(hidden_states)
linear_moe/model/qwen2/moe/moe_layer.py:157
Method
custom_forward
( hidden_states, position_ids, attention_mask,
linear_moe/model/deepseek_v2/transformer_block.py:210
Method
custom_forward
( hidden_states, position_ids, attention_mask,
linear_moe/model/deepseek_v2/hybrid/hybrid_transformer_block.py:197
Method
custom_forward
(*inputs)
linear_moe/model/deepseek_v2/transformer/attention.py:137
Method
custom_forward
(*inputs)
linear_moe/model/llama3/transformer_legacy.py:620
Method
custom_forward
(*args, **kwargs)
linear_moe/model/llama3/transformer_legacy.py:1616
Method
custom_forward
( hidden_states, attention_mask, context, cont
linear_moe/model/llama3/hybrid/hybrid_transformer_block.py:213
Method
custom_forward
(*inputs)
linear_moe/model/llama3/transformer/attention.py:129
Method
cvcuda_to_numpy
(image)
linear_moe/data/llava/cvcuda_image_processing_clip.py:357
Method
detokenize
(self, token_ids)
linear_moe/tokenizer/jiebabpe_tokenizer.py:68
Method
detokenize
(self, token_ids)
linear_moe/tokenizer/__init__.py:205
Method
detokenize
(self, token_ids)
linear_moe/tokenizer/__init__.py:266
Method
detokenize
(self, token_ids)
linear_moe/tokenizer/__init__.py:358
Method
detokenize
(self, token_ids)
linear_moe/tokenizer/__init__.py:431
Method
detokenize
(self, token_ids)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:54
Method
detokenize
(self, token_ids)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:344
Method
dict
(self)
linear_moe/data/llava/conversation.py:215
Method
draw_bbox_on_latest_picture
( self, response, history=None, )
linear_moe/tokenizer/tokenization_qwen_vl.py:409
Method
elu
(x)
linear_moe/sequence_modeling/basic_linear_attention/basic_linear_attention.py:72
Function
elu_norm
(x)
linear_moe/sequence_modeling/gated_deltanet/gated_deltanet.py:28
Function
elu_norm
(x)
linear_moe/sequence_modeling/deltanet/deltanet.py:29
Function
elu_p1
(x)
linear_moe/sequence_modeling/gated_deltanet/gated_deltanet.py:18
Method
encode
(self, json_line)
toolkits/pretrain_data_preprocessing/preprocess_data_megatron.py:65
Method
eod
(self)
linear_moe/tokenizer/jiebabpe_tokenizer.py:78
Method
eod
(self)
linear_moe/tokenizer/__init__.py:215
Method
eod
(self)
linear_moe/tokenizer/__init__.py:270
Method
eod
(self)
linear_moe/tokenizer/__init__.py:362
Method
eod
(self)
linear_moe/tokenizer/__init__.py:435
Method
eod
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:74
Method
eod
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:358
Method
eos_token
(self)
linear_moe/tokenizer/__init__.py:219
Method
eos_token
(self)
linear_moe/tokenizer/__init__.py:274
Method
eos_token
(self)
linear_moe/tokenizer/__init__.py:366
Method
eos_token
(self)
linear_moe/tokenizer/__init__.py:439
Method
eos_token_id
(self)
linear_moe/tokenizer/__init__.py:227
Method
eos_token_id
(self)
linear_moe/tokenizer/__init__.py:282
Method
eos_token_id
(self)
linear_moe/tokenizer/__init__.py:374
Method
eos_token_id
(self)
linear_moe/tokenizer/__init__.py:447
Method
expand2square
(pil_img, background_color)
linear_moe/data/llava/mm_pretrain_dataset.py:225
Method
expand2square
(pil_img, background_color=(122, 116, 104))
linear_moe/data/llava/conversation.py:133
Function
finetune
Main finetune function used across all tasks. Args: model (nn.Module): The model to fine-tune. optimizer (Optimizer): The opt
linear_moe/finetune_utils.py:268
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
linear_moe/sequence_modeling/mom_linear_attention.py:272
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
linear_moe/sequence_modeling/linear_attention.py:137
Method
forward
( self, hidden_states: Tensor, attention_mask: Tensor, inference_params=None,
linear_moe/sequence_modeling/ssm.py:209
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
linear_moe/sequence_modeling/linear_rnn.py:222
Method
forward
( self, q: torch.Tensor, k: torch.Tensor, i: torch.Tensor, g: torch.Te
linear_moe/sequence_modeling/hgrn2/hgrn2.py:67
Method
forward
( self, query: Tensor, key: Tensor, value: Tensor, attention_mask: Ten
linear_moe/sequence_modeling/attention/dot_product_attention.py:90
Method
forward
( self, hidden_states: Tensor, attention_mask: Tensor, inference_params=None,
linear_moe/sequence_modeling/mamba2/mamba_block.py:187
Method
forward
Forward function of the Mamba model. This function passes the input tensors through the embedding layer, and then the decoder and finally into
linear_moe/sequence_modeling/mamba2/mamba_model.py:141
Method
forward
hidden_states: (nL, B, D) / (L B D) Returns: same shape as hidden_states
linear_moe/sequence_modeling/mamba2/mamba_mixer.py:214
Method
forward
( self, hidden_states: Tensor, attention_mask: Tensor, # Not used in MambaLayer
linear_moe/sequence_modeling/mamba2/mamba_layer.py:55
Method
forward
( self, r: torch.Tensor, w: torch.Tensor, k: torch.Tensor, v: torch.Te
linear_moe/sequence_modeling/rwkv7/rwkv7.py:74
Method
forward
(self, x: torch.Tensor)
linear_moe/sequence_modeling/rwkv7/lora_mlp.py:53
Method
forward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, beta: torch
linear_moe/sequence_modeling/gated_deltanet/gated_deltanet.py:89
Method
forward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, )
linear_moe/sequence_modeling/based/based.py:57
Method
forward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, beta: torch
linear_moe/sequence_modeling/deltanet/deltanet.py:96
Method
forward
(self, x: torch.Tensor, delta: Optional[torch.Tensor] = None)
linear_moe/sequence_modeling/rwkv6/dd_lerp_linear.py:38
Method
forward
(self, x: torch.Tensor, mu: torch.Tensor, delta: Optional[torch.Tensor] = None)
linear_moe/sequence_modeling/rwkv6/dd_lerp_linear.py:75
Method
forward
(self, x: torch.Tensor)
linear_moe/sequence_modeling/rwkv6/dd_lerp_linear.py:114
Method
forward
( self, r: torch.Tensor, k: torch.Tensor, v: torch.Tensor, w: torch.Te
linear_moe/sequence_modeling/rwkv6/rwkv6.py:71
Method
forward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, )
linear_moe/sequence_modeling/basic_linear_attention/basic_linear_attention.py:114
Method
forward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, )
linear_moe/sequence_modeling/rebased/rebased.py:63
Method
forward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, )
linear_moe/sequence_modeling/lasp2/lasp2.py:62
Method
forward
(ctx, q, k, v, cp_group: torch.distributed.ProcessGroup)
linear_moe/sequence_modeling/lasp2/lasp2_with_mask_triton_op.py:953
Method
forward
(ctx, q, k, v, cp_group: torch.distributed.ProcessGroup)
linear_moe/sequence_modeling/lasp2/lasp2_without_mask_triton_op.py:675
Method
forward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, gk: torch.T
linear_moe/sequence_modeling/gla/gla.py:73
Method
forward
( self, hidden_states: torch.Tensor, )
linear_moe/sequence_modeling/gla/gla_gate.py:25
Method
forward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, )
linear_moe/sequence_modeling/lightning_attention/lightning_attention.py:108
Method
forward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, )
linear_moe/sequence_modeling/retention/retention.py:78
Method
forward
( self, hidden_states, attention_mask, context=None, context_mask=None
linear_moe/model/mixtral/transformer_layer.py:179
Method
forward
(self, hidden_states)
linear_moe/model/mixtral/rms_norm.py:13
Method
forward
( self, hidden_states: Tensor, attention_mask: Tensor, context: Tensor = None,
linear_moe/model/mixtral/transformer_block.py:322
Method
forward
Forward function of the GPT Model This function passes the input tensors through the embedding layer, and then the decoeder and finally into t
linear_moe/model/mixtral/model.py:159
Method
forward
( self, hidden_states: Tensor, attention_mask: Tensor, context: Tensor = None,
linear_moe/model/mixtral/hybrid/hybrid_transformer_block.py:314
← previous
next →
1,001–1,100 of 1,498, ranked by callers