Repository Analysis

hiyouga/LlamaFactory

Unified Efficient Fine-Tuning of 100+ LLMs & VLMs (ACL 2024)

14.0 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of hiyouga/LlamaFactory, a Python project with 73,252 GitHub stars. SynthScan v2.0 examined 107,599 lines of code across 513 source files, recording 1240 pattern matches distributed across 23 syntactic categories. The overall adjusted score of 14.0 places this repository in the Low AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

14.0
Adjusted Score
14.0
Raw Score
100%
Time Factor
2026-07-13
Last Push
73.3K
Stars
Python
Language
107.6K
Lines of Code
513
Files
1.2K
Pattern Hits
2026-07-14
Scan Date
0.04
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 1HIGH 17MEDIUM 107LOW 1115

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 1240 distinct pattern matches across 23 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Unused Imports359 hits · 358 pts
SeverityFileLineSnippetContext
LOWtests/data/test_mm_plugin.py30CODE
LOWtests/data/test_mm_plugin.py30CODE
LOWtests/data/test_mm_plugin.py33CODE
LOWtests/data/test_mm_plugin.py34CODE
LOWtests/data/test_template.py28CODE
LOWdocs/zh/conf.py8CODE
LOWdocs/en/conf.py8CODE
LOWsrc/llamafactory/v1/core/rendering/__init__.py22CODE
LOWsrc/llamafactory/v1/config/__init__.py15CODE
LOWsrc/llamafactory/v1/config/__init__.py16CODE
LOWsrc/llamafactory/v1/config/__init__.py16CODE
LOWsrc/llamafactory/v1/config/__init__.py17CODE
LOWsrc/llamafactory/v1/config/__init__.py17CODE
LOWsrc/llamafactory/v1/config/__init__.py17CODE
LOWsrc/llamafactory/v1/config/__init__.py18CODE
LOWsrc/llamafactory/v1/config/__init__.py19CODE
LOWsrc/llamafactory/v1/config/__init__.py20CODE
LOWsrc/llamafactory/v1/config/__init__.py21CODE
LOW…afactory/v1/plugins/trainer_plugins/distributed/hub.py15CODE
LOW…/llamafactory/v1/plugins/model_plugins/quantization.py31CODE
LOW…/llamafactory/v1/plugins/model_plugins/quantization.py31CODE
LOW…y/v1/plugins/model_plugins/kernels/liger_kernel_ops.py27CODE
LOW…y/v1/plugins/model_plugins/kernels/liger_kernel_ops.py53CODE
LOW…ins/model_plugins/kernels/ops/rms_norm/npu_rms_norm.py30CODE
LOW…/v1/plugins/model_plugins/kernels/ops/rope/npu_rope.py29CODE
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py373CODE
LOW…v1/plugins/model_plugins/kernels/ops/mlp/npu_swiglu.py29CODE
LOWsrc/llamafactory/v1/utils/packages.py34CODE
LOWsrc/llamafactory/v1/utils/callbacks/__init__.py15CODE
LOWsrc/llamafactory/v1/utils/callbacks/__init__.py16CODE
LOWsrc/llamafactory/v1/utils/callbacks/__init__.py16CODE
LOWsrc/llamafactory/v1/utils/callbacks/__init__.py16CODE
LOWsrc/llamafactory/v1/utils/callbacks/logging_callback.py15CODE
LOWsrc/llamafactory/v1/utils/callbacks/trainer_callback.py15CODE
LOWsrc/llamafactory/v1/samplers/cli_sampler.py88CODE
LOWsrc/llamafactory/chat/hf_engine.py33CODE
LOWsrc/llamafactory/chat/hf_engine.py33CODE
LOWsrc/llamafactory/chat/hf_engine.py33CODE
LOWsrc/llamafactory/chat/hf_engine.py34CODE
LOWsrc/llamafactory/chat/hf_engine.py36CODE
LOWsrc/llamafactory/chat/hf_engine.py37CODE
LOWsrc/llamafactory/chat/hf_engine.py37CODE
LOWsrc/llamafactory/chat/hf_engine.py37CODE
LOWsrc/llamafactory/chat/hf_engine.py38CODE
LOWsrc/llamafactory/chat/hf_engine.py38CODE
LOWsrc/llamafactory/chat/hf_engine.py38CODE
LOWsrc/llamafactory/chat/hf_engine.py38CODE
LOWsrc/llamafactory/chat/vllm_engine.py34CODE
LOWsrc/llamafactory/chat/vllm_engine.py39CODE
LOWsrc/llamafactory/chat/vllm_engine.py39CODE
LOWsrc/llamafactory/chat/vllm_engine.py39CODE
LOWsrc/llamafactory/chat/vllm_engine.py40CODE
LOWsrc/llamafactory/chat/vllm_engine.py40CODE
LOWsrc/llamafactory/chat/vllm_engine.py40CODE
LOWsrc/llamafactory/chat/vllm_engine.py40CODE
LOWsrc/llamafactory/chat/sglang_engine.py29CODE
LOWsrc/llamafactory/chat/sglang_engine.py29CODE
LOWsrc/llamafactory/chat/sglang_engine.py29CODE
LOWsrc/llamafactory/chat/sglang_engine.py29CODE
LOWsrc/llamafactory/chat/sglang_engine.py40CODE
299 more matches not shown…
Over-Commented Block301 hits · 300 pts
SeverityFileLineSnippetContext
LOWtests/conftest.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/check_license.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/model/test_freeze.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/model/test_pissa.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/model/test_full.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/model/test_base.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/model/test_lora.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/model/model_utils/test_misc.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/model/model_utils/test_visual.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/model/model_utils/test_add_tokens.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/model/model_utils/test_embedding.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/model/model_utils/test_attention.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/model/model_utils/test_packing.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/model/model_utils/test_checkpointing.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/train/test_sft_trainer.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/eval/test_eval_template.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/e2e/test_train.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/e2e/test_sglang.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/e2e/test_chat.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/data/test_collator.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/data/test_loader.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/data/test_mm_plugin.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/data/test_formatter.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/data/test_converter.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/data/test_template.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/data/processor/test_feedback.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/data/processor/test_supervised.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/data/processor/test_pairwise.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/data/processor/test_unsupervised.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/data/processor/test_processor_utils.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/conftest.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/core/test_data_engine.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/core/test_model_loader.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/core/utils/test_batching.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/core/rendering/test_rendering.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/config/test_args_parser.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOW…s_v1/plugins/trainer_plugins/distributed/test_fsdp2.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOW…ainer_plugins/distributed/test_fsdp2_weight_convert.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOW…s_v1/plugins/model_plugins/test_quantization_plugin.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/plugins/model_plugins/test_peft.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/plugins/model_plugins/test_kernel_plugin.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/plugins/model_plugins/test_init_plugin.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/plugins/model_plugins/test_ulysses_cp.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/plugins/data_plugins/test_converter.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/trainers/test_fsdp2_dpo_trainer.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/trainers/test_fsdp2_sft_trainer.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/trainers/test_dpo_loss_precision.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/accelerator/test_interface.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests_v1/sampler/test_cli_sampler.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWexamples/train_full/qwen3vl_full_sft.yaml41ddp_timeout: 180000000COMMENT
LOWexamples/train_full/qwen3_full_sft.yaml41# val_size: 0.1COMMENT
LOWexamples/train_qlora/llama3_lora_sft_gptq.yaml41# per_device_eval_batch_size: 1COMMENT
LOWexamples/train_qlora/llama3_lora_sft_awq.yaml41# per_device_eval_batch_size: 1COMMENT
LOWexamples/train_qlora/llama3_lora_sft_aqlm.yaml41# per_device_eval_batch_size: 1COMMENT
LOWexamples/train_qlora/qwen3_lora_sft_otfq.yaml41### evalCOMMENT
LOWexamples/train_qlora/qwen3_lora_sft_bnb_npu.yaml41COMMENT
LOWexamples/train_lora/qwen3_lora_dpo.yaml41COMMENT
LOWexamples/train_lora/qwen3_lora_sft_ds3.yaml41### evalCOMMENT
LOWexamples/train_lora/qwen3vl_lora_dpo.yaml41ddp_timeout: 180000000COMMENT
LOWexamples/train_lora/qwen3_lora_pretrain.yaml41# val_size: 0.1COMMENT
241 more matches not shown…
Hyper-Verbose Identifiers210 hits · 219 pts
SeverityFileLineSnippetContext
LOWtests/conftest.py85def _handle_device_visibility(items: list[Item]):CODE
LOWtests/conftest.py109def pytest_collection_modifyitems(config: Config, items: list[Item]):CODE
LOWtests/conftest.py123def _cleanup_distributed_state():CODE
LOWtests/conftest.py166def fix_valuehead_cpu_loading():CODE
LOWtests/conftest.py172def bypass_mistral_regex_check():CODE
LOWtests/model/test_freeze.py46def test_freeze_train_all_modules():CODE
LOWtests/model/test_freeze.py57def test_freeze_train_extra_modules():CODE
LOWtests/model/test_lora.py58def test_lora_train_qv_modules():CODE
LOWtests/model/test_lora.py64def test_lora_train_all_modules():CODE
LOWtests/model/test_lora.py70def test_lora_train_extra_modules():CODE
LOWtests/model/test_lora.py76def test_lora_train_old_adapters():CODE
LOWtests/model/test_lora.py82def test_lora_train_new_adapters():CODE
LOWtests/model/test_lora.py91def test_lora_train_valuehead():CODE
LOWtests/model/model_utils/test_visual.py84def test_visual_model_save_load():CODE
LOWtests/model/model_utils/test_embedding.py51def test_resolve_new_token_ids_returns_none_without_config():CODE
LOWtests/model/model_utils/test_embedding.py57def test_resolve_new_token_ids_filters_invalid_and_dedups():CODE
LOWtests/model/model_utils/test_embedding.py67def test_existing_embeddings_excludes_new_token_ids():CODE
LOWtests/model/model_utils/test_embedding.py80def test_noisy_mean_initialization_with_token_ids_targets_exact_rows():CODE
LOWtests/model/model_utils/test_embedding.py103def test_noisy_mean_initialization_tail_fallback():CODE
LOWtests/model/model_utils/test_embedding.py118def test_description_init_excludes_new_token_ids_from_average():CODE
LOWtests/model/model_utils/test_packing.py37def test_get_seqlens_in_batch(attention_mask, golden_seq_lens):CODE
LOWtests/model/model_utils/test_checkpointing.py43def test_vanilla_checkpointing(disable_gradient_checkpointing: bool):CODE
LOWtests/model/model_utils/test_checkpointing.py49def test_unsloth_gradient_checkpointing():CODE
LOWtests/model/model_utils/test_checkpointing.py62def test_upcast_lmhead_output():CODE
LOWtests/data/test_collator.py234def _get_expected_position_ids(CODE
LOWtests/data/test_collator.py274def test_multimodal_collator_with_packing():CODE
LOWtests/data/test_mm_plugin.py316def test_llava_next_video_plugin():CODE
LOWtests/data/test_formatter.py64def test_multi_function_formatter():CODE
LOWtests/data/test_formatter.py75def test_default_tool_formatter():CODE
LOWtests/data/test_formatter.py94def test_default_tool_extractor():CODE
LOWtests/data/test_formatter.py101def test_default_multi_tool_extractor():CODE
LOWtests/data/test_formatter.py193def test_mistral_function_formatter():CODE
LOWtests/data/test_formatter.py203def test_mistral_multi_function_formatter():CODE
LOWtests/data/test_formatter.py215def test_mistral_tool_formatter():CODE
LOWtests/data/test_formatter.py224def test_mistral_tool_extractor():CODE
LOWtests/data/test_formatter.py231def test_mistral_multi_tool_extractor():CODE
LOWtests/data/test_formatter.py244def test_qwen_function_formatter():CODE
LOWtests/data/test_formatter.py253def test_qwen_multi_function_formatter():CODE
LOWtests/data/test_formatter.py285def test_qwen_multi_tool_extractor():CODE
LOWtests/data/test_template.py133def test_reasoning_encode_oneturn(cot_messages: bool, enable_thinking: bool):STRING
LOWtests/data/test_template.py159def test_reasoning_encode_multiturn(cot_messages: bool, enable_thinking: bool):STRING
LOWtests/data/test_template.py188def test_reasoning_encode_multiturn_discarding_history_cot(enable_thinking: bool, discarding_history_cot: bool):STRING
LOWtests/data/processor/test_supervised.py48def test_supervised_single_turn(num_samples: int):CODE
LOWtests/data/processor/test_supervised.py77def test_supervised_multi_turn(num_samples: int):CODE
LOWtests/data/processor/test_supervised.py95def test_supervised_train_on_prompt(num_samples: int):CODE
LOWtests/data/processor/test_supervised.py113def test_supervised_mask_history(num_samples: int):CODE
LOWtests/data/processor/test_pairwise.py46def _convert_sharegpt_to_openai(messages: list[dict[str, str]]) -> list[dict[str, str]]:CODE
LOWtests_v1/conftest.py86def _handle_device_visibility(items: list[Item]):CODE
LOWtests_v1/conftest.py110def pytest_collection_modifyitems(config: Config, items: list[Item]):CODE
LOWtests_v1/conftest.py135def _cleanup_distributed_state():CODE
LOWtests_v1/conftest.py178def bypass_mistral_regex_check():CODE
LOWtests_v1/core/test_model_loader.py30def test_tiny_qwen_with_kernel_plugin():CODE
LOWtests_v1/core/utils/test_batching.py73def test_batching_plugin_data_provider_batch_sizes():CODE
LOWtests_v1/core/utils/test_batching.py124def test_dynamic_batching_returns_none_when_token_budget_is_incomplete():CODE
LOWtests_v1/core/utils/test_batching.py141def test_dynamic_batching_fill_buffer_restarts_until_micro_batch_is_complete():CODE
LOWtests_v1/core/utils/test_batching.py210def test_dynamic_padding_free():CODE
LOWtests_v1/core/utils/test_batching.py315def test_dynamic_padding_free_returns_none_when_token_budget_is_incomplete():CODE
LOWtests_v1/core/utils/test_batching.py327def test_dynamic_padding_free_fill_buffer_restarts_until_micro_batch_is_complete():CODE
LOWtests_v1/core/rendering/test_rendering.py151def test_render_messages_with_tools():CODE
LOWtests_v1/core/rendering/test_rendering.py187def test_render_messages_remote(num_samples: int):CODE
150 more matches not shown…
Decorative Section Separators42 hits · 140 pts
SeverityFileLineSnippetContext
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py27# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py29# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py56# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py58# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py66# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py68# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py146# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py148# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py183# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py185# ==============================================================================COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py45# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py47# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py245# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py247# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py267# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py269# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py328# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py330# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py349# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py351# ---------------------------------------------------------------------------COMMENT
MEDIUM…s/model_plugins/kernels/ops/mlp/triton_grouped_gemm.py32# ---------------------------------------------------------------------------COMMENT
MEDIUM…s/model_plugins/kernels/ops/mlp/triton_grouped_gemm.py34# ---------------------------------------------------------------------------COMMENT
MEDIUM…s/model_plugins/kernels/ops/mlp/triton_grouped_gemm.py50# ---------------------------------------------------------------------------COMMENT
MEDIUM…s/model_plugins/kernels/ops/mlp/triton_grouped_gemm.py53# ---------------------------------------------------------------------------COMMENT
MEDIUM…s/model_plugins/kernels/ops/mlp/triton_grouped_gemm.py181# ---------------------------------------------------------------------------COMMENT
MEDIUM…s/model_plugins/kernels/ops/mlp/triton_grouped_gemm.py184# ---------------------------------------------------------------------------COMMENT
MEDIUM…s/model_plugins/kernels/ops/mlp/triton_grouped_gemm.py285# ---------------------------------------------------------------------------COMMENT
MEDIUM…s/model_plugins/kernels/ops/mlp/triton_grouped_gemm.py287# ---------------------------------------------------------------------------COMMENT
MEDIUM…s/model_plugins/kernels/ops/mlp/triton_grouped_gemm.py352# ---------------------------------------------------------------------------COMMENT
MEDIUM…s/model_plugins/kernels/ops/mlp/triton_grouped_gemm.py354# ---------------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py138 # ------------------------------------------------------------------STRING
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py140 # ------------------------------------------------------------------STRING
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py171 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py173 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py251 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py253 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py291 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py293 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py317 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py319 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py353 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py355 # ------------------------------------------------------------------COMMENT
Slop Phrases54 hits · 92 pts
SeverityFileLineSnippetContext
MEDIUMdata/kto_en_demo.json67 "content": "Certainly, measuring the results of a marketing strategy and making adjustments based on those metriCODE
MEDIUMdata/kto_en_demo.json394 "content": "Using Unreal's Gameplay Ability System (GAS) in conjunction with interpolation and prediction can prCODE
LOWdata/kto_en_demo.json903 "content": "I apologize for the confusion. The `unique_id` parameter in the `momepy.Tessellation` function expecCODE
MEDIUMdata/kto_en_demo.json2012 "content": "Two-factor authentication (2FA) adds an extra layer of security by requiring users to provide two foCODE
MEDIUMdata/kto_en_demo.json2114 "content": "To adapt the program to handle in-place modification or the creation of new objects based on a booleCODE
MEDIUMdata/kto_en_demo.json2449 "content": "I'm not sure where you've heard that information, but as an AI language model, I can share some factCODE
MEDIUMdata/kto_en_demo.json2790 "content": "To derive the original matrix from the rotated one, you would need to perform a 90 degrees counter-cCODE
MEDIUMdata/kto_en_demo.json3013 "content": "The genetic factors that contribute to the intricate design of the peacock's tail feathers are quiteCODE
MEDIUMdata/kto_en_demo.json3585 "content": "As an AI language model,I cannot determine the sentiment of the product review without further conteCODE
MEDIUMdata/kto_en_demo.json3611 "content": "I'm unable to provide you with a real-time percentage of population living in poverty in MarlboroughCODE
LOWdata/kto_en_demo.json3690 "content": "Firstly, as a fitness trainer, I highly recommend consulting with a healthcare professional before eCODE
MEDIUMdata/kto_en_demo.json3850 "content": "Since each medium-sized box measures 2 feet on all sides, its volume will be: 2*2*2 = 8 cubic feet. CODE
MEDIUMdata/kto_en_demo.json4774 "content": "In Feng Shui, the five elements—wood, fire, earth, metal, and water—are believed to interact in certCODE
MEDIUMdata/kto_en_demo.json4897 "content": "Sure, I understand the problem. However, I'm a large language model, I cannot provide a correct answCODE
MEDIUMdata/kto_en_demo.json4923 "content": "As an AI language model, I am not able to provide program codes or algorithms. However, I can providCODE
MEDIUMdata/alpaca_en_demo.json405 "output": "I am sorry, but as an AI language model, I do not have the data or access to real-time information to detCODE
MEDIUMdata/alpaca_en_demo.json930 "output": "I'm sorry, but I don't have access to external articles or news sources so I'm unable to read or summarizCODE
LOWdata/alpaca_en_demo.json1175 "output": "Here is an example of HTML code that can be used to create a web page that displays the temperature of thCODE
MEDIUMdata/alpaca_en_demo.json3330 "output": "As an AI, I don't have a physical house, so I cannot provide a description of it. Can I help you with somCODE
MEDIUMdata/alpaca_en_demo.json3900 "output": "Thank you for considering my request. Please let me know if you need any additional information, and I loCODE
MEDIUMdata/alpaca_en_demo.json3905 "output": "I'm sorry, but I'm unable to come into work today due to unforeseen medical issues. I woke up with a seveCODE
MEDIUMdata/alpaca_en_demo.json3975 "output": "As an AI, I don’t have access to real-time information such as pricing, and due to the fact that movie tiCODE
MEDIUMdata/alpaca_en_demo.json4090 "output": "I am sorry, but as an AI language model, I do not have access to up-to-date information on housing pricesCODE
MEDIUMdata/alpaca_en_demo.json4505 "output": "Sure, here is a simple example of a class for a car:\n\n```python\n\nclass Car:\n \n def __init__(selCODE
MEDIUMdata/alpaca_en_demo.json4715 "output": "I'm sorry, but as an AI language model, I'm unable to create or display graphical content. However, I canCODE
MEDIUMdata/alpaca_en_demo.json4715 "output": "I'm sorry, but as an AI language model, I'm unable to create or display graphical content. However, I canCODE
MEDIUMdata/alpaca_en_demo.json4870 "output": "As an AI, I can assist you in coming up with design ideas and concepts for the logo. However, I'm unable CODE
MEDIUMdata/alpaca_zh_demo.json4470 "output": "As an AI language model I am capable of analyzing text and identifying emotions, however, the sentence prCODE
MEDIUMdata/glaive_toolcall_en_demo.json1232 "value": "I'm sorry, but I'm unable to perform external tasks like ordering a pizza. My capabilities are currentCODE
MEDIUMdata/glaive_toolcall_en_demo.json1295 "value": "Analyzing the motivations of a protagonist in a narrative can be a complex task that requires a deep uCODE
MEDIUMdata/glaive_toolcall_en_demo.json3349 "value": "To create a stacked bar chart in D3.js, you can modify the code to use the D3.js `stack()` function toCODE
MEDIUMdata/glaive_toolcall_en_demo.json3452 "value": "I'm sorry, but I'm unable to assist with booking flights as it's an external task. My current capabiliCODE
MEDIUMdata/glaive_toolcall_en_demo.json4143 "value": "I'm sorry, but I'm unable to assist with that. My current capabilities allow me to calculate Body MassCODE
MEDIUMdata/glaive_toolcall_en_demo.json4328 "value": "I'm sorry, but I'm unable to assist with that. My current capabilities are limited to generating invoiCODE
MEDIUMdata/glaive_toolcall_en_demo.json5069 "value": "I'm sorry, but I'm unable to assist with booking flights. My current capabilities are limited to calcuCODE
MEDIUMdata/glaive_toolcall_en_demo.json5818 "value": "I'm sorry, but I'm unable to perform external tasks like ordering a pizza. My current capabilities areCODE
MEDIUMdata/glaive_toolcall_en_demo.json6538 "value": "I'm sorry, but I'm unable to perform external tasks such as ordering a pizza. My current capabilities CODE
MEDIUMdata/glaive_toolcall_en_demo.json6667 "value": "I'm sorry, but I'm unable to assist with that. My current capabilities are limited to calculating the CODE
MEDIUMdata/glaive_toolcall_en_demo.json6725 "value": "I'm sorry, but I'm unable to assist with that. Booking a flight is an external task and I don't have aCODE
MEDIUMdata/glaive_toolcall_en_demo.json6809 "value": "I'm sorry, but I'm unable to perform external tasks like ordering a pizza. My capabilities are limitedCODE
MEDIUMdata/glaive_toolcall_en_demo.json6901 "value": "Sure, here is how you can compile the recipe from the JSON data:\nRecipe: Tomato Spaghetti\nIngredientCODE
MEDIUMdata/glaive_toolcall_en_demo.json7020 "value": "I'm sorry, but I'm unable to assist with that. My current capabilities are limited to the functions prCODE
MEDIUMdata/glaive_toolcall_en_demo.json7592 "value": "I'm sorry, but I'm unable to assist with booking flights. My current capabilities are limited to generCODE
MEDIUMdata/glaive_toolcall_en_demo.json8510 "value": "I'm sorry, but I'm unable to assist with that. Booking a flight is an external task and I don't have aCODE
MEDIUMdata/glaive_toolcall_en_demo.json8557 "value": "I'm sorry, but I'm unable to book movie tickets as it's an external task and I don't have a function pCODE
MEDIUMdata/glaive_toolcall_en_demo.json8823 "value": "I'm sorry, but I'm unable to assist with booking flights. My current capabilities are limited to calcuCODE
MEDIUMdata/glaive_toolcall_en_demo.json8984 "value": "I'm sorry, but I'm unable to assist with that. My current capabilities are limited to the functions prCODE
LOWdata/glaive_toolcall_en_demo.json1198 "value": "Here is your new password: a9B7$#fG3&Z1. Please make sure to save it in a secure place."CODE
LOWdata/glaive_toolcall_en_demo.json1538 "value": "Here is your new password: aB3#fG7!kL9@. Please make sure to save it in a secure place."CODE
LOWdata/glaive_toolcall_en_demo.json3130 "value": "Here is your new password: aB3#fG7!kL9@. Please make sure to save it in a secure place."CODE
LOWdata/glaive_toolcall_en_demo.json3307 "value": "Here is your new password: aB3#fG7!kL9@. Please make sure to save it in a secure place."CODE
LOWdata/glaive_toolcall_en_demo.json5718 "value": "Here is your new password: aB3#fG7!kL9@. Please make sure to save it in a secure place."CODE
LOWdata/glaive_toolcall_en_demo.json6775 "value": "Here is your new password: aB3#fG7!kL9@. Please make sure to save it in a secure place."CODE
LOWsrc/llamafactory/chat/sglang_engine.py127 self._cleanup_server() # make sure to clean up any started processCODE
Deep Nesting91 hits · 90 pts
SeverityFileLineSnippetContext
LOWtests/data/test_collator.py140CODE
LOWtests/data/test_mm_plugin.py117CODE
LOWscripts/vllm_infer.py47CODE
LOWscripts/llama_pro.py40CODE
LOWscripts/convert_ckpt/llamafy_qwen.py39CODE
LOWscripts/stat_utils/cal_mfu.py86CODE
LOWsrc/llamafactory/launcher.py38CODE
LOWsrc/llamafactory/v1/launcher.py34CODE
LOWsrc/llamafactory/v1/core/base_trainer.py235CODE
LOWsrc/llamafactory/v1/core/data_engine.py101CODE
LOWsrc/llamafactory/v1/core/rendering/escape.py62CODE
LOWsrc/llamafactory/v1/core/rendering/format.py36CODE
LOWsrc/llamafactory/v1/config/arg_utils.py61CODE
LOWsrc/llamafactory/v1/plugins/trainer_plugins/batching.py118CODE
LOW…actory/v1/plugins/trainer_plugins/distributed/fsdp2.py76CODE
LOW…actory/v1/plugins/trainer_plugins/distributed/fsdp2.py193CODE
LOW…actory/v1/plugins/trainer_plugins/distributed/fsdp2.py437CODE
LOWsrc/llamafactory/v1/plugins/model_plugins/peft.py199CODE
LOW…/v1/plugins/model_plugins/kernels/ops/rope/npu_rope.py136CODE
LOW…ins/model_plugins/parallelization/sequence_parallel.py129CODE
LOWsrc/llamafactory/v1/plugins/data_plugins/converter.py104CODE
LOWsrc/llamafactory/chat/hf_engine.py73CODE
LOWsrc/llamafactory/chat/chat_model.py47CODE
LOWsrc/llamafactory/hparams/parser.py304CODE
LOWsrc/llamafactory/third_party/triton/utils.py39CODE
LOWsrc/llamafactory/third_party/triton/utils.py70CODE
LOWsrc/llamafactory/third_party/triton/utils.py74CODE
LOWsrc/llamafactory/third_party/triton/chunk_o.py34CODE
LOWsrc/llamafactory/third_party/triton/chunk_o.py327CODE
LOWsrc/llamafactory/third_party/triton/wy_fast.py28CODE
LOWsrc/llamafactory/third_party/triton/wy_fast.py183CODE
LOWsrc/llamafactory/model/adapter.py141CODE
LOWsrc/llamafactory/model/loader.py131CODE
LOWsrc/llamafactory/model/patcher.py88CODE
LOWsrc/llamafactory/model/patcher.py436CODE
LOWsrc/llamafactory/model/model_utils/attention.py31CODE
LOWsrc/llamafactory/model/model_utils/quantization.py82CODE
LOWsrc/llamafactory/model/model_utils/liger_kernel.py31CODE
LOWsrc/llamafactory/model/model_utils/moe.py160CODE
LOWsrc/llamafactory/train/trainer_utils.py151CODE
LOWsrc/llamafactory/train/trainer_utils.py200CODE
LOWsrc/llamafactory/train/trainer_utils.py288CODE
LOWsrc/llamafactory/train/trainer_utils.py372CODE
LOWsrc/llamafactory/train/tuner.py68CODE
LOWsrc/llamafactory/train/hyper_parallel/workflow.py62CODE
LOWsrc/llamafactory/train/dpo/trainer.py45CODE
LOWsrc/llamafactory/train/pt/workflow.py36CODE
LOWsrc/llamafactory/train/sft/trainer.py50CODE
LOWsrc/llamafactory/train/ppo/trainer.py311CODE
LOWsrc/llamafactory/train/kto/trainer.py44CODE
LOWsrc/llamafactory/train/rm/trainer.py113CODE
LOWsrc/llamafactory/api/chat.py73CODE
LOWsrc/llamafactory/webui/runner.py422CODE
LOWsrc/llamafactory/webui/chatter.py101CODE
LOWsrc/llamafactory/webui/control.py160CODE
LOWsrc/llamafactory/webui/control.py209CODE
LOWsrc/llamafactory/webui/components/export.py47CODE
LOWsrc/llamafactory/webui/components/chatbot.py34CODE
LOWsrc/llamafactory/webui/components/chatbot.py49CODE
LOWsrc/llamafactory/data/formatter.py72CODE
31 more matches not shown…
Excessive Try-Catch Wrapping52 hits · 52 pts
SeverityFileLineSnippetContext
LOWscripts/qwen_omni_merge.py86 except Exception:CODE
LOWscripts/qwen_omni_merge.py135 except Exception:CODE
LOWscripts/convert_ckpt/llamafy_qwen.py32except Exception:CODE
LOWscripts/convert_ckpt/llamafy_qwen.py157 except Exception as e:STRING
LOWscripts/convert_ckpt/llamafy_baichuan2.py104 except Exception as e:STRING
LOW…actory/v1/plugins/trainer_plugins/distributed/fsdp2.py408 except Exception as e:CODE
LOWsrc/llamafactory/v1/plugins/model_plugins/peft.py342 except Exception as e:STRING
LOW…afactory/v1/plugins/model_plugins/kernels/interface.py71 except Exception as e:CODE
LOW…/v1/plugins/model_plugins/kernels/ops/rope/npu_rope.py184 except Exception as e:CODE
LOWsrc/llamafactory/v1/utils/packages.py44 except Exception:CODE
LOWsrc/llamafactory/v1/samplers/cli_sampler.py101 except Exception:CODE
LOWsrc/llamafactory/chat/sglang_engine.py122 except Exception as e:CODE
LOWsrc/llamafactory/chat/sglang_engine.py125 except Exception as e:CODE
LOWsrc/llamafactory/chat/sglang_engine.py137 except Exception as e:CODE
LOWsrc/llamafactory/chat/sglang_engine.py291 except Exception:CODE
LOWsrc/llamafactory/chat/chat_model.py180 except Exception:CODE
LOWsrc/llamafactory/hparams/model_args.py250 except Exception as e:CODE
LOWsrc/llamafactory/third_party/triton/utils.py67 except Exception:CODE
LOWsrc/llamafactory/third_party/triton/utils.py298 except Exception:CODE
MEDIUMsrc/llamafactory/third_party/triton/utils.py157def get_available_device() -> str:CODE
LOWsrc/llamafactory/model/loader.py92 except Exception as e:STRING
LOWsrc/llamafactory/model/loader.py109 except Exception as e:STRING
LOWsrc/llamafactory/model/patcher.py127 except Exception as e:CODE
LOWsrc/llamafactory/model/patcher.py137 except Exception as e:CODE
LOWsrc/llamafactory/model/patcher.py495 except Exception:CODE
LOWsrc/llamafactory/model/model_utils/valuehead.py47 except Exception as err:STRING
LOWsrc/llamafactory/model/model_utils/valuehead.py53 except Exception as err:STRING
LOWsrc/llamafactory/train/fp8_utils.py103 except Exception as e:CODE
LOWsrc/llamafactory/train/trainer_utils.py876 except Exception:CODE
LOWsrc/llamafactory/train/callbacks.py394 except Exception:STRING
LOWsrc/llamafactory/train/tuner.py142 except Exception as e:CODE
LOWsrc/llamafactory/train/tuner.py257 except Exception as e:CODE
LOWsrc/llamafactory/train/ppo/trainer.py279 except Exception:CODE
LOWsrc/llamafactory/train/mca/workflow.py156 except Exception:CODE
LOWsrc/llamafactory/train/mca/workflow.py158 except Exception as exc:CODE
LOWsrc/llamafactory/api/common.py66 except Exception:CODE
LOWsrc/llamafactory/api/common.py95 except Exception as e:CODE
LOWsrc/llamafactory/webui/common.py55 except Exception:CODE
LOWsrc/llamafactory/webui/common.py79 except Exception:CODE
LOWsrc/llamafactory/webui/common.py149 except Exception as err:CODE
LOWsrc/llamafactory/webui/common.py159 except Exception:CODE
LOWsrc/llamafactory/webui/components/chatbot.py45 except Exception:CODE
LOWsrc/llamafactory/webui/components/data.py47 except Exception:CODE
LOWsrc/llamafactory/data/parser.py111 except Exception as err:CODE
LOWsrc/llamafactory/data/data_utils.py194 except Exception:STRING
LOWsrc/llamafactory/extras/misc.py44except Exception:CODE
LOWsrc/llamafactory/extras/env.py64 except Exception:CODE
LOWsrc/llamafactory/extras/env.py71 except Exception:CODE
LOWsrc/llamafactory/extras/env.py78 except Exception:CODE
LOWsrc/llamafactory/extras/env.py85 except Exception:CODE
LOWsrc/llamafactory/extras/env.py94 except Exception:CODE
LOWsrc/llamafactory/extras/packages.py38 except Exception:CODE
Docstring Block Structure8 hits · 40 pts
SeverityFileLineSnippetContext
HIGH…mafactory/v1/plugins/model_plugins/kernels/registry.py40Decorator to register a kernel class. The class must inherit from :class:`BaseKernel` and specify ``_kernel_id`STRING
HIGH…y/v1/plugins/model_plugins/kernels/liger_kernel_ops.py64Applies the Liger kernel to the model. Args: **kwargs: Must include ``model``. Optional ``use_kerneSTRING
HIGH…/llamafactory/v1/plugins/model_plugins/kernels/base.py68Applies the kernel optimization to the model. Args: **kwargs: Arbitrary keyword arguments, usually STRING
HIGH…ins/model_plugins/kernels/ops/rms_norm/npu_rms_norm.py130Iterate the model and apply NPU-optimized forward to matched RMSNorm modules. Matches modules whose class name STRING
HIGH…/v1/plugins/model_plugins/kernels/ops/rope/npu_rope.py137Apply RoPE acceleration by monkey-patching ``apply_rotary_pos_emb``. Iterates through the model's modules to fiSTRING
HIGH…v1/plugins/model_plugins/kernels/ops/mlp/npu_swiglu.py129Applies the NPU fused SwiGLU kernel to the model. Args: **kwargs: Keyword arguments containing the STRING
HIGH…plugins/model_plugins/kernels/ops/mlp/npu_fused_moe.py346Applies the NPU fused MoE kernel to the model. Args: **kwargs: Keyword arguments containing the modSTRING
HIGH…mafactory/third_party/triton/chunk_gated_delta_rule.py232Args: q (torch.Tensor): queries of shape `[B, T, H, K]`. k (torch.Tensor): keys STRING
Self-Referential Comments16 hits · 35 pts
SeverityFileLineSnippetContext
MEDIUMtests_v1/plugins/model_plugins/test_peft.py43 # Create a dummy adapterCOMMENT
MEDIUMdata/kto_en_demo.json887 "content": "To smoothen the output polygons without creating gaps or overlaps, you can use a combination of librCODE
MEDIUMdata/kto_en_demo.json895 "content": "I apologize for the confusion. Let's try a different approach using the `TopologicalPreserveSimplifiCODE
MEDIUMdata/kto_en_demo.json907 "content": "I have the following code:\n#%% Generate geoTiffs with index values based on one large geotiff with CODE
MEDIUMdata/kto_en_demo.json919 "content": "To smoothen the output polygons without creating gaps or overlays between the polygons, you can use CODE
MEDIUMdata/alpaca_en_demo.json2655 "output": "In order to build a random forest regression model to predict house prices, we need to organize the data CODE
MEDIUMdata/alpaca_en_demo.json4405 "output": "The most efficient way to implement a sparse matrix in Python depends on the specifics of the matrix and CODE
MEDIUMdata/glaive_toolcall_zh_demo.json7807 "value": "Sure, here's a sample Python code to generate the Excel table and some SQL queries to filter the animaCODE
MEDIUMdata/glaive_toolcall_en_demo.json567 "value": "Yes, I can help you with that. Here's a sample code snippet that should do what you're looking for:\n`CODE
MEDIUMdata/glaive_toolcall_en_demo.json575 "value": "Yes, you can modify the code snippet to rank the cities in ascending order by changing the `reverse` pCODE
MEDIUMdata/glaive_toolcall_en_demo.json1625 "value": "To examine real-time usage patterns of public electric vehicle charging stations in a specific city usCODE
MEDIUMdata/glaive_toolcall_en_demo.json2422 "value": "There are several algorithms that can be used to solve a Rubik's cube puzzle in Ruby programming languCODE
MEDIUMdata/glaive_toolcall_en_demo.json5185 "value": "Sure, here's a Python code that can generate a sequence of clues that reveal the identity of the grandCODE
MEDIUM…mafactory/third_party/triton/chunk_gated_delta_rule.py334 """This function is intended to align with the l2norm implementation in the FLA library."""STRING
MEDIUMsrc/llamafactory/data/collator.py123 # Create a non-padding mask.STRING
MEDIUMsrc/llamafactory/data/collator.py128 # Create a lower triangular mask.STRING
Modern Structural Boilerplate34 hits · 35 pts
SeverityFileLineSnippetContext
LOWsrc/llamafactory/v1/core/utils/batching.py45__all__ = ["BatchGenerator"]CODE
LOWsrc/llamafactory/v1/core/utils/batching.py261 def set_epoch(self, epoch: int) -> None:CODE
LOWsrc/llamafactory/v1/core/utils/checkpoint.py101def _set_accelerator_rng_state(state) -> None:CODE
LOWsrc/llamafactory/v1/core/rendering/__init__.py25__all__ = ["Renderer"]CODE
LOWsrc/llamafactory/v1/config/__init__.py24__all__ = [CODE
LOW…mafactory/v1/plugins/model_plugins/kernels/registry.py27__all__ = ["Registry", "register_kernel"]CODE
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py42logger = logging.getLogger(__name__)CODE
LOWsrc/llamafactory/v1/utils/helper.py45def set_seed(seed: int, full_determinism: bool = False) -> None:CODE
LOWsrc/llamafactory/v1/utils/callbacks/__init__.py19__all__ = [CODE
LOWsrc/llamafactory/v1/accelerator/helper.py122def set_device_index() -> None:CODE
LOWsrc/llamafactory/chat/__init__.py19__all__ = ["BaseEngine", "ChatModel"]CODE
LOWsrc/llamafactory/hparams/__init__.py24__all__ = [CODE
LOWsrc/llamafactory/hparams/parser.py165def _set_transformers_logging() -> None:CODE
LOWsrc/llamafactory/hparams/parser.py172def _set_env_vars() -> None:CODE
LOWsrc/llamafactory/third_party/triton/utils.py34logger = logging.getLogger(__name__)CODE
LOWsrc/llamafactory/third_party/muon/__init__.py18__all__ = ["Muon"]CODE
LOWsrc/llamafactory/model/__init__.py21__all__ = [CODE
LOWsrc/llamafactory/model/model_utils/moe.py36def _set_z3_leaf_modules(model: "PreTrainedModel", leaf_modules: list[Union["nn.Module", str]]) -> None:CODE
LOWsrc/llamafactory/train/callbacks.py196 def _set_abort(self, signum, frame) -> None:CODE
LOWsrc/llamafactory/train/tuner.py273 def _setup_env_visible_devices(self) -> None:CODE
LOWsrc/llamafactory/train/hyper_parallel/__init__.py18__all__ = ["run_pt", "run_sft"]CODE
LOWsrc/llamafactory/train/hyper_parallel/trainer.py51logger = logging.getLogger(__name__)CODE
LOWsrc/llamafactory/train/dpo/__init__.py18__all__ = ["run_dpo"]CODE
LOWsrc/llamafactory/train/pt/__init__.py18__all__ = ["run_pt"]CODE
LOWsrc/llamafactory/train/sft/__init__.py18__all__ = ["run_sft"]CODE
LOWsrc/llamafactory/train/ppo/__init__.py18__all__ = ["run_ppo"]CODE
LOWsrc/llamafactory/train/kto/__init__.py18__all__ = ["run_kto"]CODE
LOWsrc/llamafactory/train/rm/__init__.py18__all__ = ["run_rm"]CODE
LOWsrc/llamafactory/train/mca/__init__.py18__all__ = ["run_dpo", "run_pt", "run_sft"]CODE
LOWsrc/llamafactory/webui/runner.py76 def set_abort(self) -> None:CODE
LOWsrc/llamafactory/webui/components/__init__.py24__all__ = [CODE
LOWsrc/llamafactory/data/__init__.py26__all__ = [CODE
LOWsrc/llamafactory/data/parser.py69 def set_attr(self, key: str, obj: dict[str, Any], default: Any | None = None) -> None:CODE
LOWsrc/llamafactory/data/processor/__init__.py23__all__ = [CODE
Fake / Example Data21 hits · 30 pts
SeverityFileLineSnippetContext
LOWdata/glaive_toolcall_zh_demo.json664 "value": "在LaTeX中,你可以通过使用`endfloat`包来实现这一点。以下是方法:\n1. 在你的LaTeX文档的预览部分添加`usepackage{endfloat}`。\n2. 在你希望图表出现在文档中的CODE
LOWdata/glaive_toolcall_zh_demo.json664 "value": "在LaTeX中,你可以通过使用`endfloat`包来实现这一点。以下是方法:\n1. 在你的LaTeX文档的预览部分添加`usepackage{endfloat}`。\n2. 在你希望图表出现在文档中的CODE
LOWdata/glaive_toolcall_zh_demo.json672 "value": "在您的LaTeX文档中,您可以通过使用`tableofcontents`命令来创建目录。以下是方法:\n1. 在您希望目录出现在文档中的位置添加`tableofcontents`命令。\n2. 编译您的LCODE
LOWdata/glaive_toolcall_zh_demo.json672 "value": "在您的LaTeX文档中,您可以通过使用`tableofcontents`命令来创建目录。以下是方法:\n1. 在您希望目录出现在文档中的位置添加`tableofcontents`命令。\n2. 编译您的LCODE
LOWsrc/llamafactory/webui/locales.py2565 "placeholder": "System prompt (optional)",CODE
LOWsrc/llamafactory/webui/locales.py2568 "placeholder": "Системный запрос (по желанию)",CODE
LOWsrc/llamafactory/webui/locales.py2571 "placeholder": "系统提示词(非必填)",CODE
LOWsrc/llamafactory/webui/locales.py2574 "placeholder": "시스템 프롬프트 (선택 사항)",CODE
LOWsrc/llamafactory/webui/locales.py2577 "placeholder": "システムプロンプト(オプション)",CODE
LOWsrc/llamafactory/webui/locales.py2582 "placeholder": "Tools (optional)",CODE
LOWsrc/llamafactory/webui/locales.py2585 "placeholder": "Инструменты (по желанию)",CODE
LOWsrc/llamafactory/webui/locales.py2588 "placeholder": "工具列表(非必填)",CODE
LOWsrc/llamafactory/webui/locales.py2591 "placeholder": "툴 (선택 사항)",CODE
LOWsrc/llamafactory/webui/locales.py2594 "placeholder": "ツールリスト(オプション)",CODE
LOWsrc/llamafactory/webui/locales.py2633 "placeholder": "Input...",CODE
LOWsrc/llamafactory/webui/locales.py2636 "placeholder": "Ввод...",CODE
LOWsrc/llamafactory/webui/locales.py2639 "placeholder": "输入...",CODE
LOWsrc/llamafactory/webui/locales.py2642 "placeholder": "입력...",CODE
LOWsrc/llamafactory/webui/locales.py2645 "placeholder": "入力...",CODE
LOWsrc/llamafactory/data/mm_plugin.py1411 dummy_data = [torch.empty(0) for _ in range(len(batch_ids))]CODE
LOWsrc/llamafactory/data/mm_plugin.py1412 mm_inputs.update({"tgt_sizes": dummy_data, "pixel_values": dummy_data, "image_sizes": dummy_data})CODE
Magic Placeholder Names3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHREADME.md8281. Add `swanlab_api_key=<your_api_key>` to the yaml file, and set it to your [API key](https://swanlab.cn/settings).CODE
HIGHREADME_zh.md831方式一:在 yaml 文件中添加 `swanlab_api_key=<your_api_key>` ,并设置为你的 [API 密钥](https://swanlab.cn/settings)。CODE
HIGHdata/dpo_zh_demo.json3735 "value": "创建一个完整的程序像这样将是一个复杂且漫长的过程,涉及图形和音频处理。然而,我可以指导您完成初始步骤,并为您提供资源,帮助您构建项目的简单文本版本。\n\n要获取天气数据,您可以使用OpenWeatherMaCODE
AI Structural Patterns15 hits · 15 pts
SeverityFileLineSnippetContext
LOWscripts/vllm_infer.py47CODE
LOWscripts/megatron_merge.py64CODE
LOWscripts/stat_utils/cal_ppl.py55CODE
LOWscripts/stat_utils/cal_mfu.py101CODE
LOWsrc/llamafactory/v1/core/utils/batching.py66CODE
LOW…ry/v1/plugins/model_plugins/parallelization/ulysses.py183CODE
LOW…ins/model_plugins/parallelization/sequence_parallel.py49CODE
LOWsrc/llamafactory/third_party/triton/utils.py302CODE
LOWsrc/llamafactory/third_party/triton/chunk_delta_h.py536CODE
LOWsrc/llamafactory/third_party/muon/muon.py102CODE
LOWsrc/llamafactory/model/patcher.py287CODE
LOWsrc/llamafactory/data/converter.py131CODE
LOWsrc/llamafactory/data/converter.py227CODE
LOWsrc/llamafactory/data/converter.py367CODE
LOWsrc/llamafactory/data/template.py490CODE
Cross-File Repetition3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHsrc/llamafactory/v1/core/base_sampler.py0generate tokens synchronously. args: messages: list of messages. tools: tools string. yields: generated tokens.STRING
HIGHsrc/llamafactory/v1/core/utils/inference_engine.py0generate tokens synchronously. args: messages: list of messages. tools: tools string. yields: generated tokens.STRING
HIGHsrc/llamafactory/v1/samplers/cli_sampler.py0generate tokens synchronously. args: messages: list of messages. tools: tools string. yields: generated tokens.STRING
Verbosity Indicators7 hits · 13 pts
SeverityFileLineSnippetContext
LOWdata/glaive_toolcall_zh_demo.json7017 "value": "计算抛掷三颗骰子得到9点或以上的概率,其中至少有一颗骰子是质数,我们可以使用包含与排除原则。\n首先,我们需要计算在没有限制的情况下抛掷三颗骰子得到9点或以上的概率。这可以通过计算得到9点或以上的方式数,CODE
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py167 # Step 1: Scatter grad_output to expert bufferCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py170 # Step 2: FC2 backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py191 # Step 3: Routing weight backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py200 # Step 4: SiLU gate backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py210 # Step 5: FC1 backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py231 # Step 6: Gather gradients back to original positionsCOMMENT
Structural Annotation Overuse7 hits · 13 pts
SeverityFileLineSnippetContext
LOWdata/glaive_toolcall_zh_demo.json7017 "value": "计算抛掷三颗骰子得到9点或以上的概率,其中至少有一颗骰子是质数,我们可以使用包含与排除原则。\n首先,我们需要计算在没有限制的情况下抛掷三颗骰子得到9点或以上的概率。这可以通过计算得到9点或以上的方式数,CODE
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py167 # Step 1: Scatter grad_output to expert bufferCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py170 # Step 2: FC2 backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py191 # Step 3: Routing weight backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py200 # Step 4: SiLU gate backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py210 # Step 5: FC1 backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py231 # Step 6: Gather gradients back to original positionsCOMMENT
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippetContext
CRITICALsrc/llamafactory/third_party/triton/utils.py270 triton.runtime.driver.active.utils.get_device_properties(i)["max_shared_mem"]CODE
Redundant / Tautological Comments7 hits · 8 pts
SeverityFileLineSnippetContext
LOWdata/alpaca_en_demo.json4535 "output": "Here is a function in Python that takes in a year as an input parameter and returns whether it is a leap CODE
LOWdata/glaive_toolcall_zh_demo.json4859 "value": "```python\ndef calculate_summary(array, divisor):\n # Sort the array in descending order\n arrayCODE
LOWdata/glaive_toolcall_zh_demo.json4859 "value": "```python\ndef calculate_summary(array, divisor):\n # Sort the array in descending order\n arrayCODE
LOWdata/alpaca_zh_demo.json275 "output": "def calculate_sum(numbers):\n if not isinstance(numbers, list): # Check if input is a list\n rCODE
LOWsrc/llamafactory/v1/core/base_trainer.py330 # Check if max_steps is reachedCOMMENT
LOWsrc/llamafactory/train/ppo/trainer.py86 # Check if TRL version is compatible (0.8.6 <= version <= 0.9.6)COMMENT
LOWsrc/llamafactory/data/collator.py310 # Check if position_ids shape matches expected shape.COMMENT
Synthetic Comment Markers2 hits · 5 pts
SeverityFileLineSnippetContext
HIGHtests/data/test_template.py236 "# ollama modelfile auto-generated by llamafactory\n\n"STRING
HIGHsrc/llamafactory/data/template.py323 modelfile = "# ollama modelfile auto-generated by llamafactory\n\n"STRING
AI Slop Vocabulary3 hits · 5 pts
SeverityFileLineSnippetContext
MEDIUMdata/kto_en_demo.json2769 "content": "As an Azure Cloud Engineer working with Microsoft Azure, you can indeed utilize Azure Active DirectoCODE
MEDIUMdata/alpaca_en_demo.json3485 "output": "John Smith's Resume\n\nSummary:\n\nAn experienced and highly skilled software engineer with over 5 years CODE
MEDIUMsrc/llamafactory/model/model_utils/embedding.py187 # Resolve token ID for correct placement (robust to embedding padding)STRING
Cross-Language Confusion1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHsrc/llamafactory/model/patcher.py108 "`pip uninstall -y triton && pip install -r requirements/triton_ascend.txt`. "CODE
Example Usage Blocks2 hits · 3 pts
SeverityFileLineSnippetContext
LOWexamples/ascend/qwen3_5moe_lora_sft_fsdp2.yaml2# Usage:COMMENT
LOWexamples/ascend/qwen3_5_full_sft_fsdp2.yaml2# Usage:COMMENT
Modern AI Meta-Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUMREADME.md28| <div style="text-align: center;"><a href="https://warp.dev/llama-factory"><img alt="Warp sponsorship" width="400" src=CODE