MCPcopy Create free account

hub / github.com/Tencent-Hunyuan/Hy-MT2 / functions

Functions89 in github.com/Tencent-Hunyuan/Hy-MT2

↓ 3 callersFunction_extract_score
(val)
IFMTBench/eval/llm_judge.py:233
↓ 3 callersFunctionprint_args
Print arguments.
train/deepspeed_support/train.py:55
↓ 3 callersFunctionprint_args
Print arguments.
train/deepspeed_support/train_dense.py:64
↓ 2 callersFunction_call_llm_with_retry
Call LLM with retry logic.
IFMTBench/eval/llm_judge.py:132
↓ 2 callersFunction_install_signal_handlers
Install handlers for SIGBUS and SIGSEGV in the current process.
train/tools/convert_ckpt_to_outer.py:90
↓ 2 callersFunction_parse_md_table
(text)
IFMTBench/eval/rule_validators.py:211
↓ 2 callersFunctioncompute_summary
Compute aggregated scoring statistics.
IFMTBench/eval/scoring.py:242
↓ 2 callersMethoderror
(self, message)
IFMTBench/eval/rule_validators.py:125
↓ 2 callersFunctionget_class_list
Extract the class list from an item.
IFMTBench/eval/scoring.py:35
↓ 2 callersFunctionload_jsonl
Load a JSONL file.
IFMTBench/run_eval.py:46
↓ 2 callersFunctionrename_key
Rename a single key from inner to outer format.
train/tools/convert_ckpt_to_outer.py:124
↓ 2 callersFunctionscore_single_dimension
Score a single constraint dimension. Args: item: Test data entry (contains input, output, origin_text, meta_data, etc.) cls:
IFMTBench/eval/scoring.py:43
↓ 2 callersFunctionsplit_row
(line)
IFMTBench/eval/rule_validators.py:216
↓ 1 callersFunction_apply_router_dtype_patch
Monkey-patch HYV3TopKRouter.forward to align gate input dtype with weight dtype.
train/llama_factory_support/hy_v3_patches.py:51
↓ 1 callersFunction_apply_save_reverse_rename_patch
()
train/deepspeed_support/train.py:388
↓ 1 callersFunction_call_llm
Call LLM API (OpenAI-compatible endpoint).
IFMTBench/eval/llm_judge.py:106
↓ 1 callersFunction_check_json_keys
(origin, output, path="$")
IFMTBench/eval/rule_validators.py:146
↓ 1 callersFunction_copy_tokenizer_to_checkpoint
Copy tokenizer files from tokenizer_dir to checkpoint_dir.
train/llama_factory_support/hy_v3_patches.py:127
↓ 1 callersFunction_parse_json_from_text
Parse JSON from LLM output text.
IFMTBench/eval/llm_judge.py:148
↓ 1 callersFunctionbatch_score
Batch scoring. Args: test_data: List of test data items responses: {(md5, instruction_lang): response_text} mapping
IFMTBench/eval/scoring.py:195
↓ 1 callersFunctioncheck_expected_keys
Check that all expected keys exist in the weight_map.
train/tools/check_converted.py:129
↓ 1 callersFunctioncheck_index_json
Check model.safetensors.index.json for structure and completeness.
train/tools/check_converted.py:94
↓ 1 callersFunctioncheck_key_distribution
Check the distribution of keys across shards.
train/tools/check_converted.py:272
↓ 1 callersFunctioncheck_shard_files
Check that all referenced shard files exist and are non-empty.
train/tools/check_converted.py:209
↓ 1 callersFunctioncompose_multi_scores
Compose multi-dimension scores: final = gate_score × avg(continuous_scores)
IFMTBench/eval/scoring.py:120
↓ 1 callersFunctionconvert_shard
Load a single shard, rename keys, and fuse experts. For expert groups in cross_shard_prefixes, the per-expert keys are kept as-is (just renam
train/tools/convert_ckpt_to_outer.py:158
↓ 1 callersMethodencode_data
(self, data_dict)
train/deepspeed_support/train.py:174
↓ 1 callersMethodencode_data
(self, data_dict)
train/deepspeed_support/train_dense.py:167
↓ 1 callersFunctionload_config
Load config.json and extract model parameters.
train/tools/check_converted.py:84
↓ 1 callersMethodload_data
(self, data_file)
train/deepspeed_support/train.py:167
↓ 1 callersMethodload_data
(self, data_file)
train/deepspeed_support/train_dense.py:160
↓ 1 callersFunctionload_responses
Load model output file, returning a {(md5, instruction_lang): response} mapping. Also builds a fallback {md5: response} mapping for entries w
IFMTBench/run_eval.py:57
↓ 1 callersFunctionmain
()
IFMTBench/run_eval.py:82
↓ 1 callersFunctionmain
()
train/tools/check_converted.py:359
↓ 1 callersFunctionmain
()
train/tools/convert_ckpt_to_outer.py:466
↓ 1 callersFunctionmain
()
train/deepspeed_support/merge_lora_weight.py:9
↓ 1 callersFunctionmain
Entry point: called by torchrun in each worker process. Since train_lf.sh launches us via torchrun directly, all patches (template registrati
train/llama_factory_support/train_hy_v3.py:59
↓ 1 callersFunctionmain
Entry point: called by torchrun in each worker process. Since train_lf_dense.sh launches us via torchrun directly, all patches (template regi
train/llama_factory_support/train_hy_dense.py:69
↓ 1 callersFunctionmake_supervised_data_module
Make dataset and collator for supervised fine-tuning.
train/deepspeed_support/train.py:235
↓ 1 callersFunctionmake_supervised_data_module
Make dataset and collator for supervised fine-tuning.
train/deepspeed_support/train_dense.py:232
↓ 1 callersFunctionpost_process_cross_shard_experts
Merge cross-shard expert groups (v2: shard-centric approach). Instead of iterating per-prefix (which causes the same shard to be loaded/saved
train/tools/convert_ckpt_to_outer.py:279
↓ 1 callersFunctionprint_summary
Print scoring summary.
IFMTBench/eval/scoring.py:283
↓ 1 callersFunctionscan_cross_shard_experts
Pre-scan index.json to find expert groups that span multiple shards. Returns: cross_shard_prefixes: set of expert prefixes that span mult
train/tools/convert_ckpt_to_outer.py:132
↓ 1 callersFunctionscore_glossary_judge
Glossary LLM Judge (binary 0/1).
IFMTBench/eval/llm_judge.py:176
↓ 1 callersFunctionscore_one_item
Score a single data item. Args: item: Test data entry model_response: Model output Returns: Scoring result dict
IFMTBench/eval/scoring.py:154
↓ 1 callersFunctionscore_style_background_judge
Style/Background LLM Judge (0-5 scale, normalized to 0-1).
IFMTBench/eval/llm_judge.py:209
↓ 1 callersFunctionspot_check_shards
Spot-check a few shards by loading and verifying tensor shapes.
train/tools/check_converted.py:289
↓ 1 callersFunctiontrain
()
train/deepspeed_support/train.py:273
↓ 1 callersFunctiontrain
()
train/deepspeed_support/train_dense.py:273
↓ 1 callersFunctionvalidate_code_assets
Code/tag preservation check: verifies model_response contains all extracted_assets.
IFMTBench/eval/rule_validators.py:271
↓ 1 callersFunctionvalidate_glossary
Glossary rule check: verifies that model_response contains the correct target terms from term_dict. For multi-candidate scenarios, cross-vali
IFMTBench/eval/rule_validators.py:22
↓ 1 callersFunctionvalidate_layout
Layout preservation check: verifies chunk count consistency after delimiter splitting.
IFMTBench/eval/rule_validators.py:82
↓ 1 callersFunctionvalidate_structured
Structured data validation: checks if translation preserves the original data structure.
IFMTBench/eval/rule_validators.py:251
Method__call__
(self, instances)
train/deepspeed_support/train.py:222
Method__call__
(self, instances)
train/deepspeed_support/train_dense.py:219
Method__getitem__
(self, index)
train/deepspeed_support/train.py:151
Method__getitem__
(self, index)
train/deepspeed_support/train.py:208
Method__getitem__
(self, index)
train/deepspeed_support/train_dense.py:145
Method__getitem__
(self, index)
train/deepspeed_support/train_dense.py:206
Method__init__
(self)
IFMTBench/eval/rule_validators.py:115
Method__init__
(self, tokenizer, max_seq_length=512, length=1000)
train/deepspeed_support/train.py:143
Method__init__
(self, data_file, tokenizer, max_seq_length = 2048, prompt_format = 'mplus')
train/deepspeed_support/train.py:157
Method__init__
(self, tokenizer, max_seq_length=512, length=1000)
train/deepspeed_support/train_dense.py:137
Method__init__
(self, data_file, tokenizer, max_seq_length=4096, model_size="1.8B")
train/deepspeed_support/train_dense.py:151
Method__init__
Args: tokenizer_dir: Path to the original tokenizer directory. If None, will try to use model_name_or
train/llama_factory_support/hy_v3_patches.py:150
Method__len__
(self)
train/deepspeed_support/train.py:148
Method__len__
(self)
train/deepspeed_support/train.py:164
Method__len__
(self)
train/deepspeed_support/train_dense.py:142
Method__len__
(self)
train/deepspeed_support/train_dense.py:157
Function_dtype_safe_linear
(input, weight, bias=None)
train/deepspeed_support/train.py:552
Function_fatal_signal_handler
Handle fatal signals (SIGBUS, SIGSEGV) by logging before exit. These signals cannot be caught by try/except. This handler ensures the error m
train/tools/convert_ckpt_to_outer.py:68
Function_patched_load_zero3
(model_to_load, state_dict, load_config=None)
train/deepspeed_support/train.py:330
Function_patched_router_forward
( self, hidden_states: torch.Tensor, e_score_correction_bias: torch.Tensor, )
train/llama_factory_support/hy_v3_patches.py:69
Function_patched_run_sft
Wrap run_sft to inject HYV3PatchCallback.
train/llama_factory_support/train_hy_v3.py:42
Function_patched_run_sft
Wrap run_sft to inject HYV3PatchCallback for tokenizer copy.
train/llama_factory_support/train_hy_dense.py:52
Function_patched_save_pretrained
(self, *args, **kwargs)
train/deepspeed_support/train.py:401
Function_pool_worker_init
Initializer for multiprocessing pool workers. Installs signal handlers so that Bus errors in worker processes are also logged before the proc
train/tools/convert_ckpt_to_outer.py:100
Function_process_one_shard
Worker function: convert a single shard and save to output dir. Args: args_tuple: (idx, num_shards, shard_file, input_dir, output_dir, cr
train/tools/convert_ckpt_to_outer.py:239
Function_validate_csv_struct
(origin_text, output_text)
IFMTBench/eval/rule_validators.py:189
Function_validate_html_struct
(origin_text, output_text)
IFMTBench/eval/rule_validators.py:167
Function_validate_json_struct
(origin_text, output_text)
IFMTBench/eval/rule_validators.py:129
Function_validate_markdown_struct
(origin_text, output_text)
IFMTBench/eval/rule_validators.py:226
Function_worker
(idx)
IFMTBench/eval/scoring.py:215
Methodhandle_endtag
(self, tag)
IFMTBench/eval/rule_validators.py:122
Methodhandle_starttag
(self, tag, attrs)
IFMTBench/eval/rule_validators.py:119
Methodon_save
(self, args, state, control, **kwargs)
train/deepspeed_support/train.py:251
Methodon_save
(self, args, state, control, **kwargs)
train/deepspeed_support/train_dense.py:249
Methodon_save
(self, args, state, control, **kwargs)
train/llama_factory_support/hy_v3_patches.py:169
Methodon_train_begin
(self, args, state, control, **kwargs)
train/llama_factory_support/hy_v3_patches.py:158