MCPcopy Create free account

hub / github.com/FreedomIntelligence/CMB / functions

Functions210 in github.com/FreedomIntelligence/CMB

↓ 11 callersMethod__init__
(self, config: ChatGLMConfig, device=None)
workers/chatglm3_modeling.py:467
↓ 8 callersMethod__init__
(self, hidden_size, inner_hidden_size=None, layer_id=None, bias=True, activation_func=gelu, p
workers/modeling_chatglm_med.py:549
↓ 6 callersMethodformat_fewshot_user_and_gpt
(self, item: dict, use_cot)
workers/base.py:206
↓ 4 callersFunction_config_to_kwargs
(args)
workers/chatglm3_modeling.py:452
↓ 4 callersMethodprint_in_main
(self, *args, **kwargs)
workers/base.py:162
↓ 3 callersFunctionapply_rotary_pos_emb_index
(q, k, cos, sin, position_id)
workers/modeling_chatglm_med.py:281
↓ 2 callersMethod_update_model_kwargs_for_generation
( self, outputs: ModelOutput, model_kwargs: Dict[str, Any], is
workers/chatglm3_modeling.py:863
↓ 2 callersFunctionapply_rotary_pos_emb
(x: torch.Tensor, rope_cache: torch.Tensor)
workers/chatglm3_modeling.py:161
↓ 2 callersMethodfrom_config
( cls, cfg, input_pth: str = '', output_pth: str = '', batch_size =
workers/base.py:53
↓ 2 callersMethodget_masks
(seq, device)
workers/modeling_chatglm_med.py:849
↓ 2 callersMethodprocess_response
(self, output, history)
workers/chatglm3_modeling.py:999
↓ 2 callersFunctionrotate_half
(x)
workers/modeling_chatglm_med.py:275
↓ 1 callersMethod_get_layer
(self, layer_number)
workers/chatglm3_modeling.py:605
↓ 1 callersFunctionattention_fn
( self, query_layer, key_layer, value_layer, attention_mask, h
workers/modeling_chatglm_med.py:289
↓ 1 callersMethodclose
(self,)
workers/base.py:166
↓ 1 callersFunctionextract_ans
(ans_num, output_path, cot_flag)
src/utils.py:40
↓ 1 callersMethodforward_impl
Enhanced Transformer with Rotary Position Embedding. Derived from: https://github.com/labmlai/annotated_deep_learning_paper_implementations/b
workers/chatglm3_modeling.py:129
↓ 1 callersFunctiongelu_impl
OpenAI's gelu implementation.
workers/modeling_chatglm_med.py:221
↓ 1 callersMethodgenerate_batch
r""" Args: batch (`List[dict]`): a list of raw data. Returns: outputs (`List[str]`):
workers/base.py:171
↓ 1 callersMethodgenerate_fewshot_examples
Generate a fewshot prompt given a list of data. Note that the roles are already in the fewshot examples. Be careful not to ad
workers/base.py:239
↓ 1 callersFunctionget_fewshot_input_path
(args)
src/generate_answers.py:11
↓ 1 callersMethodget_masks_and_position_ids
(self, seq, mask_position, context_length, device, gmask=False)
workers/modeling_chatglm_med.py:1028
↓ 1 callersFunctionget_output_path
(args)
src/generate_fewshot.py:16
↓ 1 callersMethodget_position_ids
(self, input_ids, device)
workers/chatglm3_modeling.py:695
↓ 1 callersMethodget_position_ids
(self, seq, mask_position, device, gmask=False)
workers/modeling_chatglm_med.py:860
↓ 1 callersMethodget_prompt
(self, batch_size, device, dtype=torch.half)
workers/chatglm3_modeling.py:771
↓ 1 callersMethodget_question_template
(self, use_cot)
workers/base.py:287
↓ 1 callersFunctionget_runner_class
(model_id)
src/utils.py:17
↓ 1 callersMethodget_single_query
(self, datum, use_cot)
workers/base.py:195
↓ 1 callersMethodinit_dataloader
(self, input_pth, batch_size)
workers/base.py:136
↓ 1 callersMethodinit_generation_config
(self, config)
workers/base.py:118
↓ 1 callersMethodinit_writer
(self, output_pth)
workers/base.py:157
↓ 1 callersMethodload_model_and_tokenizer
(self, load_config)
workers/base.py:78
↓ 1 callersFunctionmain
(args)
src/generate_fewshot.py:54
↓ 1 callersFunctionmain
(args)
src/generate_answers.py:21
↓ 1 callersFunctionmake_output_dir
(fp)
src/utils.py:66
↓ 1 callersFunctionmatch_choice
(text, cot_flag)
src/utils.py:25
↓ 1 callersMethodprepare_inputs_for_generation
( self, input_ids: torch.LongTensor, past_key_values: Optional[torch.Tenso
workers/chatglm3_modeling.py:894
↓ 1 callersMethodprepare_inputs_for_generation
( self, input_ids: torch.LongTensor, past: Optional[torch.Tensor] = None,
workers/modeling_chatglm_med.py:1054
↓ 1 callersMethodquantize
(self, weight_bit_width: int)
workers/chatglm3_modeling.py:845
↓ 1 callersMethodquantize
(self, bits: int, empty_init=False, device=None, **kwargs)
workers/chatglm3_modeling.py:1191
↓ 1 callersFunctionselect_items
(exam_type, exam_class, num)
src/generate_fewshot.py:25
↓ 1 callersFunctionsplit_tensor_along_last_dim
Split a tensor along its last dimension. Arguments: tensor: input tensor. num_partitions: number of partitions to split the tenso
workers/chatglm3_modeling.py:93
↓ 1 callersMethodsplit_tensor_along_last_dim
Split a tensor along its last dimension. Arguments: tensor: input tensor. num_partitions: number of partitions to spli
workers/modeling_chatglm_med.py:450
↓ 1 callersMethodstream_generate
( self, input_ids, generation_config: Optional[GenerationConfig] = None,
workers/chatglm3_modeling.py:1084
↓ 1 callersMethodunwrap
(self, outputs, num_return_sequences)
workers/base.py:328
↓ 1 callersMethodunwrap_model
(self,)
workers/base.py:154
↓ 1 callersMethodwrap
data.keys(): ['id', 'exam_type', 'exam_class', 'question_type', 'question', 'option']. These are the raw data. We still need 'option_
workers/base.py:293
↓ 1 callersMethodwrap_conv
(self, data: list[dict])
workers/base.py:312
↓ 1 callersMethodwrap_dataloader
(self)
workers/base.py:148
↓ 1 callersMethodwrap_model
(self,)
workers/base.py:151
Method__call__
(self, input_ids: torch.LongTensor, scores: torch.FloatTensor)
workers/chatglm3_modeling.py:54
Method__call__
(self, input_ids: torch.LongTensor, scores: torch.FloatTensor)
workers/modeling_chatglm_med.py:139
Method__getitem__
(self, index)
workers/base.py:352
Method__init__
( self, num_layers=28, padded_vocab_size=65024, hidden_size=4096, ffn_
workers/chatglm3_configuration.py:6
Method__init__
(self, config: ChatGLMConfig)
workers/chatglm3_modeling.py:68
Method__init__
(self, dim, original_impl=False, device=None, dtype=None)
workers/chatglm3_modeling.py:122
Method__init__
(self, normalized_shape, eps=1e-5, device=None, dtype=None, **kwargs)
workers/chatglm3_modeling.py:182
Method__init__
(self, config: ChatGLMConfig, layer_number)
workers/chatglm3_modeling.py:196
Method__init__
(self, config: ChatGLMConfig, layer_number, device=None)
workers/chatglm3_modeling.py:320
Method__init__
(self, config: ChatGLMConfig, layer_number, device=None)
workers/chatglm3_modeling.py:512
Method__init__
(self, config: ChatGLMConfig, device=None)
workers/chatglm3_modeling.py:582
Method__init__
(self, config: ChatGLMConfig, device=None)
workers/chatglm3_modeling.py:708
Method__init__
(self, config: ChatGLMConfig, device=None, empty_init=True)
workers/chatglm3_modeling.py:734
Method__init__
(self, config: ChatGLMConfig, empty_init=True, device=None)
workers/chatglm3_modeling.py:852
Method__init__
(self, config: ChatGLMConfig, empty_init=True, device=None)
workers/chatglm3_modeling.py:1211
Method__init__
( self, tokenizer, instruction_template, conv_collater,
workers/base.py:254
Method__init__
(self, input_path)
workers/base.py:344
Method__init__
( self, vocab_size=150528, hidden_size=4096, num_layers=28,
workers/modeling_chatglm_med.py:103
Method__init__
(self, dim, base=10000, precision=torch.half, learnable=False)
workers/modeling_chatglm_med.py:232
Method__init__
(self, hidden_size, num_attention_heads, layer_id, hidden_size_per_attention_head=None, bias=
workers/modeling_chatglm_med.py:399
Method__init__
(self)
workers/modeling_chatglm_med.py:538
Method__init__
( self, hidden_size, num_attention_heads, layernorm_epsilon,
workers/modeling_chatglm_med.py:592
Method__init__
(self, *inputs, **kwargs)
workers/modeling_chatglm_med.py:707
Method__init__
(self, config: ChatGLMConfig)
workers/modeling_chatglm_med.py:799
Method__init__
(self, config)
workers/modeling_chatglm_med.py:1002
Method__len__
(self)
workers/base.py:356
Method__post_init__
(self)
workers/base.py:33
Method_allocate_memory
(self, inference_max_sequence_len, batch_size, device=None, dtype=None)
workers/chatglm3_modeling.py:349
Method_init_weights
Initialize the weights.
workers/chatglm3_modeling.py:673
Method_init_weights
(self, module)
workers/modeling_chatglm_med.py:710
Method_load_from_state_dict
(self, state_dict, prefix, local_metadata, strict, missing_keys, unexpected_keys,
workers/modeling_chatglm_med.py:247
Method_reorder_cache
This function is used to re-order the `past_key_values` cache if [`~PreTrainedModel.beam_search`] or [`~PreTrainedModel.beam_sample`]
workers/chatglm3_modeling.py:981
Method_reorder_cache
This function is used to re-order the `past_key_values` cache if [`~PreTrainedModel.beam_search`] or [`~PreTrainedModel.beam_sample`]
workers/modeling_chatglm_med.py:1165
Method_set_gradient_checkpointing
(self, module, value=False)
workers/chatglm3_modeling.py:700
Method_set_gradient_checkpointing
(self, module, value=False)
workers/modeling_chatglm_med.py:713
Methodattention_mask_func
(attention_scores, attention_mask)
workers/modeling_chatglm_med.py:446
Methodbuild_layer
(layer_number)
workers/chatglm3_modeling.py:592
Methodchat
(self, tokenizer, query: str, history: List[Dict] = None, role: str = "user", max_length: int = 8
workers/chatglm3_modeling.py:1021
Methodchat
(self, tokenizer, query: str, history: List[Tuple[str, str]] = None, max_length: int = 2048, num_beams=1,
workers/modeling_chatglm_med.py:1184
Methodcollate_conv
(self, data, eos="</s>")
workers/baichuanchat.py:51
Methodcollate_conv
(self, data)
workers/chatglm3_6b.py:48
Methodcollate_conv
(self, data)
workers/chatglm_med.py:48
Methodcollate_conv
(self, data)
workers/chatmed_consult.py:54
Methodcollate_conv
(self, data, eos='</s>')
workers/huatuo_chat.py:39
Methodcollate_conv
(self, data, return_history=False)
workers/qizhen_cama_13b.py:73
Methodcollate_conv
(self, data, convs)
workers/base.py:115
Methodcollate_conv
(self, data)
workers/doctorglm.py:67
Methodcollate_conv
(self, data,)
workers/medicalgpt.py:56
Methodcollate_conv
(self, data)
workers/mymodel.py:37
next →1–100 of 210, ranked by callers