Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QwenLM/ParScale
/ functions
Functions
52 in github.com/QwenLM/ParScale
⨍
Functions
52
◇
Types & classes
14
↳
Endpoints
1
↓ 10 callers
Method
__init__
(self, config)
modeling_qwen2_parscale.py:47
↓ 3 callers
Method
get_seq_length
(self, layer_idx = 0)
modeling_qwen2_parscale.py:154
↓ 3 callers
Function
pred_loss
(params)
parametric_fit.py:22
↓ 2 callers
Function
parametric_fit
(param_list, p_list, loss_list)
parametric_fit.py:10
↓ 2 callers
Function
repeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
modeling_qwen2_parscale.py:96
↓ 2 callers
Function
rotate_half
Rotates half the hidden dims of the input.
modeling_qwen2_parscale.py:62
↓ 1 callers
Method
_dynamic_frequency_update
dynamic RoPE layers should recompute `inv_freq` in the following situations: 1 - growing beyond the cached sequence length (allow sca
modeling_qwen2_parscale.py:364
↓ 1 callers
Method
_prepare_4d_causal_attention_mask_with_cache_position
Creates a causal 4D mask of shape `(batch_size, 1, query_length, key_value_length)` from a 2D mask of shape `(batch_size, key_value_l
modeling_qwen2_parscale.py:769
↓ 1 callers
Method
_update_causal_mask
( self, attention_mask: torch.Tensor, input_tensor: torch.Tensor, cache_positi
modeling_qwen2_parscale.py:704
↓ 1 callers
Function
apply_rotary_pos_emb
Applies Rotary Position Embedding to the query and key tensors. Args: q (`torch.Tensor`): The query tensor. k (`torch.Tensor`): T
modeling_qwen2_parscale.py:69
↓ 1 callers
Function
huber_loss
(y_true, y_pred, delta=0.001)
parametric_fit.py:15
↓ 1 callers
Method
update
( self, key_states: torch.Tensor, value_states: torch.Tensor, layer_idx: int,
modeling_qwen2_parscale.py:141
Method
__init__
(self, prefix_k, prefix_v)
modeling_qwen2_parscale.py:134
Method
__init__
(self, config: Qwen2ParScaleConfig, layer_idx: int)
modeling_qwen2_parscale.py:169
Method
__init__
Qwen2RMSNorm is equivalent to T5LayerNorm
modeling_qwen2_parscale.py:270
Method
__init__
(self, config: Qwen2ParScaleConfig, layer_idx: int)
modeling_qwen2_parscale.py:290
Method
__init__
(self, config: Qwen2ParScaleConfig, device=None)
modeling_qwen2_parscale.py:347
Method
__init__
(self, config: Qwen2ParScaleConfig)
modeling_qwen2_parscale.py:540
Method
__init__
(self, config)
modeling_qwen2_parscale.py:832
Method
__init__
(self, config)
modeling_qwen2_parscale.py:965
Method
__init__
(self, config)
modeling_qwen2_parscale.py:1061
Method
__init__
(self, config)
modeling_qwen2_parscale.py:1151
Method
__init__
( self, vocab_size=151936, hidden_size=4096, intermediate_size=22016,
configuration_qwen2_parscale.py:129
Method
_init_weights
(self, module)
modeling_qwen2_parscale.py:441
Function
eager_attention_forward
( module: nn.Module, query: torch.Tensor, key: torch.Tensor, value: torch.Tensor, attentio
modeling_qwen2_parscale.py:108
Method
extra_repr
(self)
modeling_qwen2_parscale.py:285
Method
forward
(self, x)
modeling_qwen2_parscale.py:57
Method
forward
( self, hidden_states: torch.Tensor, position_embeddings: Tuple[torch.Tensor, torch.Te
modeling_qwen2_parscale.py:187
Method
forward
(self, hidden_states)
modeling_qwen2_parscale.py:278
Method
forward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
modeling_qwen2_parscale.py:303
Method
forward
(self, x, position_ids)
modeling_qwen2_parscale.py:384
Method
forward
( self, input_ids: torch.LongTensor = None, attention_mask: Optional[torch.Tensor] = N
modeling_qwen2_parscale.py:572
Method
forward
r""" Args: labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*): Labels for computing
modeling_qwen2_parscale.py:861
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the sequence classification/regression
modeling_qwen2_parscale.py:981
Method
forward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the sequence classification/regression
modeling_qwen2_parscale.py:1089
Method
forward
r""" start_positions (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for position (index) of the start of the la
modeling_qwen2_parscale.py:1166
Method
get_decoder
(self)
modeling_qwen2_parscale.py:856
Method
get_input_embeddings
(self)
modeling_qwen2_parscale.py:565
Method
get_input_embeddings
(self)
modeling_qwen2_parscale.py:841
Method
get_input_embeddings
(self)
modeling_qwen2_parscale.py:974
Method
get_input_embeddings
(self)
modeling_qwen2_parscale.py:1077
Method
get_input_embeddings
(self)
modeling_qwen2_parscale.py:1159
Method
get_output_embeddings
(self)
modeling_qwen2_parscale.py:847
Function
objective_function
(params)
parametric_fit.py:26
Method
reorder_cache
Reorders the cache for beam search, given the selected beam indices.
modeling_qwen2_parscale.py:160
Method
set_decoder
(self, decoder)
modeling_qwen2_parscale.py:853
Method
set_input_embeddings
(self, value)
modeling_qwen2_parscale.py:568
Method
set_input_embeddings
(self, value)
modeling_qwen2_parscale.py:844
Method
set_input_embeddings
(self, value)
modeling_qwen2_parscale.py:977
Method
set_input_embeddings
(self, value)
modeling_qwen2_parscale.py:1080
Method
set_input_embeddings
(self, value)
modeling_qwen2_parscale.py:1162
Method
set_output_embeddings
(self, new_embeddings)
modeling_qwen2_parscale.py:850