MCPcopy Create free account

hub / github.com/OpenSparseLLMs/Linear-MoE / functions

Functions1,498 in github.com/OpenSparseLLMs/Linear-MoE

Methodcheckpoint_handler
(forward_func)
linear_moe/model/deepseek_v2/hybrid/hybrid_transformer_block.py:222
Methodcheckpoint_handler
(forward_func)
linear_moe/model/llama3/hybrid/hybrid_transformer_block.py:236
Methodcls
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:59
Methodcontains_sentence_end
(self, idx)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:308
Functioncontiguous
(fn)
linear_moe/utils.py:8
Methodconvert_tokens_to_ids
(self, tokens)
linear_moe/tokenizer/jiebabpe_tokenizer.py:72
Methodconvert_tokens_to_string
Converts a sequence of tokens in a single string.
linear_moe/tokenizer/tokenization_qwen_vl.py:266
Methodconvert_tokens_to_string
Converts a sequence of tokens (string) in a single string.
linear_moe/tokenizer/tokenization_baichuan.py:106
Methodconvert_tokens_to_string
Converts a sequence of tokens (string) in a single string.
linear_moe/tokenizer/tokenization_yi.py:119
Methodcreate_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
Methodcreate_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
Functioncross_entropy_loss_func
(labels, output_tensor)
linear_moe/finetune_utils.py:50
Methodcustom
(start: int, end: int)
linear_moe/model/mixtral/transformer_block.py:220
Methodcustom
(start: int, end: int)
linear_moe/model/mixtral/hybrid/hybrid_transformer_block.py:212
Methodcustom
(start: int, end: int)
linear_moe/model/qwen2/transformer_block.py:220
Methodcustom
(start: int, end: int)
linear_moe/model/qwen2/hybrid/hybrid_transformer_block.py:212
Methodcustom
(start: int, end: int)
linear_moe/model/deepseek_v2/transformer_block.py:209
Methodcustom
(start: int, end: int)
linear_moe/model/deepseek_v2/hybrid/hybrid_transformer_block.py:196
Methodcustom
(start, end)
linear_moe/model/llama3/transformer_legacy.py:1615
Methodcustom
(start: int, end: int)
linear_moe/model/llama3/hybrid/hybrid_transformer_block.py:212
Methodcustom_forward
( hidden_states, attention_mask, context, cont
linear_moe/model/mixtral/transformer_block.py:221
Methodcustom_forward
( hidden_states, attention_mask, context, cont
linear_moe/model/mixtral/hybrid/hybrid_transformer_block.py:213
Methodcustom_forward
(*inputs)
linear_moe/model/mixtral/transformer/attention.py:125
Methodcustom_forward
( hidden_states, attention_mask, context, cont
linear_moe/model/qwen2/transformer_block.py:221
Methodcustom_forward
( hidden_states, attention_mask, context, cont
linear_moe/model/qwen2/hybrid/hybrid_transformer_block.py:213
Methodcustom_forward
(*inputs)
linear_moe/model/qwen2/transformer/attention.py:125
Methodcustom_forward
(hidden_states)
linear_moe/model/qwen2/moe/moe_layer.py:157
Methodcustom_forward
( hidden_states, position_ids, attention_mask,
linear_moe/model/deepseek_v2/transformer_block.py:210
Methodcustom_forward
( hidden_states, position_ids, attention_mask,
linear_moe/model/deepseek_v2/hybrid/hybrid_transformer_block.py:197
Methodcustom_forward
(*inputs)
linear_moe/model/deepseek_v2/transformer/attention.py:137
Methodcustom_forward
(*inputs)
linear_moe/model/llama3/transformer_legacy.py:620
Methodcustom_forward
(*args, **kwargs)
linear_moe/model/llama3/transformer_legacy.py:1616
Methodcustom_forward
( hidden_states, attention_mask, context, cont
linear_moe/model/llama3/hybrid/hybrid_transformer_block.py:213
Methodcustom_forward
(*inputs)
linear_moe/model/llama3/transformer/attention.py:129
Methodcvcuda_to_numpy
(image)
linear_moe/data/llava/cvcuda_image_processing_clip.py:357
Methoddetokenize
(self, token_ids)
linear_moe/tokenizer/jiebabpe_tokenizer.py:68
Methoddetokenize
(self, token_ids)
linear_moe/tokenizer/__init__.py:205
Methoddetokenize
(self, token_ids)
linear_moe/tokenizer/__init__.py:266
Methoddetokenize
(self, token_ids)
linear_moe/tokenizer/__init__.py:358
Methoddetokenize
(self, token_ids)
linear_moe/tokenizer/__init__.py:431
Methoddetokenize
(self, token_ids)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:54
Methoddetokenize
(self, token_ids)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:344
Methoddict
(self)
linear_moe/data/llava/conversation.py:215
Methoddraw_bbox_on_latest_picture
( self, response, history=None, )
linear_moe/tokenizer/tokenization_qwen_vl.py:409
Methodelu
(x)
linear_moe/sequence_modeling/basic_linear_attention/basic_linear_attention.py:72
Functionelu_norm
(x)
linear_moe/sequence_modeling/gated_deltanet/gated_deltanet.py:28
Functionelu_norm
(x)
linear_moe/sequence_modeling/deltanet/deltanet.py:29
Functionelu_p1
(x)
linear_moe/sequence_modeling/gated_deltanet/gated_deltanet.py:18
Methodencode
(self, json_line)
toolkits/pretrain_data_preprocessing/preprocess_data_megatron.py:65
Methodeod
(self)
linear_moe/tokenizer/jiebabpe_tokenizer.py:78
Methodeod
(self)
linear_moe/tokenizer/__init__.py:215
Methodeod
(self)
linear_moe/tokenizer/__init__.py:270
Methodeod
(self)
linear_moe/tokenizer/__init__.py:362
Methodeod
(self)
linear_moe/tokenizer/__init__.py:435
Methodeod
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:74
Methodeod
(self)
linear_moe/tokenizer/icetk_glm130b_tokenizer.py:358
Methodeos_token
(self)
linear_moe/tokenizer/__init__.py:219
Methodeos_token
(self)
linear_moe/tokenizer/__init__.py:274
Methodeos_token
(self)
linear_moe/tokenizer/__init__.py:366
Methodeos_token
(self)
linear_moe/tokenizer/__init__.py:439
Methodeos_token_id
(self)
linear_moe/tokenizer/__init__.py:227
Methodeos_token_id
(self)
linear_moe/tokenizer/__init__.py:282
Methodeos_token_id
(self)
linear_moe/tokenizer/__init__.py:374
Methodeos_token_id
(self)
linear_moe/tokenizer/__init__.py:447
Methodexpand2square
(pil_img, background_color)
linear_moe/data/llava/mm_pretrain_dataset.py:225
Methodexpand2square
(pil_img, background_color=(122, 116, 104))
linear_moe/data/llava/conversation.py:133
Functionfinetune
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
Methodforward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
linear_moe/sequence_modeling/mom_linear_attention.py:272
Methodforward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
linear_moe/sequence_modeling/linear_attention.py:137
Methodforward
( self, hidden_states: Tensor, attention_mask: Tensor, inference_params=None,
linear_moe/sequence_modeling/ssm.py:209
Methodforward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
linear_moe/sequence_modeling/linear_rnn.py:222
Methodforward
( self, q: torch.Tensor, k: torch.Tensor, i: torch.Tensor, g: torch.Te
linear_moe/sequence_modeling/hgrn2/hgrn2.py:67
Methodforward
( self, query: Tensor, key: Tensor, value: Tensor, attention_mask: Ten
linear_moe/sequence_modeling/attention/dot_product_attention.py:90
Methodforward
( self, hidden_states: Tensor, attention_mask: Tensor, inference_params=None,
linear_moe/sequence_modeling/mamba2/mamba_block.py:187
Methodforward
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
Methodforward
hidden_states: (nL, B, D) / (L B D) Returns: same shape as hidden_states
linear_moe/sequence_modeling/mamba2/mamba_mixer.py:214
Methodforward
( self, hidden_states: Tensor, attention_mask: Tensor, # Not used in MambaLayer
linear_moe/sequence_modeling/mamba2/mamba_layer.py:55
Methodforward
( self, r: torch.Tensor, w: torch.Tensor, k: torch.Tensor, v: torch.Te
linear_moe/sequence_modeling/rwkv7/rwkv7.py:74
Methodforward
(self, x: torch.Tensor)
linear_moe/sequence_modeling/rwkv7/lora_mlp.py:53
Methodforward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, beta: torch
linear_moe/sequence_modeling/gated_deltanet/gated_deltanet.py:89
Methodforward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, )
linear_moe/sequence_modeling/based/based.py:57
Methodforward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, beta: torch
linear_moe/sequence_modeling/deltanet/deltanet.py:96
Methodforward
(self, x: torch.Tensor, delta: Optional[torch.Tensor] = None)
linear_moe/sequence_modeling/rwkv6/dd_lerp_linear.py:38
Methodforward
(self, x: torch.Tensor, mu: torch.Tensor, delta: Optional[torch.Tensor] = None)
linear_moe/sequence_modeling/rwkv6/dd_lerp_linear.py:75
Methodforward
(self, x: torch.Tensor)
linear_moe/sequence_modeling/rwkv6/dd_lerp_linear.py:114
Methodforward
( self, r: torch.Tensor, k: torch.Tensor, v: torch.Tensor, w: torch.Te
linear_moe/sequence_modeling/rwkv6/rwkv6.py:71
Methodforward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, )
linear_moe/sequence_modeling/basic_linear_attention/basic_linear_attention.py:114
Methodforward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, )
linear_moe/sequence_modeling/rebased/rebased.py:63
Methodforward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, )
linear_moe/sequence_modeling/lasp2/lasp2.py:62
Methodforward
(ctx, q, k, v, cp_group: torch.distributed.ProcessGroup)
linear_moe/sequence_modeling/lasp2/lasp2_with_mask_triton_op.py:953
Methodforward
(ctx, q, k, v, cp_group: torch.distributed.ProcessGroup)
linear_moe/sequence_modeling/lasp2/lasp2_without_mask_triton_op.py:675
Methodforward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, gk: torch.T
linear_moe/sequence_modeling/gla/gla.py:73
Methodforward
( self, hidden_states: torch.Tensor, )
linear_moe/sequence_modeling/gla/gla_gate.py:25
Methodforward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, )
linear_moe/sequence_modeling/lightning_attention/lightning_attention.py:108
Methodforward
( self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, )
linear_moe/sequence_modeling/retention/retention.py:78
Methodforward
( self, hidden_states, attention_mask, context=None, context_mask=None
linear_moe/model/mixtral/transformer_layer.py:179
Methodforward
(self, hidden_states)
linear_moe/model/mixtral/rms_norm.py:13
Methodforward
( self, hidden_states: Tensor, attention_mask: Tensor, context: Tensor = None,
linear_moe/model/mixtral/transformer_block.py:322
Methodforward
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
Methodforward
( self, hidden_states: Tensor, attention_mask: Tensor, context: Tensor = None,
linear_moe/model/mixtral/hybrid/hybrid_transformer_block.py:314
← previousnext →1,001–1,100 of 1,498, ranked by callers