MCPcopy Create free account

hub / github.com/baichuan-inc/Baichuan-7B / functions

Functions53 in github.com/baichuan-inc/Baichuan-7B

↓ 6 callersMethod__init__
( self, hidden_size: int, intermediate_size: int, hidden_act:
models/modeling_baichuan.py:157
↓ 2 callersFunctionapply_rotary_pos_emb
(q, k, cos, sin, position_ids)
models/modeling_baichuan.py:145
↓ 2 callersMethodbuild_example
(self, data, with_answer: bool = True)
evaluation/evaluate_zh.py:166
↓ 2 callersFunctionformat_example
(df, idx, include_answer=True)
evaluation/evaluate_mmlu.py:20
↓ 2 callersFunctiongen_prompt
(train_df, subject, k=-1)
evaluation/evaluate_mmlu.py:31
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
models/modeling_baichuan.py:138
↓ 1 callersFunction_expand_mask
Expands attention_mask from `[bsz, seq_len]` to `[bsz, 1, tgt_seq_len, src_seq_len]`.
models/modeling_baichuan.py:72
↓ 1 callersFunction_make_causal_mask
Make causal mask used for bi-directional self-attention.
models/modeling_baichuan.py:54
↓ 1 callersMethod_prepare_decoder_attention_mask
(self, attention_mask, input_shape, inputs_embeds, past_key_values_length)
models/modeling_baichuan.py:402
↓ 1 callersFunctioneval
(args, subject, model, tokenizer, dev_df, test_df)
evaluation/evaluate_mmlu.py:43
↓ 1 callersFunctionformat_subject
(subject)
evaluation/evaluate_mmlu.py:12
↓ 1 callersFunctionget_argument_parser
()
train.py:29
↓ 1 callersMethodget_data
(self)
train.py:90
↓ 1 callersMethodload_data
(self)
train.py:75
↓ 1 callersFunctionmain
()
evaluation/evaluate_zh.py:180
↓ 1 callersFunctionmain
(args)
evaluation/evaluate_mmlu.py:100
↓ 1 callersFunctionparse_argument
()
evaluation/evaluate_zh.py:17
↓ 1 callersFunctionprepare_data
()
train.py:98
↓ 1 callersFunctionprepare_model
()
train.py:109
↓ 1 callersMethodrun
(self, shot: int, split: str)
evaluation/evaluate_zh.py:103
↓ 1 callersMethodrun_single_task
(self, task_name: str, shot: int, split: str)
evaluation/evaluate_zh.py:125
↓ 1 callersFunctiontrain
(data_engine, model_engine)
train.py:124
Method__init__
(self, data_dir, tokenizer_path, micro_batch_size, max_length)
train.py:60
Method__init__
RMSNorm is equivalent to T5LayerNorm
models/modeling_baichuan.py:87
Method__init__
(self, dim, max_position_embeddings=2048, base=10000, device=None)
models/modeling_baichuan.py:107
Method__init__
(self, config: BaiChuanConfig)
models/modeling_baichuan.py:176
Method__init__
(self, config: BaiChuanConfig)
models/modeling_baichuan.py:284
Method__init__
(self, config: BaiChuanConfig)
models/modeling_baichuan.py:382
Method__init__
(self, config)
models/modeling_baichuan.py:554
Method__init__
( self, vocab_size=64000, hidden_size=4096, intermediate_size=11008, n
models/configuration_baichuan.py:45
Method__init__
( self, model: PreTrainedModel, tokenizer: PreTrainedTokenizerBase, output_dir
evaluation/evaluate_zh.py:91
Method_init_weights
(self, module)
models/modeling_baichuan.py:358
Method_reorder_cache
(past_key_values, beam_idx)
models/modeling_baichuan.py:698
Method_set_gradient_checkpointing
(self, module, value=False)
models/modeling_baichuan.py:369
Method_shape
(self, tensor: torch.Tensor, seq_len: int, bsz: int)
models/modeling_baichuan.py:194
Methodcreate_custom_forward
(module)
models/modeling_baichuan.py:504
Methodcustom_forward
(*inputs)
models/modeling_baichuan.py:505
Methodforward
(self, hidden_states)
models/modeling_baichuan.py:95
Methodforward
(self, x, seq_len=None)
models/modeling_baichuan.py:121
Methodforward
(self, x)
models/modeling_baichuan.py:169
Methodforward
( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.Tensor
models/modeling_baichuan.py:197
Methodforward
Args: hidden_states (`torch.FloatTensor`): input to the layer of shape `(batch, seq_len, embed_dim)` attention_mask (
models/modeling_baichuan.py:296
Methodforward
( self, input_ids: torch.LongTensor = None, attention_mask: Optional[torch
models/modeling_baichuan.py:425
Methodforward
r""" Args: labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*): Labels for computing
models/modeling_baichuan.py:581
Methodget_decoder
(self)
models/modeling_baichuan.py:578
Methodget_input_embeddings
(self)
models/modeling_baichuan.py:395
Methodget_input_embeddings
(self)
models/modeling_baichuan.py:563
Methodget_output_embeddings
(self)
models/modeling_baichuan.py:569
Methodprepare_inputs_for_generation
( self, input_ids, past_key_values=None, attention_mask=None, inputs_embeds=None, **kwargs )
models/modeling_baichuan.py:667
Methodset_decoder
(self, decoder)
models/modeling_baichuan.py:575
Methodset_input_embeddings
(self, value)
models/modeling_baichuan.py:398
Methodset_input_embeddings
(self, value)
models/modeling_baichuan.py:566
Methodset_output_embeddings
(self, new_embeddings)
models/modeling_baichuan.py:572