Skip to content
Back to skills

Finetuning

ASecurity

"Guides LoRA instruction fine-tuning for Huatuo-Llama-Med-Chinese

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 8, 2026
toolsapi

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill finetuning --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Finetuning?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Finetuning
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-finetuning/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-finetuning)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: finetuning
description: "Guides LoRA instruction fine-tuning for Huatuo-Llama-Med-Chinese
  style medical QA data using PEFT and Transformers."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# Finetuning

Use this sub-skill when the task is to plan, validate, or construct a safe dry-run command for LoRA instruction fine-tuning on Chinese medical QA data with the repository-compatible PEFT/Transformers training interface.

## Route here for

- LoRA fine-tuning parameter selection: batch size, micro batch size, epochs, learning rate, cutoff length, validation size, and LoRA rank/alpha/dropout/target modules.
- Medical QA training data checks for the required JSONL fields `instruction`, `input`, and `output`.
- W&B, DDP, checkpoint resume, and adapter save behavior for the training workflow.
- Safe command construction with the bundled dry-run builder: [`scripts/build_finetune_command.py`](scripts/build_finetune_command.py).

## Route elsewhere

- Prompt template JSON semantics, `Prompter` behavior, or data conversion details: use `prompt-data-formats`.
- Merging or exporting LoRA adapters after training: use `checkpoint-export`.
- Running inference from a trained adapter: use `inference`.

## Required reading in this sub-skill

- Workflow and resource guidance: [`references/workflows.md`](references/workflows.md).
- Training interface and defaults: [`references/api-reference.md`](references/api-reference.md).
- Failure diagnosis: [`references/troubleshooting.md`](references/troubleshooting.md).
- Dry-run command builder: [`scripts/build_finetune_command.py`](scripts/build_finetune_command.py).

## Minimal safe workflow

1. Validate that every training record is JSONL with string fields `instruction`, `input`, and `output`; `input` may be an empty string but should still be present for this training implementation.
2. Choose a prompt template name. For the medical-knowledge LLaMA/Alpaca workflow, use `med_template` unless a different compatible template is intentional.
3. Build a dry-run command with the bundled builder. Do not start training until model assets, CUDA/bitsandbytes compatibility, output storage, and W&B/DDP behavior are reviewed.
4. For limited memory GPUs, lower `micro_batch_size`, lower total `batch_size`, and consider lowering `cutoff_len` before attempting training.
5. When resuming, point `resume_from_checkpoint` at either a Trainer checkpoint directory or a LoRA adapter directory whose LoRA configuration matches the new run.

## Safety notes

Full fine-tuning is expensive and depends on external base-model weights, GPU memory, a compatible Torch/CUDA/bitsandbytes stack, and medical-data quality. The bundled script only builds and optionally validates a command; it does not import model libraries, download weights, or launch training.

Files in this skill

  • SKILL.md2.8 KB
  • references/api-reference.md6.5 KB
  • references/troubleshooting.md7.1 KB
  • references/workflows.md7.1 KB
  • scripts/build_finetune_command.py12.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.