MCPcopy Create free account

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

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

↓ 1 callersMethodsimpo_loss
r"""Compute SimPO loss for batched log probabilities of the policy model.
llamafactory/src/llamafactory/train/dpo/trainer.py:152
↓ 1 callersFunctionskip_check_imports
r"""Avoid flash attention import error in custom model files.
llamafactory/src/llamafactory/extras/misc.py:248
↓ 1 callersMethodsmart_chunk
智能分块CoT
src/data/compressor/dataset_preparation/smart_chunker.py:64
↓ 1 callersMethodsmart_chunk_split
基于句子边界的智能分割
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/chunk_camel_data.py:219
↓ 1 callersMethodsmart_chunk_split
基于句子边界的智能分割
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/claude_chunk_camel_data.py:217
↓ 1 callersFunctionsplit_data
(data: List[Dict[str, Any]], num_processes: int)
src/data/compressor_longformer/validate/inference_metamath.py:290
↓ 1 callersFunctionsplit_data
(data: List[Dict[str, Any]], num_processes: int)
src/training/qwen1p7b_rl/dataset/vllm_inference.py:318
↓ 1 callersFunctionsplit_dataset
r"""Split the dataset and returns a dataset dict containing train set and validation set. Support both map dataset and iterable dataset.
llamafactory/src/llamafactory/data/data_utils.py:79
↓ 1 callersMethodsplit_into_sentences
(self, text: str)
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/gpt_chunk_camel_data.py:278
↓ 1 callersMethodsplit_into_sentences
(self, text: str)
src/data/compressor/dataset_preparation/camel/camel_chunk_only_cot/gpt_chunk_camel_data.py:278
↓ 1 callersFunctionsplit_list
(xs: List[Any], nproc: int)
src/data/compressor_longformer/validate/eval_utils/evaluate.py:309
↓ 1 callersFunctionsplit_on_commas_tokenaware
(s: str, a: int, b: int, toks: List[Token])
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/math_tokenizer_no_space.py:340
↓ 1 callersFunctionsplit_on_strong_seps
(s: str, a: int, b: int, toks: List[Token])
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/math_tokenizer_no_space.py:325
↓ 1 callersFunctionstratified_pick
(jsonl_in: str, jsonl_out: str, target_n: int = 10000, seed: int = 42)
src/data/compressor/dataset_preparation/API/dataset_split/sampler.py:65
↓ 1 callersFunctionstream_records_any
(path: str)
src/data/compressor_longformer/validate/inference_metamath.py:60
↓ 1 callersFunctionstream_records_any
(path: str)
src/training/qwen1p7b_rl/dataset/vllm_inference.py:64
↓ 1 callersFunctionstringify
(x)
src/training/qwen1p7b_rl/dataset/bucket_distribution_samples.py:45
↓ 1 callersFunctionstrip_existing_final_answer
去掉可见部分里已有的 "The final answer is: ..." 行,避免重复。 也顺带去掉非常见变体(大小写差异)。
src/data/compressor_longformer/validate/build_llamafactory_input.py:110
↓ 1 callersFunctionstrip_special_tokens_from_text
(text: str, tokenizer)
src/eval/qwen1p7b_eval/vllm_eval.py:181
↓ 1 callersFunctionstrip_special_tokens_from_text
(text: str, tokenizer)
src/eval/qwen1p7b_eval/mmlu-stem/eval_vllm.py:216
↓ 1 callersFunctionstrip_special_tokens_keep_first
在文本中仅保留**首个** special token;EOS 默认不保留;其它 special 全删。 返回:(清洗后的文本, 首个 special 的字符串或 None)
src/eval/qwen1p7b_eval/special_token_vllm.py:244
↓ 1 callersFunctionsummarize_compression_ratios
分析压缩比值的统计信息
src/data/compressor_longformer/validate/tokenize_analysis.py:108
↓ 1 callersFunctionsummarize_compression_ratios
分析压缩比值的统计信息
src/data/compressor_longformer/validate/longformer_pipeline/llama3.2_3b_instruct/tokenize_analysis.py:108
↓ 1 callersFunctionsweeper
()
llamafactory/src/llamafactory/api/app.py:54
↓ 1 callersFunctionsynthesize_long_QA_for_both
Use the LLMLingua tokenizer to gauge token length and build (question, answer_text, qa_full_preview). Both compressors will compress the SAME
src/data/compressor_longformer/eval/compare_longformer_llmlingua2/compare.py:380
↓ 1 callersMethodtest_and_audit_single
(self, text: str)
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/gpt_chunk_camel_data.py:643
↓ 1 callersMethodtest_and_audit_single
(self, text: str)
src/data/compressor/dataset_preparation/camel/camel_chunk_only_cot/gpt_chunk_camel_data.py:643
↓ 1 callersFunctiontest_chat
r"""Test the SGLang engine's basic chat functionality.
llamafactory/tests/e2e/test_sglang.py:43
↓ 1 callersFunctiontest_multimodal_collator
()
llamafactory/tests/data/test_collator.py:74
↓ 1 callersMethodtest_single_string
(self, text: str)
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/gpt_chunk_camel_data.py:587
↓ 1 callersMethodtest_single_string
(self, text: str)
src/data/compressor/dataset_preparation/camel/camel_chunk_only_cot/gpt_chunk_camel_data.py:587
↓ 1 callersFunctiontest_stream_chat
r"""Test the SGLang engine's streaming chat functionality.
llamafactory/tests/e2e/test_sglang.py:52
↓ 1 callersFunctionto_item
(rec: Dict[str,Any], buckets_desc: List[float], comp_tol: float, data_source_
src/training/qwen1p7b_rl/dataset/rl_4k/convert_data_to_verl.py:117
↓ 1 callersFunctionto_item
(rec: Dict[str,Any], buckets_desc: List[float], comp_tol: float, data_source_
src/training/qwen1p7b_rl/dataset/rl_tiktoken_10k/convert_data_to_verl.py:117
↓ 1 callersFunctionto_item
(rec: Dict[str,Any], buckets_desc: List[float], comp_tol: float, data_source_
src/training/qwen1p7b_rl/dataset/rl_model_ratio_v2/convert_data_to_verl.py:144
↓ 1 callersFunctionto_shares_from_counts
(counts: Dict[float,int])
src/training/qwen1p7b_rl/dataset/rl_4k/convert_data_to_verl.py:237
↓ 1 callersFunctionto_shares_from_counts
(counts: Dict[float,int])
src/training/qwen1p7b_rl/dataset/rl_tiktoken_10k/convert_data_to_verl.py:238
↓ 1 callersFunctionto_shares_from_counts
(counts: Dict[float,int])
src/training/qwen1p7b_rl/dataset/rl_model_ratio_v2/convert_data_to_verl.py:261
↓ 1 callersFunctiontoken_len
(enc, text: str)
src/training/qwen1p7b_rl/dataset/bucket_distribution_samples.py:87
↓ 1 callersFunctiontokenize_masked_with_offsets
(masked_text: str)
src/data/compressor/dataset_preparation/label_training_data/label_training_data.py:64
↓ 1 callersFunctiontokenize_with_offsets
(masked_text: str)
src/data/compressor/dataset_preparation/API/gpt-4o.py:87
↓ 1 callersFunctiontokenize_with_offsets
(masked_text: str)
src/data/compressor/dataset_preparation/API/gpt4o_ranges_labeler.py:85
↓ 1 callersFunctiontokenize_with_offsets
(masked_text: str)
src/data/compressor/dataset_preparation/API/api_result_completiness/retry_empty_chunks.py:56
↓ 1 callersFunctiontokens_to_text_and_offsets
依据 RoBERTa/Longformer 的 BPE“可视化惯例”重建文本,并给出每个 token 的字符区间 [L,R)。 规则: - 以 'Ġ' 表示前置空格:去掉 'Ġ',并在输出前补一个空格 - 以 '▁' 表示前置空格(兼容 SentencePi
src/data/compressor/dataset_preparation/label_training_data/visualization/pt2viewer_json.py:12
↓ 1 callersMethodtool_extractor
r"""Extract all the function calls from the assistant message. It should be an inverse function of `function_formatter`.
llamafactory/src/llamafactory/data/tool_utils.py:108
↓ 1 callersMethodtool_formatter
r"""Generate the system message describing all the available tools.
llamafactory/src/llamafactory/data/tool_utils.py:96
↓ 1 callersFunctiontrain_one_epoch
( epoch: int, model: nn.Module, loader: DataLoader, optimizer: torch.optim.Optimizer, sche
src/data/compressor_longformer/train/train_longformer_v2.py:252
↓ 1 callersFunctiontrain_one_epoch
( epoch: int, model: nn.Module, train_loader: DataLoader, optimizer: torch.optim.Optimizer,
src/data/compressor_longformer/train/train_longformer.py:245
↓ 1 callersFunctiontransform_output
在第一段 <think>...</think> 内: 1) 若开头是换行后紧跟 '.' 或 ','(含中文 ','),移除该标点及其后的空白 2) 末尾追加一行 'The final answer is \boxed{...}'
src/data/sft/longformer_pipeline/query_result/autofollow_sft_dataset/patch_think_and_remove_begin_symbol.py:65
↓ 1 callersFunctiontrim_span_chars
(s: str, a: int, b: int)
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/math_tokenizer_no_space.py:318
↓ 1 callersFunctiontrim_span_edges
(s: str, a: int, b: int, toks: List[Token])
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/math_tokenizer_no_space.py:400
↓ 1 callersFunctiontry_download_model_from_other_hub
(model_args: "ModelArguments")
llamafactory/src/llamafactory/extras/misc.py:267
↓ 1 callersFunctionttr_ratio
(seq: List[str])
src/data/sft/longformer_pipeline/query_result/Compression/RL_actual_ratio/filter_bad_sample.py:149
↓ 1 callersFunctionunmask_math
(text: str, mapping: Dict[str, str])
src/data/compressor/dataset_preparation/index_retrival.py:125
↓ 1 callersFunctionunmask_with_posmap
严格原位还原:扫描 masked_text;遇到 [MATH_k] 用 math_map 原样替换,其它字符逐字抄写。 同时构造 pos_map,长度= len(masked_text)+1,pos_map[i] = 还原后文本中,对应 masked_text[:i] 的输出长度。
src/data/compressor/dataset_preparation/label_training_data/label_training_data.py:71
↓ 1 callersFunctionupdate_attr
(obj: Any, name: str, value: Any)
llamafactory/src/llamafactory/webui/chatter.py:73
↓ 1 callersMethodupdate_main
(self, n=1)
src/data/compressor/dataset_preparation/API/gpt-4o.py:353
↓ 1 callersMethodupdate_main
(self, n=1)
src/data/compressor/dataset_preparation/API/gpt4o_ranges_labeler.py:583
↓ 1 callersMethodupdate_sub
(self, idx: int, n=1)
src/data/compressor/dataset_preparation/API/gpt-4o.py:363
↓ 1 callersMethodupdate_sub
(self, id: int, n=1)
src/data/compressor/dataset_preparation/API/gpt4o_ranges_labeler.py:593
↓ 1 callersMethodvalidate_chunks
(self, original_text: str, chunks: List[str])
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/gpt_chunk_camel_data.py:440
↓ 1 callersMethodvalidate_chunks
验证chunk结果
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/chunk_camel_data.py:345
↓ 1 callersMethodvalidate_chunks
验证chunk结果
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/claude_chunk_camel_data.py:343
↓ 1 callersMethodvalidate_chunks
(self, original_text: str, chunks: List[str])
src/data/compressor/dataset_preparation/camel/camel_chunk_only_cot/gpt_chunk_camel_data.py:440
↓ 1 callersFunctionvalidate_output
验证输出文件的格式
src/data/compressor/dataset_preparation/camel/camel_filter/final_dataset.py:128
↓ 1 callersFunctionvisualize_spans
(text: str, spans: List[Tuple[int,int]])
src/data/compressor/dataset_preparation/camel/camel_chunk_cot_and_answer/math_tokenizer_no_space.py:545
↓ 1 callersMethodwait
(self)
src/data/compressor/dataset_preparation/API/gpt-4o.py:219
↓ 1 callersMethodwait
(self)
src/data/compressor/dataset_preparation/API/gpt4o_ranges_labeler.py:250
↓ 1 callersMethodwait
(self)
src/data/compressor/dataset_preparation/API/api_result_completiness/retry_empty_chunks.py:208
↓ 1 callersFunctionwalk_and_recheck
(root: str, inplace: bool=False)
src/eval/qwen1p7b_eval/recheck_accuracy.py:339
↓ 1 callersFunctionwalk_and_recheck
(root: str, dataset_idx: Dict[str, Dict[str, Any]], inplace: bool=False)
src/eval/qwen1p7b_eval/mmlu-stem/recheck_acc.py:400
↓ 1 callersFunctionwhitespace_tokens
(s: str)
src/data/compressor/dataset_preparation/index_retrival.py:37
↓ 1 callersFunctionwhitespace_tokens
(s: str)
src/data/compressor/dataset_preparation/API/gpt_4o_format.py:32
↓ 1 callersFunctionwords_for_ngram
(s: str)
src/data/sft/longformer_pipeline/query_result/Compression/RL_actual_ratio/filter_bad_sample.py:116
↓ 1 callersFunctionwords_for_ngrams
(s: str)
src/data/sft/longformer_pipeline/query_result/Compression/SFT_actual_ratio_intesection/filter_bad_sample.py:19
↓ 1 callersFunctionwrite_json
(path: str, obj: Any)
src/data/sft/metamath_145k_query/select_sft_subset.py:58
↓ 1 callersFunctionwrite_json
(items: List[Dict[str, Any]], path: str)
src/eval/qwen1p7b_eval/recheck_accuracy.py:292
↓ 1 callersFunctionwrite_json
(items: List[Dict[str, Any]], path: str)
src/eval/qwen1p7b_eval/vllm_eval.py:32
↓ 1 callersFunctionwrite_json
(items: List[Dict[str, Any]], path: str)
src/eval/qwen1p7b_eval/special_token_vllm.py:71
↓ 1 callersFunctionwrite_json
(items: List[Dict[str, Any]], path: str)
src/eval/qwen1p7b_eval/mmlu-stem/eval_vllm.py:71
↓ 1 callersFunctionwrite_json
(items: List[Dict[str, Any]], path: str)
src/eval/qwen1p7b_eval/mmlu-stem/recheck_acc.py:270
↓ 1 callersFunctionwrite_json_array
(items, p: Path)
src/data/sft/longformer_pipeline/query_result/autofollow_sft_dataset/rewrite_follow_to_unified_json_v3.py:35
↓ 1 callersFunctionwrite_jsonl
(path: str, items: List[Dict[str, Any]])
src/data/compressor_longformer/validate/longformer_pipeline/filter_by_token_ratio.py:38
↓ 1 callersFunctionwrite_jsonl
(items: List[Dict[str, Any]], path: str)
src/data/compressor_longformer/validate/eval_utils/evaluate_local.py:53
↓ 1 callersFunctionwrite_jsonl
(items: List[Dict[str, Any]], path: str)
src/data/compressor_longformer/validate/eval_utils/eval_lora.py:57
↓ 1 callersFunctionwrite_jsonl
(path: str, rows: Iterable[Dict[str, Any]])
src/data/compressor_longformer/validate/eval_utils/tmp.py:20
↓ 1 callersFunctionwrite_jsonl
(path: str, rows: List[Dict[str, Any]])
src/data/sft/metamath_145k_query/select_sft_subset.py:46
↓ 1 callersFunctionwrite_jsonl
(path: str, items: List[Dict[str, Any]])
src/data/sft/longformer_pipeline/filter_by_token_ratio.py:38
↓ 1 callersFunctionwrite_jsonl
(items: Iterable[Dict[str, Any]], p: Path)
src/data/sft/longformer_pipeline/query_result/Compression/clean_bad_samples.py:40
↓ 1 callersFunctionwrite_list_to_json
(lst, file_path)
src/data/compressor_longformer/validate/llama_factory_0.5_0.7_0.9.py:13
↓ 1 callersFunctionwrite_list_to_json
(lst, file_path)
src/data/compressor_longformer/validate/build_llamafactory_input_special_token.py:28
↓ 1 callersFunctionwrite_list_to_json
(list, file_path)
src/data/compressor_longformer/validate/build_llamafactory_input_numeric.py:14
↓ 1 callersFunctionwrite_list_to_json
(lst, file_path)
src/data/compressor_longformer/validate/build_llamafactory_input.py:28
↓ 1 callersFunctionwrite_list_to_json
(lst, file_path)
src/data/compressor_longformer/validate/build_mixture_llamafactory.py:30
↓ 1 callersFunctionwrite_list_to_json
(list, file_path)
src/data/compressor_longformer/validate/longformer_pipeline/build_llamafactory_input_numeric.py:14
↓ 1 callersFunctionwrite_list_to_json
(list, file_path)
src/data/compressor_longformer/validate/Tokenskip_pipeline/build_llamafactory_input_numeric.py:14
↓ 1 callersFunctionwrite_list_to_json
(list, file_path)
src/data/compressor_longformer/validate/Tokenskip_pipeline/compression_llmlingua2/build_llamafactory_input_numeric.py:14
↓ 1 callersFunctionwrite_metrics
(pred_path: str, out_path: str, total_time: float, engine_desc: str, ratio_desc: str)
src/data/compressor_longformer/validate/eval_utils/evaluate.py:316
↓ 1 callersFunctionwrite_text
(path: str, text: str)
src/data/sft/metamath_145k_query/select_sft_subset.py:53
↓ 1 callersFunctionzero_pad_width_from_sources
( segs: List[Tuple[int, int]], total_tokens: int, provided_ranges: List )
src/data/compressor/dataset_preparation/index_retrival.py:99
← previousnext →1,301–1,400 of 1,850, ranked by callers