{"record":{"id":"91ea5e180bf3e01d","repo":"hiyouga/LlamaFactory","slug":"unknown-finetuning-type-finetuning-args-finetuni","errorCode":null,"errorMessage":"Unknown finetuning type: {finetuning_args.finetuning_type}.","messagePattern":"Unknown finetuning type: (.+?)\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"src/llamafactory/model/adapter.py","lineNumber":360,"sourceCode":"        pass\n    elif finetuning_args.pure_bf16 or finetuning_args.use_badam:\n        logger.info_rank0(\"Pure bf16 / BAdam detected, remaining trainable params in half precision.\")\n    elif model_args.quantization_bit is None and is_deepspeed_zero3_enabled():\n        logger.info_rank0(\"DeepSpeed ZeRO3 detected, remaining trainable params in float32.\")\n    else:\n        logger.info_rank0(\"Upcasting trainable params to float32.\")\n        cast_trainable_params_to_fp32 = True\n\n    if finetuning_args.finetuning_type == \"full\":\n        _setup_full_tuning(model, finetuning_args, is_trainable, cast_trainable_params_to_fp32)\n    elif finetuning_args.finetuning_type == \"freeze\":\n        _setup_freeze_tuning(model, finetuning_args, is_trainable, cast_trainable_params_to_fp32)\n    elif finetuning_args.finetuning_type in [\"lora\", \"oft\"]:\n        model = _setup_lora_tuning(\n            config, model, model_args, finetuning_args, is_trainable, cast_trainable_params_to_fp32\n        )\n    else:\n        raise NotImplementedError(f\"Unknown finetuning type: {finetuning_args.finetuning_type}.\")\n\n    return model\n","sourceCodeStart":342,"sourceCodeEnd":363,"githubUrl":"https://github.com/hiyouga/LlamaFactory/blob/f28afaf6355af515454dfb16c97d728307c93897/src/llamafactory/model/adapter.py#L342-L363","documentation":"Raised as NotImplementedError at the end of setup_adapter when finetuning_args.finetuning_type matches none of full, freeze, lora, oft. The value is a free string from the config, so any typo or unsupported method falls through to this branch.","triggerScenarios":"Setting finetuning_type to a misspelling ('lor', 'Lora'), a case variant ('LoRA'), or a method this version does not implement.","commonSituations":"YAML typos; assuming a newer method name (e.g. from another framework) is available in the installed version.","solutions":["Set finetuning_type to one of: full, freeze, lora, oft (lowercase).","Check for stray whitespace/quotes in the YAML value."],"exampleFix":"# before\nfinetuning_type: LoRA\n\n# after\nfinetuning_type: lora","handlingStrategy":"type-guard","validationCode":"VALID = {\"full\", \"freeze\", \"lora\", \"oft\"}\nft = cfg[\"finetuning_args\"][\"finetuning_type\"]\nassert ft in VALID, f\"finetuning_type must be one of {sorted(VALID)}, got {ft!r}\"","typeGuard":"def is_valid_finetuning_type(ft: str) -> bool:\n    return ft in {\"full\", \"freeze\", \"lora\", \"oft\"}","tryCatchPattern":null,"preventionTips":["Validate config enums against a whitelist before submitting training jobs.","Use lowercase enum values; watch for YAML typos and trailing spaces."],"tags":["finetuning-type","typo","config","not-implemented"],"backgroundTag":null,"analyzedSha":"f28afaf6355af515454dfb16c97d728307c93897","analyzedAt":"2026-08-14T21:57:28.298Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}