MCPcopy Create free account

hub / github.com/THUDM/LongWriter / functions

Functions151 in github.com/THUDM/LongWriter

Methodforward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor] = None,
train/patch/modeling_llama.py:537
Methodforward
Input shape: Batch x Time x Channel attention_mask: [bsz, q_len]
train/patch/modeling_llama.py:630
Methodforward
Args: hidden_states (`torch.FloatTensor`): input to the layer of shape `(batch, seq_len, embed_dim)` attention_mask (
train/patch/modeling_llama.py:723
Methodforward
( self, input_ids: torch.LongTensor = None, attention_mask: Optional[torch.Tensor] = N
train/patch/modeling_llama.py:946
Methodforward
r""" Args: labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*): Labels for computing
train/patch/modeling_llama.py:1190
Methodforward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the sequence classification/regression
train/patch/modeling_llama.py:1409
Methodforward
r""" start_positions (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for position (index) of the start of the la
train/patch/modeling_llama.py:1526
Methodforward
r""" labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*): Labels for computing the sequence classification/regression
train/patch/modeling_llama.py:1630
Methodforward
(self, max_seq_len, offset=0)
train/patch/modeling_chatglm.py:130
Methodforward
(self, hidden_states: torch.Tensor)
train/patch/modeling_chatglm.py:163
Methodforward
(self, query_layer, key_layer, value_layer, attention_mask)
train/patch/modeling_chatglm.py:191
Methodforward
( self, hidden_states, attention_mask, rotary_pos_emb, kv_cache=None, use_cache=True )
train/patch/modeling_chatglm.py:272
Methodforward
(self, hidden_states)
train/patch/modeling_chatglm.py:406
Methodforward
( self, hidden_states, attention_mask, rotary_pos_emb, kv_cache=None, use_cache=True, )
train/patch/modeling_chatglm.py:446
Methodforward
( self, hidden_states, attention_mask, rotary_pos_emb, kv_caches=None, use_cache: Opti
train/patch/modeling_chatglm.py:518
Methodforward
(self, input_ids)
train/patch/modeling_chatglm.py:632
Methodforward
( self, input_ids, position_ids: Optional[torch.Tensor] = None,
train/patch/modeling_chatglm.py:671
Methodforward
( self, input_ids: Optional[torch.Tensor] = None, position_ids: Optional[t
train/patch/modeling_chatglm.py:786
Methodget_decoder
(self)
train/patch/modeling_llama.py:1185
Methodget_input_embeddings
(self)
train/patch/modeling_llama.py:939
Methodget_input_embeddings
(self)
train/patch/modeling_llama.py:1170
Methodget_input_embeddings
(self)
train/patch/modeling_llama.py:1402
Methodget_input_embeddings
(self)
train/patch/modeling_llama.py:1519
Methodget_input_embeddings
(self)
train/patch/modeling_llama.py:1623
Methodget_input_embeddings
(self)
train/patch/modeling_chatglm.py:668
Methodget_masks
(self, input_ids, past_key_values, padding_mask=None)
train/patch/modeling_chatglm.py:588
Methodget_output_embeddings
(self)
train/patch/modeling_llama.py:1176
Functionget_pred
(rank, world_size, data, max_new_tokens, fout, template, cache_fout, cache_dict)
agentwrite/write.py:56
Functionget_pred
(rank, world_size, data, max_new_tokens, fout, template)
agentwrite/plan.py:56
Functionget_pred
(rank, world_size, data, path, max_new_tokens, temperature, tokenizer, fout)
evaluation/pred.py:27
Methodget_vocab
Returns vocab as a dict
train/patch/tokenization_chatglm.py:76
Methodppl
(self, input_ids: Optional[torch.Tensor] = None, position_ids: Optional[torch.Tensor]
train/patch/modeling_llama.py:1286
Methodppl
(self, input_ids: Optional[torch.Tensor] = None, position_ids: Optional[torch.Tensor]
train/patch/modeling_chatglm.py:897
Functionpredict
(history, prompt, max_length, top_p, temperature)
trans_web_demo.py:64
Methodprepare_inputs_for_generation
( self, input_ids, past_key_values=None, attention_mask=None, inputs_e
train/patch/modeling_llama.py:1333
Methodprepare_inputs_for_generation
( self, input_ids: torch.LongTensor, past_key_values: Optional[torch.Tenso
train/patch/modeling_chatglm.py:763
Functionprocess_data
(items)
evaluation/eval_quality.py:63
Functionprocess_file
(lines, rank, args)
train/pre_tokenize_llama3.py:27
Functionprocess_file
(lines, rank, args)
train/pre_tokenize_glm4.py:26
Methodsave_vocabulary
Save the vocabulary and special tokens file to a directory. Args: save_directory (`str`): The directory
train/patch/tokenization_chatglm.py:124
Methodset_decoder
(self, decoder)
train/patch/modeling_llama.py:1182
Methodset_input_embeddings
(self, value)
train/patch/modeling_llama.py:942
Methodset_input_embeddings
(self, value)
train/patch/modeling_llama.py:1173
Methodset_input_embeddings
(self, value)
train/patch/modeling_llama.py:1405
Methodset_input_embeddings
(self, value)
train/patch/modeling_llama.py:1522
Methodset_input_embeddings
(self, value)
train/patch/modeling_llama.py:1626
Methodset_output_embeddings
(self, new_embeddings)
train/patch/modeling_llama.py:1179
Functionset_prompt
(prompt_text)
trans_web_demo.py:131
Methodswiglu
(x)
train/patch/modeling_chatglm.py:391
Functionuser
(query, history)
trans_web_demo.py:127
Methodvocab_size
(self)
train/patch/tokenization_chatglm.py:69
← previous101–151 of 151, ranked by callers