본문으로 건너뛰기
Skillpedia
에이전트48k · #4839

hugging-face-model-trainer

하는 일

이 에이전트는 언어와 이미지를 이해하는 AI 모델을 학습하거나 미세 조정합니다. 고급 도구를 사용해 모델 성능을 높이고, 내 컴퓨터에서 쓸 수 있도록 준비할 수도 있습니다.

사용하는 경우

  • ✓강력한 컴퓨터 없이 AI 모델을 개선하고 싶을 때.
  • ✓SFT, DPO, GRPO 같은 특정 방법으로 모델을 학습시킬 때.
  • ✓학습된 모델을 Ollama 같은 도구에서 로컬로 실행할 수 있도록 변환하고 싶을 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hugging-face-model-trainer/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hugging-face-model-trainer/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“SFT 방법을 사용해 요리에 관한 질문에 답하도록 언어 모델을 학습시키고, 'my-cooking-model'이라는 이름으로 저장해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

학습 데이터를 제공하고 학습 방법을 고르면, 에이전트가 강력한 GPU를 갖춘 서버에서 Hugging Face의 인프라를 사용해 무거운 작업을 처리합니다. 그 후 어디서든 쓸 수 있도록 모델을 변환해 줍니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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 FastVisionModel support

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_TOKEN syntax 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, checkpoints
  • scripts/train_dpo_example.py - DPO training for preference learning
  • scripts/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.
자주 묻는 질문

이 에이전트를 사용하려면 돈을 내야 하나요?

네, 학습에 쓰이는 Hugging Face Jobs는 유료 요금제(Pro, Team, Enterprise)가 필요합니다.

'미세 조정(fine-tune)'은 무슨 뜻인가요?

언어처럼 이미 많은 것을 아는 AI 모델에게 요리나 의학 같은 특정 주제를 전문적으로 가르치는 것과 같습니다.

GGUF는 무엇인가요?

학습된 AI 모델을 Ollama나 LM Studio 같은 프로그램을 사용해 일반 컴퓨터에서 효율적으로 실행할 수 있게 하는 특별한 형식입니다.

상세 정보

작성자의 원본 설명

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.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4839
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬