MCPcopy Create free account

hub / github.com/Mwie1024/Extra-CoT / functions

Functions1,850 in github.com/Mwie1024/Extra-CoT

↓ 1 callersFunctioncompute_device_flops
r"""Calculate the FLOPs of the device capability per second.
llamafactory/scripts/stat_utils/cal_mfu.py:86
↓ 1 callersFunctioncompute_model_flops
r"""Calculate the FLOPs of model per forward/backward pass.
llamafactory/scripts/stat_utils/cal_mfu.py:29
↓ 1 callersMethodcompute_preference_loss
r"""Compute loss for preference learning.
llamafactory/src/llamafactory/train/dpo/trainer.py:179
↓ 1 callersMethodcompute_reference_log_probs
r"""Compute log probabilities of the reference model.
llamafactory/src/llamafactory/train/kto/trainer.py:187
↓ 1 callersMethodcompute_reference_log_probs
r"""Compute log probabilities of the reference model.
llamafactory/src/llamafactory/train/dpo/trainer.py:239
↓ 1 callersFunctionconfigure_attn_implementation
(config: "PretrainedConfig", model_args: "ModelArguments")
llamafactory/src/llamafactory/model/model_utils/attention.py:32
↓ 1 callersFunctionconfigure_kv_cache
(config: "PretrainedConfig", model_args: "ModelArguments", is_trainable: bool)
llamafactory/src/llamafactory/model/model_utils/kv_cache.py:29
↓ 1 callersFunctionconfigure_longlora
(config: "PretrainedConfig", model_args: "ModelArguments", is_trainable: bool)
llamafactory/src/llamafactory/model/model_utils/longlora.py:359
↓ 1 callersFunctionconfigure_moe
(config: "PretrainedConfig", model_args: "ModelArguments", is_trainable: bool)
llamafactory/src/llamafactory/model/model_utils/moe.py:114
↓ 1 callersFunctionconfigure_packing
(model_args: "ModelArguments", is_trainable: bool)
llamafactory/src/llamafactory/model/model_utils/packing.py:110
↓ 1 callersFunctionconfigure_quantization
r"""Priority: PTQ-quantized (train/infer) > AutoGPTQ (export) > On-the-fly quantization (train/infer).
llamafactory/src/llamafactory/model/model_utils/quantization.py:82
↓ 1 callersFunctionconfigure_rope
(config: "PretrainedConfig", model_args: "ModelArguments")
llamafactory/src/llamafactory/model/model_utils/rope.py:35
↓ 1 callersFunctionconfigure_visual_model
r"""Patch VLMs before loading them.
llamafactory/src/llamafactory/model/model_utils/visual.py:148
↓ 1 callersFunctionconvert_id_to_int
将JSONL文件中的id字段从字符串转换为整数 Args: input_file: 输入的JSONL文件路径 output_file: 输出的JSONL文件路径,如果为None则覆盖原文件
src/data/compressor/dataset_preparation/camel/camel_chunk_only_cot/convert_id_to_int.py:13
↓ 1 callersFunctionconvert_pretrained_model_to_mod
( model: "PreTrainedModel", config: "PretrainedConfig", model_args: "ModelArguments" )
llamafactory/src/llamafactory/model/model_utils/mod.py:32
↓ 1 callersFunctioncount_char_run
(s: str)
src/data/sft/longformer_pipeline/query_result/Compression/RL_actual_ratio/filter_bad_sample.py:153
↓ 1 callersFunctioncount_compression_ratio_per_sample
返回 [(index, cot_tokens, compressed_cot_tokens, ratio), ...]
src/data/compressor_longformer/validate/tokenize_analysis.py:87
↓ 1 callersFunctioncount_compression_ratio_per_sample
返回 [(index, cot_tokens, compressed_cot_tokens, ratio), ...]
src/data/compressor_longformer/validate/longformer_pipeline/llama3.2_3b_instruct/tokenize_analysis.py:87
↓ 1 callersFunctioncount_non_special_tokens
(tokenizer, text: str)
src/eval/qwen1p7b_eval/vllm_eval.py:135
↓ 1 callersFunctioncount_non_special_tokens
(tokenizer, text: str)
src/eval/qwen1p7b_eval/special_token_vllm.py:171
↓ 1 callersFunctioncount_non_special_tokens
(tokenizer, text: str)
src/eval/qwen1p7b_eval/mmlu-stem/eval_vllm.py:174
↓ 1 callersFunctioncount_tokens
(text: str, enc: Optional[object])
src/data/compressor_longformer/validate/eval_utils/count_token.py:68
↓ 1 callersFunctioncount_tokens
(enc, text: str)
src/data/sft/longformer_pipeline/query_result/Compression/clean_bad_samples.py:110
↓ 1 callersFunctioncount_tokens
(enc, s: str)
src/data/sft/longformer_pipeline/query_result/Compression/SFT_actual_ratio_intesection/filter_bad_sample.py:57
↓ 1 callersFunctioncount_tokens
返回 (token_count, char_count)
src/training/qwen1p7b_rl/dataset/rl_dataset/basemodel_token_state.py:55
↓ 1 callersFunctioncreate_chat_completion_response
( request: "ChatCompletionRequest", chat_model: "ChatModel" )
llamafactory/src/llamafactory/api/chat.py:184
↓ 1 callersFunctioncreate_ds_config
r"""Create deepspeed config in the current directory.
llamafactory/src/llamafactory/webui/common.py:228
↓ 1 callersFunctioncreate_eval_tab
(engine: "Engine")
llamafactory/src/llamafactory/webui/components/eval.py:33
↓ 1 callersFunctioncreate_export_tab
(engine: "Engine")
llamafactory/src/llamafactory/webui/components/export.py:118
↓ 1 callersFunctioncreate_footer
()
llamafactory/src/llamafactory/webui/components/footer.py:39
↓ 1 callersFunctioncreate_infer_tab
(engine: "Engine")
llamafactory/src/llamafactory/webui/components/infer.py:32
↓ 1 callersFunctioncreate_lingua
(llmlingua_path: str)
src/data/compressor_longformer/eval/compare_longformer_llmlingua2/compare.py:97
↓ 1 callersFunctioncreate_lingua
(llmlingua_path: str)
src/data/compressor_longformer/validate/Tokenskip_pipeline/llmlingua2_compression.py:123
↓ 1 callersMethodcreate_optimizer
( self, model: "AutoModelForCausalLMWithValueHead", training_args: "Seq2SeqTrainingArg
llamafactory/src/llamafactory/train/ppo/trainer.py:298
↓ 1 callersFunctioncreate_reward_model
r"""Create reward model for PPO training.
llamafactory/src/llamafactory/train/trainer_utils.py:146
↓ 1 callersMethodcreate_scheduler
( self, training_args: "Seq2SeqTrainingArguments", num_training_steps: int, optimizer: "torch.optim.Op
llamafactory/src/llamafactory/train/ppo/trainer.py:325
↓ 1 callersFunctioncreate_score_evaluation_response
( request: "ScoreEvaluationRequest", chat_model: "ChatModel" )
llamafactory/src/llamafactory/api/chat.py:277
↓ 1 callersFunctioncreate_stream_chat_completion_response
( request: "ChatCompletionRequest", chat_model: "ChatModel" )
llamafactory/src/llamafactory/api/chat.py:238
↓ 1 callersMethodcreate_sub
(self, idx: int, total: int)
src/data/compressor/dataset_preparation/API/gpt-4o.py:357
↓ 1 callersMethodcreate_sub
(self, id: int, total: int)
src/data/compressor/dataset_preparation/API/gpt4o_ranges_labeler.py:587
↓ 1 callersFunctioncreate_top
()
llamafactory/src/llamafactory/webui/components/top.py:33
↓ 1 callersFunctioncreate_train_tab
(engine: "Engine")
llamafactory/src/llamafactory/webui/components/train.py:37
↓ 1 callersFunctioncreate_visualizations
创建多种可视化图表 Args: stats: 分析统计结果 output_dir: 输出目录
src/data/compressor/dataset_preparation/API/visualize_compression_ratio.py:21
↓ 1 callersFunctioncreate_visualizations
创建可视化图表
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/check_token_distribution.py:177
↓ 1 callersFunctioncreate_visualizations
创建可视化图表
src/data/compressor/dataset_preparation/camel/camel_chunk_only_cot/check_token_distribution.py:177
↓ 1 callersFunctioncreate_web_demo
()
llamafactory/src/llamafactory/webui/interface.py:73
↓ 1 callersFunctionctx
(s: str, pos: int, w: int = 48)
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/audit_chunk_result.py:55
↓ 1 callersFunctiondefault_stops
(model_type: str)
src/training/qwen1p7b_rl/dataset/vllm_inference.py:114
↓ 1 callersFunctiondigit_like_fraction
(words)
src/data/sft/longformer_pipeline/query_result/Compression/SFT_actual_ratio_intesection/filter_bad_sample.py:42
↓ 1 callersFunctiondump_any_json
(data: Union[List[dict], dict], fmt: str, out_path: Path)
src/data/sft/longformer_pipeline/query_result/autofollow_sft_dataset/clear_consecutive_symbol_exclude_three_dot.py:98
↓ 1 callersFunctiondump_jsonl
(path: str, rows: List[dict])
src/training/qwen1p7b_rl/dataset/merge_data.py:96
↓ 1 callersFunctiondump_layernorm
r"""Dump the layernorm parameters in the model. The model is already unwrapped (and gathered).
llamafactory/src/llamafactory/train/ppo/ppo_utils.py:65
↓ 1 callersFunctiondump_special_tokens_file
输出一个 JSON(便于直接传给 tokenizer 的 additional_special_tokens): { "additional_special_tokens": ["<COMP_100>","<COMP_80>",...] }
src/data/compressor_longformer/validate/build_llamafactory_input_special_token.py:260
↓ 1 callersFunctiondump_special_tokens_file
(path: str, special_map: Dict[float, str], auto_token: str)
src/data/compressor_longformer/validate/build_mixture_llamafactory.py:345
↓ 1 callersFunctionensure_output_dir
(path: str)
src/data/compressor/dataset_preparation/API/gpt-4o.py:185
↓ 1 callersFunctionensure_output_dir
(path: str)
src/data/compressor/dataset_preparation/API/gpt4o_ranges_labeler.py:192
↓ 1 callersFunctionenumerate_tokens
(tokens: List[str])
src/data/compressor/dataset_preparation/index_retrival.py:41
↓ 1 callersFunctionenumerate_tokens
(tokens: List[str], base: int = 1, zpad: int = 3)
src/data/compressor/dataset_preparation/API/gpt-4o.py:81
↓ 1 callersFunctionenumerate_tokens
(tokens: List[str], base: int = 1, zpad: int = 3)
src/data/compressor/dataset_preparation/API/gpt4o_ranges_labeler.py:93
↓ 1 callersFunctionenumerate_tokens
(tokens: List[str])
src/data/compressor/dataset_preparation/API/gpt_4o_format.py:36
↓ 1 callersFunctionenumerate_tokens
(tokens: List[str], base: int = 1, zpad: int = 3)
src/data/compressor/dataset_preparation/API/api_result_completiness/retry_empty_chunks.py:64
↓ 1 callersFunctioneval_one_model
( input_path: str, output_root: str, tag: str, base_url: str, served_name: str, original_model: st
src/data/compressor_longformer/validate/eval_utils/evaluate.py:344
↓ 1 callersFunctionevaluate
( model: nn.Module, eval_loader: DataLoader, criterion: nn.Module, device: torch.device, f
src/data/compressor_longformer/train/train_longformer.py:323
↓ 1 callersFunctionevaluate_argmax
(model, loader, device, fp16: bool)
src/data/compressor_longformer/train/train_longformer_v2.py:360
↓ 1 callersFunctionevaluate_by_id
(b_path: str, gold: Dict[str, str], b_id_keys: List[str],
src/data/compressor_longformer/validate/eval_utils/tmp.py:130
↓ 1 callersFunctionevaluate_jsonl
(jsonl_path: str)
src/training/qwen1p7b_rl/dataset/rl_dataset/check_basemodel_accuracy.py:251
↓ 1 callersFunctionevaluate_topk
(model, loader, device, fp16: bool, ratios: List[float])
src/data/compressor_longformer/train/train_longformer_v2.py:394
↓ 1 callersFunctionexample_usage
()
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/chunk_camel_data.py:494
↓ 1 callersFunctionexample_usage
()
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/claude_chunk_camel_data.py:615
↓ 1 callersMethodextract
r"""Extract a list of tuples from the response message if using tools. Each tuple consists of function name and function arguments.
llamafactory/src/llamafactory/data/formatter.py:37
↓ 1 callersFunctionextract_answer_from_response
(text: str)
src/data/compressor_longformer/validate/eval_utils/tmp.py:46
↓ 1 callersFunctionextract_boxed
(text: str)
src/data/compressor_longformer/validate/build_llamafactory_input_special_token.py:45
↓ 1 callersFunctionextract_boxed
(text: str)
src/data/compressor_longformer/validate/build_llamafactory_input.py:46
↓ 1 callersFunctionextract_boxed
(text: str)
src/data/compressor_longformer/validate/build_mixture_llamafactory.py:47
↓ 1 callersFunctionextract_common_fields
(rec: Dict[str, Any], model_type: str = "qwen")
src/data/compressor_longformer/validate/Tokenskip_pipeline/llmlingua2_compression.py:102
↓ 1 callersFunctionextract_correct_from_response
在 response 中查找最后一次出现的 'The answer is: xxx' 并返回 xxx。
src/training/qwen1p7b_rl/dataset/rl_dataset/check_basemodel_accuracy.py:17
↓ 1 callersFunctionextract_cot
- llama3:可能要从 output 中切 'The final answer is:' 之前内容; - qwen(默认):直接用 rec['model_output'];若含<think>…</think>则仅取其中内容。
src/data/compressor_longformer/validate/longformer_pipeline/longformer_tokenizer_compression.py:83
↓ 1 callersFunctionextract_cot
- llama3:可能要从 output 中切 'The final answer is:' 之前内容; - qwen(默认):直接用 rec['model_output'];若含<think>…</think>则仅取其中内容。
src/data/sft/longformer_pipeline/longformer_compressor.py:53
↓ 1 callersFunctionextract_cot_segment
优先 <think>…</think>;其次 \boxed{ 之前;再 'The final answer is' 之前;最后整段。
src/data/compressor_longformer/validate/eval_utils/evaluate_local.py:167
↓ 1 callersFunctionextract_cot_segment
优先 <think>…</think>;其次 \boxed{ 之前;再 'The final answer is' 之前;最后整段。
src/data/compressor_longformer/validate/eval_utils/eval_lora.py:210
↓ 1 callersFunctionextract_gold_from_response
(text: str)
src/data/compressor_longformer/validate/eval_utils/evaluate.py:77
↓ 1 callersFunctionextract_gold_from_response
(response: str)
src/training/qwen1p7b_rl/dataset/merge_data.py:36
↓ 1 callersFunctionextract_gold_from_response
(s: str)
src/training/qwen1p7b_rl/dataset/rl_dataset/build_diff_by_model_ratio.py:30
↓ 1 callersFunctionextract_gold_from_response
(s: str)
src/training/qwen1p7b_rl/dataset/rl_dataset/build_diff.py:29
↓ 1 callersFunctionextract_gold_from_response
(s: str)
src/training/qwen1p7b_rl/dataset/rl_dataset/filter_by_ratio_window.py:54
↓ 1 callersFunctionextract_gold_from_response_last_answer_line
(resp: str)
src/eval/qwen1p7b_eval/vllm_eval.py:67
↓ 1 callersFunctionextract_gold_from_response_last_answer_line
(resp: str)
src/eval/qwen1p7b_eval/special_token_vllm.py:103
↓ 1 callersFunctionextract_gold_from_response_last_answer_line
(resp: str)
src/eval/qwen1p7b_eval/mmlu-stem/eval_vllm.py:106
↓ 1 callersFunctionextract_gold_from_response_last_sentence
你的数据:GT 从 response 的最后一句抽取。 规则:若含 \\boxed{...} → 用最后一个 boxed; 否则取最后一句/最后一行,抽取分数/数字/百分,若没有就原样返回。
src/data/compressor_longformer/validate/eval_utils/evaluate_local.py:259
↓ 1 callersFunctionextract_gold_from_response_last_sentence
你的数据:GT 从 response 的最后一句抽取。 规则:若含 \\boxed{...} → 用最后一个 boxed; 否则取最后一句/最后一行,抽取分数/数字/百分,若没有就原样返回。
src/data/compressor_longformer/validate/eval_utils/eval_lora.py:302
↓ 1 callersFunctionextract_gt_answer
(response: str)
src/training/qwen1p7b_rl/dataset/vllm_inference.py:139
↓ 1 callersFunctionextract_gt_from_response
从 response 的末尾解析 ground truth。 固定格式:\\nThe answer is: xxx. 仅提取 xxx(去掉末尾句点)。
src/data/sft/metamath_145k_query/filter_correct_answer.py:19
↓ 1 callersFunctionextract_last_boxed
返回 text 中最后一次出现的 \boxed{...} 或 \fbox{...} 的完整花括号内容(支持嵌套)。
src/eval/qwen1p7b_eval/recheck_accuracy.py:19
↓ 1 callersFunctionextract_last_boxed
(text: str)
src/eval/qwen1p7b_eval/mmlu-stem/recheck_acc.py:19
↓ 1 callersFunctionextract_last_boxed
(text: str)
src/training/qwen1p7b_rl/dataset/merge_data.py:32
↓ 1 callersFunctionextract_last_boxed
(s: str)
src/training/qwen1p7b_rl/dataset/rl_dataset/build_diff_by_model_ratio.py:34
↓ 1 callersFunctionextract_last_boxed
返回 text 中最后一次出现的 \boxed{...} 的花括号完整内容,支持嵌套括号。
src/training/qwen1p7b_rl/dataset/rl_dataset/check_basemodel_accuracy.py:31
↓ 1 callersFunctionextract_last_boxed
(s: str)
src/training/qwen1p7b_rl/dataset/rl_dataset/build_diff.py:33
↓ 1 callersFunctionextract_last_boxed
(s: str)
src/training/qwen1p7b_rl/dataset/rl_dataset/filter_by_ratio_window.py:46
↓ 1 callersFunctionextract_last_boxed_expr
从右往左,仅提取 **最后一个** \\boxed{...} 的内容。 使用括号计数以支持内部包含花括号(如 \\frac{1}{2})。
src/data/sft/metamath_145k_query/filter_correct_answer.py:30
← previousnext →701–800 of 1,850, ranked by callers