hugging-face-model-trainer
Skill này làm gì
Agent này huấn luyện hoặc tinh chỉnh các mô hình AI để hiểu ngôn ngữ và hình ảnh. Nó dùng các công cụ nâng cao để cải thiện hiệu năng mô hình và có thể chuẩn bị mô hình để chạy trên máy của bạn.
Khi nào nên dùng
- ✓Khi bạn muốn cải thiện một mô hình AI mà không cần máy tính mạnh.
- ✓Khi muốn huấn luyện mô hình bằng các phương pháp cụ thể như SFT, DPO hoặc GRPO.
- ✓Khi bạn muốn chuyển đổi mô hình đã huấn luyện để chạy cục bộ trên các công cụ như Ollama.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hugging-face-model-trainer/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Huấn luyện một mô hình ngôn ngữ để trả lời câu hỏi về nấu ăn bằng phương pháp SFT và lưu với tên 'my-cooking-model'.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Bạn cung cấp dữ liệu và chọn phương pháp huấn luyện. Agent dùng hạ tầng của Hugging Face để làm phần việc nặng trên các máy chủ có GPU mạnh. Sau đó, nó có thể chuyển đổi mô hình để bạn dùng ở bất kỳ đâu.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
TRL Training on Hugging Face Jobs
Detailed Guide
Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.
When to Use This Skill
Use this skill when users want to:
- Fine-tune language models on cloud GPUs without local infrastructure
- Train with TRL methods (SFT, DPO, GRPO, etc.)
- Run training jobs on Hugging Face Jobs infrastructure
- Convert trained models to GGUF for local deployment (Ollama, LM Studio, llama.cpp)
- Ensure trained models are permanently saved to the Hub
- Use modern workflows with optimized defaults
When to Use Unsloth
Use Unsloth (references/unsloth.md) instead of standard TRL when:
- Limited GPU memory - Unsloth uses ~60% less VRAM
- Speed matters - Unsloth is ~2x faster
- Training large models (>13B) - memory efficiency is critical
- Training Vision-Language Models (VLMs) - Unsloth has
FastVisionModelsupport
See references/unsloth.md for complete Unsloth documentation and scripts/unsloth_sft_example.py for a production-ready training script.
Prerequisites Checklist
Before starting any training job, verify:
✅ Account & Authentication
- Hugging Face Account with Pro, Team, or Enterprise plan (Jobs require paid plan)
- Authenticated login: Check with
hf_whoami() - HF_TOKEN for Hub Push ⚠️ CRITICAL - Training environment is ephemeral, must push to Hub or ALL training results are lost
- Token must have write permissions
- MUST pass
secrets={"HF_TOKEN": "$HF_TOKEN"}in job config to make token available (the$HF_TOKENsyntax references your actual token value)
✅ Dataset Requirements
- Dataset must exist on Hub or be loadable via
datasets.load_dataset() - Format must match training method (SFT: "messages"/text/prompt-completion; DPO: chosen/rejected; GRPO: prompt-only)
- ALWAYS validate unknown datasets before GPU training to prevent format failures (see Dataset Validation section below)
- Size appropriate for hardware (Demo: 50-100 examples on t4-small; Production: 1K-10K+ on a10g-large/a100-large)
⚠️ Critical Settings
- Timeout must exceed expected training time - Default 30min is TOO SHORT for most training. Minimum recommended: 1-2 hours. Job fails and loses all progress if timeout is exceeded.
- Hub push must be enabled - Config:
push_to_hub=True,hub_model_id="username/model-name"; Job:secrets={"HF_TOKEN": "$HF_TOKEN"}
Example Training Scripts
Production-ready templates with all best practices:
Load these scripts for correctly:
scripts/train_sft_example.py- Complete SFT training with Trackio, LoRA, checkpointsscripts/train_dpo_example.py- DPO training for preference learningscripts/train_grpo_example.py- GRPO training for online RL
These scripts demonstrate proper Hub saving, Trackio integration, checkpoint management, and optimized parameters. Pass their content inline to hf_jobs() or use as templates for custom scripts.
Limitations
- Use this skill only when the task clearly matches its upstream product or API scope.
- Verify commands, API behavior, pricing, quotas, credentials, and deployment effects against current official documentation before making changes.
- Do not treat generated examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
Câu hỏi thường gặp
Tôi có phải trả tiền để dùng agent này không?
Có, Hugging Face Jobs, dùng để huấn luyện, yêu cầu gói trả phí (Pro, Team hoặc Enterprise).
“Fine-tune” nghĩa là gì?
Giống như dạy một mô hình AI đã biết nhiều về ngôn ngữ để chuyên sâu về một chủ đề cụ thể, như nấu ăn hoặc y học.
GGUF là gì?
GGUF là định dạng đặc biệt cho phép mô hình AI đã huấn luyện chạy hiệu quả trên máy tính thông thường, bằng các chương trình như Ollama hoặc LM Studio.
Chi tiết
Mô tả gốc của tác giả
Train or fine-tune language and vision models using TRL (Transformer Reinforcement Learning) or Unsloth with Hugging Face Jobs infrastructure. Covers SFT, DPO, GRPO and reward modeling training methods, plus GGUF conversion for local deployment.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #4839
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.