Repository Analysis

hiyouga/LlamaFactory

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

14.3 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of hiyouga/LlamaFactory, a Python project with 74,426 GitHub stars. SynthScan v2.0 examined 115,779 lines of code across 553 source files, recording 1409 pattern matches distributed across 23 syntactic categories. The overall adjusted score of 14.3 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.3
Adjusted Score
14.3
Raw Score
100%
Time Factor
2026-08-27
Last Push
74.4K
Stars
Python
Language
115.8K
Lines of Code
553
Files
1.4K
Pattern Hits
2026-08-29
Scan Date
0.03
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 2HIGH 12MEDIUM 109LOW 1286

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 1409 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 Imports390 hits · 390 pts
SeverityFileLineSnippetContext
LOWtests/data/test_mm_plugin.py31CODE
LOWtests/data/test_mm_plugin.py31CODE
LOWtests/data/test_mm_plugin.py34CODE
LOWtests/data/test_mm_plugin.py35CODE
LOWtests/data/test_template.py34CODE
LOWdocs/zh/conf.py8CODE
LOWdocs/en/conf.py8CODE
LOWtests_v1/plugins/model_plugins/test_kernel_plugin.py100CODE
LOWsrc/llamafactory/v1/core/rendering/__init__.py22CODE
LOWsrc/llamafactory/v1/core/rendering/format.py25CODE
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…ry/v1/plugins/trainer_plugins/distributed/interface.py21CODE
LOW…factory/v1/plugins/trainer_plugins/distributed/base.py15CODE
LOW…ory/v1/plugins/trainer_plugins/optimizers/optimizer.py15CODE
LOW…afactory/v1/plugins/model_plugins/kernels/interface.py22CODE
LOW…afactory/v1/plugins/model_plugins/kernels/interface.py23CODE
LOW…afactory/v1/plugins/model_plugins/kernels/interface.py24CODE
LOW…afactory/v1/plugins/model_plugins/kernels/interface.py25CODE
LOW…afactory/v1/plugins/model_plugins/kernels/interface.py26CODE
LOW…afactory/v1/plugins/model_plugins/kernels/interface.py27CODE
LOW…afactory/v1/plugins/model_plugins/kernels/interface.py28CODE
LOW…y/v1/plugins/model_plugins/kernels/liger_kernel_ops.py27CODE
LOW…y/v1/plugins/model_plugins/kernels/liger_kernel_ops.py58CODE
LOW…gins/model_plugins/kernels/ops/linear_attention/fla.py53CODE
LOW…gins/model_plugins/kernels/ops/linear_attention/fla.py54CODE
LOW…ins/model_plugins/kernels/ops/rms_norm/npu_rms_norm.py30CODE
LOW…/v1/plugins/model_plugins/kernels/ops/rope/npu_rope.py29CODE
LOW…v1/plugins/model_plugins/kernels/ops/mlp/npu_swiglu.py29CODE
LOWsrc/llamafactory/v1/utils/packages.py34CODE
LOWsrc/llamafactory/v1/utils/plugin.py17CODE
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/accelerator/interface.py43CODE
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
330 more matches not shown…
Over-Commented Block318 hits · 318 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/train/megatron_bridge/conftest.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/train/megatron_bridge/test_megatron_bridge_gpu.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/train/megatron_bridge/test_model_support.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/train/megatron_bridge/test_dataset_export.py1# Copyright 2025 the LlamaFactory team.COMMENT
LOWtests/train/megatron_bridge/test_config_builder.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_moss_vl_training_configs.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_moss_vl_plugin.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…ugins/trainer_plugins/distributed/test_fsdpturbo_ep.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/megatron_bridge/llama3_sft.yaml41COMMENT
LOWexamples/train_full/qwen3vl_full_sft.yaml41ddp_timeout: 180000000COMMENT
LOWexamples/train_full/qwen3_full_sft.yaml41# val_size: 0.1COMMENT
258 more matches not shown…
Hyper-Verbose Identifiers312 hits · 317 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.py113def test_moss_vl_lora_target_all(freeze_vision_tower: bool):CODE
LOWtests/model/model_utils/test_visual.py135def test_moss_vl_projector_modules():CODE
LOWtests/model/model_utils/test_visual.py143def test_moss_vl_quantized_projector_hook_skips_parameter():CODE
LOWtests/model/model_utils/test_visual.py209def 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/train/megatron_bridge/test_megatron_bridge_gpu.py23def test_check_backend_available():CODE
LOWtests/train/megatron_bridge/test_megatron_bridge_gpu.py28def test_auto_bridge_provider_creation(mb_model_path: str):CODE
LOWtests/train/megatron_bridge/test_model_support.py70def test_megatron_bridge_supported_models_match_expected():CODE
LOWtests/train/megatron_bridge/test_model_support.py75def test_check_model_support_accepts_supported(model_type: str):CODE
LOWtests/train/megatron_bridge/test_model_support.py84def test_check_model_support_rejects_unsupported(model_type: str):CODE
LOWtests/train/megatron_bridge/test_dataset_export.py28def test_inject_generation_block_into_llama_factory_template():CODE
LOWtests/train/megatron_bridge/test_dataset_export.py41def test_example_to_record_messages_format():CODE
LOWtests/train/megatron_bridge/test_dataset_export.py53def test_example_to_record_pretrain_text():CODE
LOWtests/train/megatron_bridge/test_dataset_export.py59def test_example_to_record_sharegpt_format():CODE
LOWtests/train/megatron_bridge/test_dataset_export.py76def test_export_dataset_for_megatron_bridge(mb_output_dir: Path, mb_model_path: str):CODE
LOWtests/train/megatron_bridge/test_dataset_export.py99def test_get_sft_dataset_kwargs_enables_chat():CODE
LOWtests/train/megatron_bridge/test_dataset_export.py105def test_tokenizer_supports_hf_chat_template_on_gpu(mb_model_path: str):CODE
LOWtests/train/megatron_bridge/test_config_builder.py74def test_compute_train_schedule_max_steps():CODE
LOWtests/train/megatron_bridge/test_config_builder.py87def test_apply_model_parallelism():CODE
LOWtests/train/megatron_bridge/test_config_builder.py115def test_megatron_bridge_args_rejects_invalid_moe_dispatcher():CODE
LOWtests/train/megatron_bridge/test_config_builder.py120def test_apply_fusion_safety_disables_missing_apex():CODE
LOWtests/train/megatron_bridge/test_config_builder.py126def test_megatron_bridge_args_sequence_parallel_requires_tp():CODE
LOWtests/train/megatron_bridge/test_config_builder.py131def test_resolve_warmup_steps_keeps_absolute_warmup():CODE
LOWtests/train/megatron_bridge/test_config_builder.py136def test_resolve_decay_iters_expands_for_warmup():CODE
LOWtests/train/megatron_bridge/test_config_builder.py144def test_megatron_bridge_args_extra_config_strips_whitespace():CODE
LOWtests/train/megatron_bridge/test_config_builder.py149def test_apply_extra_overrides_nested_path():CODE
LOWtests/train/megatron_bridge/test_config_builder.py155def test_should_resume_checkpoint_respects_overwrite(tmp_path):CODE
LOWtests/train/megatron_bridge/test_config_builder.py166def test_build_sft_config_on_gpu(mb_training_args_factory, mb_output_dir):CODE
LOWtests/train/megatron_bridge/test_config_builder.py189def test_build_pretrain_config_on_gpu(mb_training_args_factory, mb_output_dir):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_moss_vl_training_configs.py23def test_moss_vl_training_configs_are_unpacked_and_additive():CODE
LOWtests/data/test_mm_plugin.py317def 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
252 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.py57# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py59# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py67# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py69# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py167# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py169# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py210# ==============================================================================COMMENT
MEDIUMtests_v1/trainers/test_dpo_loss_precision.py212# ==============================================================================COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py51# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py53# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py251# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py253# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py273# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py275# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py334# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py336# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py355# ---------------------------------------------------------------------------COMMENT
MEDIUM…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py357# ---------------------------------------------------------------------------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.py134 # ------------------------------------------------------------------STRING
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py136 # ------------------------------------------------------------------STRING
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py167 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py169 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py247 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py249 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py287 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py289 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py313 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py315 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py349 # ------------------------------------------------------------------COMMENT
MEDIUMsrc/llamafactory/v1/trainers/dpo_trainer.py351 # ------------------------------------------------------------------COMMENT
Deep Nesting102 hits · 98 pts
SeverityFileLineSnippetContext
LOWtests/data/test_collator.py140CODE
LOWtests/data/test_mm_plugin.py118CODE
LOWtests_v1/plugins/model_plugins/test_kernel_plugin.py42CODE
LOWtests_v1/plugins/model_plugins/test_kernel_plugin.py66CODE
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.py245CODE
LOWsrc/llamafactory/v1/core/data_engine.py101CODE
LOWsrc/llamafactory/v1/core/utils/batching.py124CODE
LOWsrc/llamafactory/v1/core/rendering/escape.py62CODE
LOWsrc/llamafactory/v1/core/rendering/rendering.py262CODE
LOWsrc/llamafactory/v1/core/rendering/format.py38CODE
LOWsrc/llamafactory/v1/core/rendering/format.py101CODE
LOWsrc/llamafactory/v1/core/rendering/format.py115CODE
LOWsrc/llamafactory/v1/config/arg_utils.py61CODE
LOWsrc/llamafactory/v1/plugins/trainer_plugins/batching.py123CODE
LOW…actory/v1/plugins/trainer_plugins/distributed/fsdp2.py230CODE
LOW…actory/v1/plugins/trainer_plugins/distributed/fsdp2.py486CODE
LOW…ry/v1/plugins/trainer_plugins/distributed/fsdpturbo.py355CODE
LOWsrc/llamafactory/v1/plugins/model_plugins/peft.py207CODE
LOW…ins/model_plugins/parallelization/sequence_parallel.py86CODE
LOW…ins/model_plugins/parallelization/sequence_parallel.py146CODE
LOWsrc/llamafactory/v1/plugins/data_plugins/converter.py173CODE
LOWsrc/llamafactory/chat/hf_engine.py73CODE
LOWsrc/llamafactory/chat/chat_model.py47CODE
LOWsrc/llamafactory/hparams/parser.py395CODE
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.py147CODE
LOWsrc/llamafactory/model/loader.py131CODE
LOWsrc/llamafactory/model/patcher.py88CODE
LOWsrc/llamafactory/model/patcher.py440CODE
LOWsrc/llamafactory/model/model_utils/attention.py31CODE
LOWsrc/llamafactory/model/model_utils/quantization.py86CODE
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.py69CODE
LOWsrc/llamafactory/train/hyper_parallel/workflow.py62CODE
LOW…c/llamafactory/train/megatron_bridge/dataset_export.py170CODE
LOWsrc/llamafactory/train/megatron_bridge/workflow.py65CODE
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
42 more matches not shown…
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
Excessive Try-Catch Wrapping59 hits · 58 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.py457 except Exception as e:CODE
LOW…1/plugins/trainer_plugins/optimizers/muon_optimizer.py176 except Exception as e: # noqa: BLE001CODE
LOWsrc/llamafactory/v1/plugins/model_plugins/peft.py341 except Exception as e:STRING
LOW…/v1/plugins/model_plugins/kernels/ops/rope/npu_rope.py153 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.py499 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.py159 except Exception as e:CODE
LOWsrc/llamafactory/train/tuner.py274 except Exception as e:CODE
LOW…c/llamafactory/train/megatron_bridge/dataset_export.py46 except Exception:CODE
LOW…c/llamafactory/train/megatron_bridge/dataset_export.py97 except Exception as exc:STRING
LOW…c/llamafactory/train/megatron_bridge/dataset_export.py108 except Exception as exc:STRING
LOW…c/llamafactory/train/megatron_bridge/dataset_export.py117 except Exception as exc:STRING
LOW…c/llamafactory/train/megatron_bridge/dataset_export.py137 except Exception as exc:CODE
LOW…c/llamafactory/train/megatron_bridge/dataset_export.py201 except Exception:STRING
LOWsrc/llamafactory/train/megatron_bridge/workflow.py219 except Exception: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
Self-Referential Comments17 hits · 38 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…1/plugins/trainer_plugins/optimizers/muon_optimizer.py15# This module is vendored into v1 (independent of v0 / `llamafactory.third_party.muon`)COMMENT
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.py48__all__ = ["BatchGenerator"]CODE
LOWsrc/llamafactory/v1/core/utils/batching.py362 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…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py48logger = 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__.py25__all__ = [CODE
LOWsrc/llamafactory/hparams/parser.py212def _set_transformers_logging() -> None:CODE
LOWsrc/llamafactory/hparams/parser.py219def _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.py290 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/megatron_bridge/__init__.py18__all__ = ["run_pt", "run_sft"]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.py1759 dummy_data = [torch.empty(0) for _ in range(len(batch_ids))]CODE
LOWsrc/llamafactory/data/mm_plugin.py1760 mm_inputs.update({"tgt_sizes": dummy_data, "pixel_values": dummy_data, "image_sizes": dummy_data})CODE
Hallucination Indicators2 hits · 20 pts
SeverityFileLineSnippetContext
CRITICAL…ry/v1/plugins/trainer_plugins/distributed/deepspeed.py108 zero_config = self.accelerator.state.deepspeed_plugin.deepspeed_config.get("zero_optimization", {})CODE
CRITICALsrc/llamafactory/third_party/triton/utils.py270 triton.runtime.driver.active.utils.get_device_properties(i)["max_shared_mem"]CODE
AI Structural Patterns18 hits · 18 pts
SeverityFileLineSnippetContext
LOWtests/train/megatron_bridge/conftest.py52CODE
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.py158CODE
LOW…1/plugins/trainer_plugins/optimizers/muon_optimizer.py119CODE
LOW…ry/v1/plugins/model_plugins/parallelization/ulysses.py189CODE
LOW…plugins/model_plugins/parallelization/gdn_attention.py250CODE
LOW…ins/model_plugins/parallelization/sequence_parallel.py50CODE
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.py534CODE
Magic Placeholder Names3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHREADME.md8611. 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.md863方式一:在 yaml 文件中添加 `swanlab_api_key=<your_api_key>` ,并设置为你的 [API 密钥](https://swanlab.cn/settings)。CODE
HIGHdata/dpo_zh_demo.json3735 "value": "创建一个完整的程序像这样将是一个复杂且漫长的过程,涉及图形和音频处理。然而,我可以指导您完成初始步骤,并为您提供资源,帮助您构建项目的简单文本版本。\n\n要获取天气数据,您可以使用OpenWeatherMaCODE
Docstring Block Structure3 hits · 15 pts
SeverityFileLineSnippetContext
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…ins/model_plugins/kernels/ops/rms_norm/npu_rms_norm.py90NPU forward implementation for Gated RMSNorm with high-precision FP32 computation. This function performs RMSNorm aSTRING
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
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.py173 # Step 1: Scatter grad_output to expert bufferCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py176 # Step 2: FC2 backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py197 # Step 3: Routing weight backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py206 # Step 4: SiLU gate backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py216 # Step 5: FC1 backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py237 # 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.py173 # Step 1: Scatter grad_output to expert bufferCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py176 # Step 2: FC2 backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py197 # Step 3: Routing weight backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py206 # Step 4: SiLU gate backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py216 # Step 5: FC1 backwardCOMMENT
LOW…lugins/model_plugins/kernels/ops/mlp/cuda_fused_moe.py237 # Step 6: Gather gradients back to original positionsCOMMENT
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.py357 # 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.py312 # Check if position_ids shape matches expected shape.COMMENT
Modern AI Meta-Vocabulary2 hits · 5 pts
SeverityFileLineSnippetContext
MEDIUMREADME.md28### Check our new open-source project —<br>🐧 [PenguinHarness](https://github.com/Prism-Shadow/penguin-harness): Local-fiCOMMENT
MEDIUMREADME.md42| <div style="text-align: center;"><a href="https://warp.dev/llama-factory"><img alt="Warp sponsorship" width="400" src=CODE
Synthetic Comment Markers2 hits · 5 pts
SeverityFileLineSnippetContext
HIGHtests/data/test_template.py258 "# 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.py185 # 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