[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EPGJTYQ3GVXCMS4456T07Q":3,"skill-same:01M7EPGJTYQ3GVXCMS4456T07Q":63},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":31,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":48},"01M7EPGJTYQ3GVXCMS4456T07Q","save-load-merge",null,"Save, load, inspect, merge, hotswap, mix, and convert PEFT adapters and checkpoints for local or Hub workflows.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fpeft\u002Fsub-skills\u002Fsave-load-merge\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: save-load-merge\ndescription: \"Save, load, inspect, merge, hotswap, mix, and convert PEFT\n  adapters and checkpoints for local or Hub workflows.\"\ndisable-model-invocation: true\nmetadata:\n  disco-role: operating\nlicense: Apache 2.0\n---\n\n# Save, Load, and Merge\n\nUse this sub-skill when the task is about PEFT checkpoint files, `save_pretrained`, `from_pretrained`, `AutoPeftModel*`, adapter state dicts, Hub loading, `merge_and_unload`, `PeftMixedModel`, hotswapping adapters, weighted adapter merging, conversion helpers, or deployment packaging.\n\n## Route Here For\n\n- Inspecting or repairing adapter folders containing `adapter_config.json` plus `adapter_model.safetensors` or `adapter_model.bin`.\n- Loading adapters with `PeftModel.from_pretrained`, `PeftConfig.from_pretrained`, `AutoPeftModel*`, or `load_adapter`.\n- Saving adapter-only checkpoints with `save_pretrained`, including non-default adapter subdirectories and embedding-layer save decisions.\n- Loading multiple adapters, activating one or several adapters, using `PeftMixedModel`, or hotswapping LoRA weights in place.\n- Merging adapters into base weights with `merge_and_unload` or creating weighted LoRA\u002F(IA)³ adapters with `add_weighted_adapter`.\n- Converting compatible non-LoRA adapters or Transformers-loaded PEFT weights into LoRA-style artifacts.\n- Diagnosing bad loaded outputs, missing base models, random new-token embeddings, version mismatches, slow loads, and merge limitations.\n\n## Route Elsewhere\n\n- Initial adapter wrapping with `get_peft_model`, `PeftConfig`, target module selection, and adapter lifecycle basics: use `..\u002Fadapter-core\u002FSKILL.md`.\n- LoRA variant choices, quantized-base setup, DoRA, rsLoRA, QLoRA, LoftQ, QALoRA, or trainable-token configuration: use `..\u002Flora-and-quantization\u002FSKILL.md`.\n- Method-specific limits for prompt tuning, IA³, OFT\u002FBOFT, VeRA, LoHa\u002FLoKr, Poly, FourierFT, or other tuners: use the relevant method sub-skill.\n- Trainer, Accelerate, distributed, FSDP, DeepSpeed, or training launch mechanics: use `..\u002Ftraining-and-integrations\u002FSKILL.md`.\n\n## Start Fast\n\n1. Run `python scripts\u002Finspect_adapter_checkpoint.py \u003Cadapter-dir>` from this sub-skill directory to check local adapter files without network access.\n2. Read `references\u002Fcheckpoints.md` for checkpoint layout, save\u002Fload class selection, state dict helpers, Hub\u002Flocal loading, and embedding save rules.\n3. Read `references\u002Fmerge-and-conversion.md` for `merge_and_unload`, weighted adapter merging, mixed adapters, hotswap, and conversion utilities.\n4. Read `references\u002Ftroubleshooting.md` when loaded results look wrong or errors mention base models, vocab\u002Fembeddings, unexpected config keys, slow adapter load, active adapters, or unsupported merges.\n\n## Core Save\u002FLoad Pattern\n\n```python\nfrom peft import PeftConfig, PeftModel\nfrom transformers import AutoModelForCausalLM\n\nadapter_id = \"org-or-path\u002Fmy-adapter\"\nconfig = PeftConfig.from_pretrained(adapter_id)\nbase_model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path)\nmodel = PeftModel.from_pretrained(base_model, adapter_id)\n```\n\nUse `AutoPeftModelForCausalLM.from_pretrained(adapter_id)` when the adapter config contains enough base-model and task information and you want PEFT to infer the model class. Use the explicit `PeftConfig` + Transformers base model pattern when you need full control over dtype, quantization, `device_map`, local files, revisions, or base-model class.\n\n## Checkpoint Rules of Thumb\n\n- PEFT adapter checkpoints are adapter-only by default; they do not contain the full base model.\n- A loadable adapter directory needs `adapter_config.json` and either `adapter_model.safetensors` or `adapter_model.bin`.\n- `adapter_config.json` should identify `peft_type`; `task_type` and `base_model_name_or_path` strongly improve automatic loading and handoff quality.\n- `adapter_model.safetensors` is preferred over `.bin`; both carry the adapter `state_dict`.\n- Non-default adapters are saved in a subdirectory named after the adapter, while the adapter name is stripped from saved state-dict keys.\n- If training added vocabulary tokens or trained task heads, ensure embeddings or heads were saved with `save_embedding_layers=True`, `modules_to_save`, or method-specific trainable-token settings.\n\n## Merge and Deployment Decision Pattern\n\n- Keep adapter checkpoints for continued PEFT operations: loading multiple adapters, disabling adapters, switching adapters, hotswapping, or sharing compact files.\n- Use `merged_model = model.merge_and_unload()` when deployment needs a plain Transformers model and the method\u002Fsettings support merging.\n- Do not expect to unmerge after saving a merged full model; merging discards PEFT wrapper functionality in the returned model.\n- Use `model.add_weighted_adapter(...)` to create a new adapter from compatible loaded adapters before selecting it with `set_adapter`.\n- Use `PeftMixedModel` only for inference-time composition of compatible adapter types; mixed adapter models are not a portable saved mixed checkpoint.\n- Use hotswap for replacing compatible LoRA weights in place, especially to avoid recompilation after `torch.compile`.\n\n## Bundled Materials\n\n- `references\u002Fcheckpoints.md`: concrete file layout, save\u002Fload workflows, state dict helpers, Hub\u002Flocal loading, AutoPeftModel choices, and embedding persistence.\n- `references\u002Fmerge-and-conversion.md`: merge\u002Funload, weighted merges, mixed adapters, hotswap constraints, and conversion helpers.\n- `references\u002Ftroubleshooting.md`: focused diagnosis for bad outputs, missing bases, random embeddings, version drift, slow loading, adapter activation, and merge failures.\n- `scripts\u002Finspect_adapter_checkpoint.py`: no-network local adapter directory inspector with class hints and tiny fixture generation.\n","# Save, Load, and Merge\n\nUse this sub-skill when the task is about PEFT checkpoint files, `save_pretrained`, `from_pretrained`, `AutoPeftModel*`, adapter state dicts, Hub loading, `merge_and_unload`, `PeftMixedModel`, hotswapping adapters, weighted adapter merging, conversion helpers, or deployment packaging.\n\n## Route Here For\n\n- Inspecting or repairing adapter folders containing `adapter_config.json` plus `adapter_model.safetensors` or `adapter_model.bin`.\n- Loading adapters with `PeftModel.from_pretrained`, `PeftConfig.from_pretrained`, `AutoPeftModel*`, or `load_adapter`.\n- Saving adapter-only checkpoints with `save_pretrained`, including non-default adapter subdirectories and embedding-layer save decisions.\n- Loading multiple adapters, activating one or several adapters, using `PeftMixedModel`, or hotswapping LoRA weights in place.\n- Merging adapters into base weights with `merge_and_unload` or creating weighted LoRA\u002F(IA)³ adapters with `add_weighted_adapter`.\n- Converting compatible non-LoRA adapters or Transformers-loaded PEFT weights into LoRA-style artifacts.\n- Diagnosing bad loaded outputs, missing base models, random new-token embeddings, version mismatches, slow loads, and merge limitations.\n\n## Route Elsewhere\n\n- Initial adapter wrapping with `get_peft_model`, `PeftConfig`, target module selection, and adapter lifecycle basics: use `..\u002Fadapter-core\u002FSKILL.md`.\n- LoRA variant choices, quantized-base setup, DoRA, rsLoRA, QLoRA, LoftQ, QALoRA, or trainable-token configuration: use `..\u002Flora-and-quantization\u002FSKILL.md`.\n- Method-specific limits for prompt tuning, IA³, OFT\u002FBOFT, VeRA, LoHa\u002FLoKr, Poly, FourierFT, or other tuners: use the relevant method sub-skill.\n- Trainer, Accelerate, distributed, FSDP, DeepSpeed, or training launch mechanics: use `..\u002Ftraining-and-integrations\u002FSKILL.md`.\n\n## Start Fast\n\n1. Run `python scripts\u002Finspect_adapter_checkpoint.py \u003Cadapter-dir>` from this sub-skill directory to check local adapter files without network access.\n2. Read `references\u002Fcheckpoints.md` for checkpoint layout, save\u002Fload class selection, state dict helpers, Hub\u002Flocal loading, and embedding save rules.\n3. Read `references\u002Fmerge-and-conversion.md` for `merge_and_unload`, weighted adapter merging, mixed adapters, hotswap, and conversion utilities.\n4. Read `references\u002Ftroubleshooting.md` when loaded results look wrong or errors mention base models, vocab\u002Fembeddings, unexpected config keys, slow adapter load, active adapters, or unsupported merges.\n\n## Core Save\u002FLoad Pattern\n\n```python\nfrom peft import PeftConfig, PeftModel\nfrom transformers import AutoModelForCausalLM\n\nadapter_id = \"org-or-path\u002Fmy-adapter\"\nconfig = PeftConfig.from_pretrained(adapter_id)\nbase_model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path)\nmodel = PeftModel.from_pretrained(base_model, adapter_id)\n```\n\nUse `AutoPeftModelForCausalLM.from_pretrained(adapter_id)` when the adapter config contains enough base-model and task information and you want PEFT to infer the model class. Use the explicit `PeftConfig` + Transformers base model pattern when you need full control over dtype, quantization, `device_map`, local files, revisions, or base-model class.\n\n## Checkpoint Rules of Thumb\n\n- PEFT adapter checkpoints are adapter-only by default; they do not contain the full base model.\n- A loadable adapter directory needs `adapter_config.json` and either `adapter_model.safetensors` or `adapter_model.bin`.\n- `adapter_config.json` should identify `peft_type`; `task_type` and `base_model_name_or_path` strongly improve automatic loading and handoff quality.\n- `adapter_model.safetensors` is preferred over `.bin`; both carry the adapter `state_dict`.\n- Non-default adapters are saved in a subdirectory named after the adapter, while the adapter name is stripped from saved state-dict keys.\n- If training added vocabulary tokens or trained task heads, ensure embeddings or heads were saved with `save_embedding_layers=True`, `modules_to_save`, or method-specific trainable-token settings.\n\n## Merge and Deployment Decision Pattern\n\n- Keep adapter checkpoints for continued PEFT operations: loading multiple adapters, disabling adapters, switching adapters, hotswapping, or sharing compact files.\n- Use `merged_model = model.merge_and_unload()` when deployment needs a plain Transformers model and the method\u002Fsettings support merging.\n- Do not expect to unmerge after saving a merged full model; merging discards PEFT wrapper functionality in the returned model.\n- Use `model.add_weighted_adapter(...)` to create a new adapter from compatible loaded adapters before selecting it with `set_adapter`.\n- Use `PeftMixedModel` only for inference-time composition of compatible adapter types; mixed adapter models are not a portable saved mixed checkpoint.\n- Use hotswap for replacing compatible LoRA weights in place, especially to avoid recompilation after `torch.compile`.\n\n## Bundled Materials\n\n- `references\u002Fcheckpoints.md`: concrete file layout, save\u002Fload workflows, state dict helpers, Hub\u002Flocal loading, AutoPeftModel choices, and embedding persistence.\n- `references\u002Fmerge-and-conversion.md`: merge\u002Funload, weighted merges, mixed adapters, hotswap constraints, and conversion helpers.\n- `references\u002Ftroubleshooting.md`: focused diagnosis for bad outputs, missing bases, random embeddings, version drift, slow loading, adapter activation, and merge failures.\n- `scripts\u002Finspect_adapter_checkpoint.py`: no-network local adapter directory inspector with class hints and tiny fixture generation.\n",{"name":5,"license":24,"metadata":25,"description":7,"disable-model-invocation":27},"Apache 2.0",{"disco-role":26},"operating",true,"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Fpeft\u002Fsub-skills\u002Fsave-load-merge",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":27},[38,41,44],{"tool":39,"command":40},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill save-load-merge",{"tool":42,"command":43},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill save-load-merge",{"tool":45,"command":46},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill save-load-merge","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fpeft\u002Fsub-skills\u002Fsave-load-merge\u002FSKILL.md",[49,55,59],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002Fcheckpoints.md","REFERENCE","参考文档",5615,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fpeft\u002Fsub-skills\u002Fsave-load-merge\u002Freferences\u002Fcheckpoints.md",{"path":56,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fmerge-and-conversion.md",5535,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fpeft\u002Fsub-skills\u002Fsave-load-merge\u002Freferences\u002Fmerge-and-conversion.md",{"path":60,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Ftroubleshooting.md",5261,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fpeft\u002Fsub-skills\u002Fsave-load-merge\u002Freferences\u002Ftroubleshooting.md",[64,73,78,85,92,99],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":72},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":74,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":72},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":72},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":72},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":72},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":72},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]