[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-huggingface-huggingface-llm-trainer":3,"mdc--hs9lrh-key":38,"related-repo-huggingface-huggingface-llm-trainer":5638,"related-org-huggingface-huggingface-llm-trainer":5734},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":27,"repoUrl":28,"updatedAt":29,"license":30,"forks":31,"topics":32,"repo":33,"sourceUrl":36,"mdContent":37},"huggingface-llm-trainer","train and fine-tune LLMs with TRL","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. Includes guidance on the TRL Jobs package, UV scripts with PEP 723 format, dataset preparation and validation, hardware selection, cost estimation, Trackio monitoring, Hub authentication, model selection\u002Fleaderboards and model persistence. Use for tasks involving cloud GPU training, GGUF conversion, or when users mention training on Hugging Face Jobs without local GPU setup.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"huggingface","Hugging Face","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fhuggingface.png",[12,15,18,21,24],{"name":9,"slug":13,"type":14},"hugging-face","tag",{"name":16,"slug":17,"type":14},"LLM","llm",{"name":19,"slug":20,"type":14},"Deep Learning","deep-learning",{"name":22,"slug":23,"type":14},"Python","python",{"name":25,"slug":26,"type":14},"AI Infrastructure","ai-infrastructure",10861,"https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fskills","2026-04-06T18:25:46.551064","Complete terms in LICENSE.txt",721,[],{"repoUrl":28,"stars":27,"forks":31,"topics":34,"description":35},[],"Give your agents the power of the Hugging Face ecosystem","https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fskills\u002Ftree\u002FHEAD\u002Fskills\u002Fhuggingface-llm-trainer","---\nname: huggingface-llm-trainer\ndescription: 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. Includes guidance on the TRL Jobs package, UV scripts with PEP 723 format, dataset preparation and validation, hardware selection, cost estimation, Trackio monitoring, Hub authentication, model selection\u002Fleaderboards and model persistence. Use for tasks involving cloud GPU training, GGUF conversion, or when users mention training on Hugging Face Jobs without local GPU setup.\nlicense: Complete terms in LICENSE.txt\n---\n\n# TRL Training on Hugging Face Jobs\n\n## Overview\n\nTrain language models using TRL (Transformer Reinforcement Learning) on fully managed Hugging Face infrastructure. No local GPU setup required—models train on cloud GPUs and results are automatically saved to the Hugging Face Hub.\n\n**TRL provides multiple training methods:**\n- **SFT** (Supervised Fine-Tuning) - Standard instruction tuning\n- **DPO** (Direct Preference Optimization) - Alignment from preference data\n- **GRPO** (Group Relative Policy Optimization) - Online RL training\n- **Reward Modeling** - Train reward models for RLHF\n\n**For detailed TRL method documentation:**\n```python\nhf_doc_search(\"your query\", product=\"trl\")\nhf_doc_fetch(\"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftrl\u002Fsft_trainer\")  # SFT\nhf_doc_fetch(\"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftrl\u002Fdpo_trainer\")  # DPO\n# etc.\n```\n\n**See also:** `references\u002Ftraining_methods.md` for method overviews and selection guidance\n\n## When to Use This Skill\n\nUse this skill when users want to:\n- Fine-tune language models on cloud GPUs without local infrastructure\n- Train with TRL methods (SFT, DPO, GRPO, etc.)\n- Run training jobs on Hugging Face Jobs infrastructure\n- Convert trained models to GGUF for local deployment (Ollama, LM Studio, llama.cpp)\n- Ensure trained models are permanently saved to the Hub\n- Use modern workflows with optimized defaults\n\n### When to Use Unsloth\n\nUse **Unsloth** (`references\u002Funsloth.md`) instead of standard TRL when:\n- **Limited GPU memory** - Unsloth uses ~60% less VRAM\n- **Speed matters** - Unsloth is ~2x faster\n- Training **large models (>13B)** - memory efficiency is critical\n- Training **Vision-Language Models (VLMs)** - Unsloth has `FastVisionModel` support\n\nSee `references\u002Funsloth.md` for complete Unsloth documentation and `scripts\u002Funsloth_sft_example.py` for a production-ready training script.\n\n## Key Directives\n\nWhen assisting with training jobs:\n\n1. **ALWAYS use `hf_jobs()` MCP tool** - Submit jobs using `hf_jobs(\"uv\", {...})`, NOT bash `trl-jobs` commands. The `script` parameter accepts Python code directly. Do NOT save to local files unless the user explicitly requests it. Pass the script content as a string to `hf_jobs()`. If user asks to \"train a model\", \"fine-tune\", or similar requests, you MUST create the training script AND submit the job immediately using `hf_jobs()`.\n\n2. **Always include Trackio** - Every training script should include Trackio for real-time monitoring. Use example scripts in `scripts\u002F` as templates.\n\n3. **Provide job details after submission** - After submitting, provide job ID, monitoring URL, estimated time, and note that the user can request status checks later.\n\n4. **Use example scripts as templates** - Reference `scripts\u002Ftrain_sft_example.py`, `scripts\u002Ftrain_dpo_example.py`, etc. as starting points.\n\n## Local Script Execution\n\nRepository scripts use PEP 723 inline dependencies. Run them with `uv run`:\n```bash\nuv run scripts\u002Festimate_cost.py --help\nuv run scripts\u002Fdataset_inspector.py --help\n```\n\n## Prerequisites Checklist\n\nBefore starting any training job, verify:\n\n### ✅ **Account & Authentication**\n- Hugging Face Account with [Pro](https:\u002F\u002Fhf.co\u002Fpro), [Team](https:\u002F\u002Fhf.co\u002Fenterprise), or [Enterprise](https:\u002F\u002Fhf.co\u002Fenterprise) plan (Jobs require paid plan)\n- Authenticated login: Check with `hf_whoami()`\n- **HF_TOKEN for Hub Push** ⚠️ CRITICAL - Training environment is ephemeral, must push to Hub or ALL training results are lost\n- Token must have write permissions  \n- **MUST pass `secrets={\"HF_TOKEN\": \"$HF_TOKEN\"}` in job config** to make token available (the `$HF_TOKEN` syntax\n  references your actual token value)\n\n### ✅ **Dataset Requirements**\n- Dataset must exist on Hub or be loadable via `datasets.load_dataset()`\n- Format must match training method (SFT: \"messages\"\u002Ftext\u002Fprompt-completion; DPO: chosen\u002Frejected; GRPO: prompt-only)\n- **ALWAYS validate unknown datasets** before GPU training to prevent format failures (see Dataset Validation section below)\n- Size appropriate for hardware (Demo: 50-100 examples on t4-small; Production: 1K-10K+ on a10g-large\u002Fa100-large)\n\n### ⚠️ **Critical Settings**\n- **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.\n- **Hub push must be enabled** - Config: `push_to_hub=True`, `hub_model_id=\"username\u002Fmodel-name\"`; Job: `secrets={\"HF_TOKEN\": \"$HF_TOKEN\"}`\n\n## Asynchronous Job Guidelines\n\n**⚠️ IMPORTANT: Training jobs run asynchronously and can take hours**\n\n### Action Required\n\n**When user requests training:**\n1. **Create the training script** with Trackio included (use `scripts\u002Ftrain_sft_example.py` as template)\n2. **Submit immediately** using `hf_jobs()` MCP tool with script content inline - don't save to file unless user requests\n3. **Report submission** with job ID, monitoring URL, and estimated time\n4. **Wait for user** to request status checks - don't poll automatically\n\n### Ground Rules\n- **Jobs run in background** - Submission returns immediately; training continues independently\n- **Initial logs delayed** - Can take 30-60 seconds for logs to appear\n- **User checks status** - Wait for user to request status updates\n- **Avoid polling** - Check logs only on user request; provide monitoring links instead\n\n### After Submission\n\n**Provide to user:**\n- ✅ Job ID and monitoring URL\n- ✅ Expected completion time\n- ✅ Trackio dashboard URL\n- ✅ Note that user can request status checks later\n\n**Example Response:**\n```\n✅ Job submitted successfully!\n\nJob ID: abc123xyz\nMonitor: https:\u002F\u002Fhuggingface.co\u002Fjobs\u002Fusername\u002Fabc123xyz\n\nExpected time: ~2 hours\nEstimated cost: ~$10\n\nThe job is running in the background. Ask me to check status\u002Flogs when ready!\n```\n\n## Quick Start: Three Approaches\n\n**💡 Tip for Demos:** For quick demos on smaller GPUs (t4-small), omit `eval_dataset` and `eval_strategy` to save ~40% memory. You'll still see training loss and learning progress.\n\n### Sequence Length Configuration\n\n**TRL config classes use `max_length` (not `max_seq_length`)** to control tokenized sequence length:\n\n```python\n# ✅ CORRECT - If you need to set sequence length\nSFTConfig(max_length=512)   # Truncate sequences to 512 tokens\nDPOConfig(max_length=2048)  # Longer context (2048 tokens)\n\n# ❌ WRONG - This parameter doesn't exist\nSFTConfig(max_seq_length=512)  # TypeError!\n```\n\n**Default behavior:** `max_length=1024` (truncates from right). This works well for most training.\n\n**When to override:**\n- **Longer context**: Set higher (e.g., `max_length=2048`)\n- **Memory constraints**: Set lower (e.g., `max_length=512`)\n- **Vision models**: Set `max_length=None` (prevents cutting image tokens)\n\n**Usually you don't need to set this parameter at all** - the examples below use the sensible default.\n\n### Approach 1: UV Scripts (Recommended—Default Choice)\n\nUV scripts use PEP 723 inline dependencies for clean, self-contained training. **This is the primary approach for Claude Code.**\n\n```python\nhf_jobs(\"uv\", {\n    \"script\": \"\"\"\n# \u002F\u002F\u002F script\n# dependencies = [\"trl>=0.12.0\", \"peft>=0.7.0\", \"trackio\"]\n# \u002F\u002F\u002F\n\nfrom datasets import load_dataset\nfrom peft import LoraConfig\nfrom trl import SFTTrainer, SFTConfig\nimport trackio\n\ndataset = load_dataset(\"trl-lib\u002FCapybara\", split=\"train\")\n\n# Create train\u002Feval split for monitoring\ndataset_split = dataset.train_test_split(test_size=0.1, seed=42)\n\ntrainer = SFTTrainer(\n    model=\"Qwen\u002FQwen2.5-0.5B\",\n    train_dataset=dataset_split[\"train\"],\n    eval_dataset=dataset_split[\"test\"],\n    peft_config=LoraConfig(r=16, lora_alpha=32),\n    args=SFTConfig(\n        output_dir=\"my-model\",\n        push_to_hub=True,\n        hub_model_id=\"username\u002Fmy-model\",\n        num_train_epochs=3,\n        eval_strategy=\"steps\",\n        eval_steps=50,\n        report_to=\"trackio\",\n        project=\"meaningful_prject_name\", # project name for the training name (trackio)\n        run_name=\"meaningful_run_name\",   # descriptive name for the specific training run (trackio)\n    )\n)\n\ntrainer.train()\ntrainer.push_to_hub()\n\"\"\",\n    \"flavor\": \"a10g-large\",\n    \"timeout\": \"2h\",\n    \"secrets\": {\"HF_TOKEN\": \"$HF_TOKEN\"}\n})\n```\n\n**Benefits:** Direct MCP tool usage, clean code, dependencies declared inline (PEP 723), no file saving required, full control\n**When to use:** Default choice for all training tasks in Claude Code, custom training logic, any scenario requiring `hf_jobs()`\n\n#### Working with Scripts\n\n⚠️ **Important:** The `script` parameter accepts either inline code (as shown above) OR a URL. **Local file paths do NOT work.**\n\n**Why local paths don't work:**\nJobs run in isolated Docker containers without access to your local filesystem. Scripts must be:\n- Inline code (recommended for custom training)\n- Publicly accessible URLs\n- Private repo URLs (with HF_TOKEN)\n\n**Common mistakes:**\n```python\n# ❌ These will all fail\nhf_jobs(\"uv\", {\"script\": \"train.py\"})\nhf_jobs(\"uv\", {\"script\": \".\u002Fscripts\u002Ftrain.py\"})\nhf_jobs(\"uv\", {\"script\": \"\u002Fpath\u002Fto\u002Ftrain.py\"})\n```\n\n**Correct approaches:**\n```python\n# ✅ Inline code (recommended)\nhf_jobs(\"uv\", {\"script\": \"# \u002F\u002F\u002F script\\n# dependencies = [...]\\n# \u002F\u002F\u002F\\n\\n\u003Cyour code>\"})\n\n# ✅ From Hugging Face Hub\nhf_jobs(\"uv\", {\"script\": \"https:\u002F\u002Fhuggingface.co\u002Fuser\u002Frepo\u002Fresolve\u002Fmain\u002Ftrain.py\"})\n\n# ✅ From GitHub\nhf_jobs(\"uv\", {\"script\": \"https:\u002F\u002Fraw.githubusercontent.com\u002Fuser\u002Frepo\u002Fmain\u002Ftrain.py\"})\n\n# ✅ From Gist\nhf_jobs(\"uv\", {\"script\": \"https:\u002F\u002Fgist.githubusercontent.com\u002Fuser\u002Fid\u002Fraw\u002Ftrain.py\"})\n```\n\n**To use local scripts:** Upload to HF Hub first:\n```bash\nhf repos create my-training-scripts --type model\nhf upload my-training-scripts .\u002Ftrain.py train.py\n# Use: https:\u002F\u002Fhuggingface.co\u002FUSERNAME\u002Fmy-training-scripts\u002Fresolve\u002Fmain\u002Ftrain.py\n```\n\n### Approach 2: TRL Maintained Scripts (Official Examples)\n\nTRL provides battle-tested scripts for all methods. Can be run from URLs:\n\n```python\nhf_jobs(\"uv\", {\n    \"script\": \"https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftrl\u002Fblob\u002Fmain\u002Ftrl\u002Fscripts\u002Fsft.py\",\n    \"script_args\": [\n        \"--model_name_or_path\", \"Qwen\u002FQwen2.5-0.5B\",\n        \"--dataset_name\", \"trl-lib\u002FCapybara\",\n        \"--output_dir\", \"my-model\",\n        \"--push_to_hub\",\n        \"--hub_model_id\", \"username\u002Fmy-model\"\n    ],\n    \"flavor\": \"a10g-large\",\n    \"timeout\": \"2h\",\n    \"secrets\": {\"HF_TOKEN\": \"$HF_TOKEN\"}\n})\n```\n\n**Benefits:** No code to write, maintained by TRL team, production-tested\n**When to use:** Standard TRL training, quick experiments, don't need custom code\n**Available:** Scripts are available from https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftrl\u002Ftree\u002Fmain\u002Fexamples\u002Fscripts\n\n### Finding More UV Scripts on Hub\n\nThe `uv-scripts` organization provides ready-to-use UV scripts stored as datasets on Hugging Face Hub:\n\n```python\n# Discover available UV script collections\ndataset_search({\"author\": \"uv-scripts\", \"sort\": \"downloads\", \"limit\": 20})\n\n# Explore a specific collection\nhub_repo_details([\"uv-scripts\u002Fclassification\"], repo_type=\"dataset\", include_readme=True)\n```\n\n**Popular collections:** ocr, classification, synthetic-data, vllm, dataset-creation\n\n### Approach 3: HF Jobs CLI (Direct Terminal Commands)\n\nWhen the `hf_jobs()` MCP tool is unavailable, use the `hf jobs` CLI directly.\n\n**⚠️ CRITICAL: CLI Syntax Rules**\n\n```bash\n# ✅ CORRECT syntax - flags BEFORE script URL\nhf jobs uv run --flavor a10g-large --timeout 2h --secrets HF_TOKEN \"https:\u002F\u002Fexample.com\u002Ftrain.py\"\n\n# ❌ WRONG - \"run uv\" instead of \"uv run\"\nhf jobs run uv \"https:\u002F\u002Fexample.com\u002Ftrain.py\" --flavor a10g-large\n\n# ❌ WRONG - flags AFTER script URL (will be ignored!)\nhf jobs uv run \"https:\u002F\u002Fexample.com\u002Ftrain.py\" --flavor a10g-large\n\n# ❌ WRONG - \"--secret\" instead of \"--secrets\" (plural)\nhf jobs uv run --secret HF_TOKEN \"https:\u002F\u002Fexample.com\u002Ftrain.py\"\n```\n\n**Key syntax rules:**\n1. Command order is `hf jobs uv run` (NOT `hf jobs run uv`)\n2. All flags (`--flavor`, `--timeout`, `--secrets`) must come BEFORE the script URL\n3. Use `--secrets` (plural), not `--secret`\n4. Script URL must be the last positional argument\n\n**Complete CLI example:**\n```bash\nhf jobs uv run \\\n  --flavor a10g-large \\\n  --timeout 2h \\\n  --secrets HF_TOKEN \\\n  \"https:\u002F\u002Fhuggingface.co\u002Fuser\u002Frepo\u002Fresolve\u002Fmain\u002Ftrain.py\"\n```\n\n**Check job status via CLI:**\n```bash\nhf jobs ps                        # List all jobs\nhf jobs logs \u003Cjob-id>             # View logs\nhf jobs inspect \u003Cjob-id>          # Job details\nhf jobs cancel \u003Cjob-id>           # Cancel a job\n```\n\n### Approach 4: TRL Jobs Package (Simplified Training)\n\nThe `trl-jobs` package provides optimized defaults and one-liner training.\n\n```bash\nuvx trl-jobs sft \\\n  --model_name Qwen\u002FQwen2.5-0.5B \\\n  --dataset_name trl-lib\u002FCapybara\n\n```\n\n**Benefits:** Pre-configured settings, automatic Trackio integration, automatic Hub push, one-line commands\n**When to use:** User working in terminal directly (not Claude Code context), quick local experimentation\n**Repository:** https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftrl-jobs\n\n⚠️ **In Claude Code context, prefer using `hf_jobs()` MCP tool (Approach 1) when available.**\n\n## Hardware Selection\n\n| Model Size | Recommended Hardware | Cost (approx\u002Fhr) | Use Case |\n|------------|---------------------|------------------|----------|\n| \u003C1B params | `t4-small` | ~$0.75 | Demos, quick tests only without eval steps |\n| 1-3B params | `t4-medium`, `l4x1` | ~$1.50-2.50 | Development |\n| 3-7B params | `a10g-small`, `a10g-large` | ~$3.50-5.00 | Production training |\n| 7-13B params | `a10g-large`, `a100-large` | ~$5-10 | Large models (use LoRA) |\n| 13B+ params | `a100-large`, `a10g-largex2` | ~$10-20 | Very large (use LoRA) |\n\n**GPU Flavors:** cpu-basic\u002Fupgrade\u002Fperformance\u002Fxl, t4-small\u002Fmedium, l4x1\u002Fx4, a10g-small\u002Flarge\u002Flargex2\u002Flargex4, a100-large, h100\u002Fh100x8\n\n**Guidelines:**\n- Use **LoRA\u002FPEFT** for models >7B to reduce memory\n- Multi-GPU automatically handled by TRL\u002FAccelerate\n- Start with smaller hardware for testing\n\n**See:** `references\u002Fhardware_guide.md` for detailed specifications\n\n## Critical: Saving Results to Hub\n\n**⚠️ EPHEMERAL ENVIRONMENT—MUST PUSH TO HUB**\n\nThe Jobs environment is temporary. All files are deleted when the job ends. If the model isn't pushed to Hub, **ALL TRAINING IS LOST**.\n\n### Required Configuration\n\n**In training script\u002Fconfig:**\n```python\nSFTConfig(\n    push_to_hub=True,\n    hub_model_id=\"username\u002Fmodel-name\",  # MUST specify\n    hub_strategy=\"every_save\",  # Optional: push checkpoints\n)\n```\n\n**In job submission:**\n```python\n{\n    \"secrets\": {\"HF_TOKEN\": \"$HF_TOKEN\"}  # Enables authentication\n}\n```\n\n### Verification Checklist\n\nBefore submitting:\n- [ ] `push_to_hub=True` set in config\n- [ ] `hub_model_id` includes username\u002Frepo-name\n- [ ] `secrets` parameter includes HF_TOKEN\n- [ ] User has write access to target repo\n\n**See:** `references\u002Fhub_saving.md` for detailed troubleshooting\n\n## Timeout Management\n\n**⚠️ DEFAULT: 30 MINUTES—TOO SHORT FOR TRAINING**\n\n### Setting Timeouts\n\n```python\n{\n    \"timeout\": \"2h\"   # 2 hours (formats: \"90m\", \"2h\", \"1.5h\", or seconds as integer)\n}\n```\n\n### Timeout Guidelines\n\n| Scenario | Recommended | Notes |\n|----------|-------------|-------|\n| Quick demo (50-100 examples) | 10-30 min | Verify setup |\n| Development training | 1-2 hours | Small datasets |\n| Production (3-7B model) | 4-6 hours | Full datasets |\n| Large model with LoRA | 3-6 hours | Depends on dataset |\n\n**Always add 20-30% buffer** for model\u002Fdataset loading, checkpoint saving, Hub push operations, and network delays.\n\n**On timeout:** Job killed immediately, all unsaved progress lost, must restart from beginning\n\n## Choose a Base Model (Model Selection)\n\n**Identify models to train based on task type or benchmark results.**\n\nUse `scripts\u002Fhf_benchmarks.py` to identify top-performing models for specific tasks. This helps the user select a model as the base for training, whilst keeping size and hardware constraints in mind.\n\n```bash\n# Get help on the benchmarks command:\nuv run scripts\u002Fhf_benchmarks.py --help\n```\n\n### Example -- choosing an OCR base model\n```bash\n# Search for benchmarks containing whose name contains the text `ocr`\nuv run scripts\u002Fhf_benchmarks.py search --query ocr\n\n# Get the ranked leaderboard for the allenai\u002FolmOCR-bench benchmark \nuv run scripts\u002Fhf_benchmarks.py leaderboard allenai\u002FolmOCR-bench\n```\n\n## Cost Estimation\n\n**Offer to estimate cost when planning jobs with known parameters.** Use `scripts\u002Festimate_cost.py`:\n\n```bash\nuv run scripts\u002Festimate_cost.py \\\n  --model meta-llama\u002FLlama-2-7b-hf \\\n  --dataset trl-lib\u002FCapybara \\\n  --hardware a10g-large \\\n  --dataset-size 16000 \\\n  --epochs 3\n```\n\nOutput includes estimated time, cost, recommended timeout (with buffer), and optimization suggestions.\n\n**When to offer:** User planning a job, asks about cost\u002Ftime, choosing hardware, job will run >1 hour or cost >$5\n\n## Example Training Scripts\n\n**Production-ready templates with all best practices:**\n\nLoad these scripts for correctly:\n\n- **`scripts\u002Ftrain_sft_example.py`** - Complete SFT training with Trackio, LoRA, checkpoints\n- **`scripts\u002Ftrain_dpo_example.py`** - DPO training for preference learning\n- **`scripts\u002Ftrain_grpo_example.py`** - GRPO training for online RL\n\nThese 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.\n\n## Monitoring and Tracking\n\n**Trackio** provides real-time metrics visualization. See `references\u002Ftrackio_guide.md` for complete setup guide.\n\n**Key points:**\n- Add `trackio` to dependencies\n- Configure trainer with `report_to=\"trackio\" and run_name=\"meaningful_name\"`\n\n### Trackio Configuration Defaults\n\n**Use sensible defaults unless user specifies otherwise.** When generating training scripts with Trackio:\n\n**Default Configuration:**\n- **Space ID**: `{username}\u002Ftrackio` (use \"trackio\" as default space name)\n- **Run naming**: Unless otherwise specified, name the run in a way the user will recognize (e.g., descriptive of the task, model, or purpose)\n- **Config**: Keep minimal - only include hyperparameters and model\u002Fdataset info\n- **Project Name**: Use a Project Name to associate runs with a particular Project \n\n**User overrides:** If user requests specific trackio configuration (custom space, run naming, grouping, or additional config), apply their preferences instead of defaults.\n\n\nThis is useful for managing multiple jobs with the same configuration or keeping training scripts portable.\n\nSee `references\u002Ftrackio_guide.md` for complete documentation including grouping runs for experiments.\n\n### Check Job Status\n\n```python\n# List all jobs\nhf_jobs(\"ps\")\n\n# Inspect specific job\nhf_jobs(\"inspect\", {\"job_id\": \"your-job-id\"})\n\n# View logs\nhf_jobs(\"logs\", {\"job_id\": \"your-job-id\"})\n```\n\n**Remember:** Wait for user to request status checks. Avoid polling repeatedly.\n\n## Dataset Validation\n\n**Validate dataset format BEFORE launching GPU training to prevent the #1 cause of training failures: format mismatches.**\n\n### Why Validate\n\n- 50%+ of training failures are due to dataset format issues\n- DPO especially strict: requires exact column names (`prompt`, `chosen`, `rejected`)\n- Failed GPU jobs waste $1-10 and 30-60 minutes\n- Validation on CPU costs ~$0.01 and takes \u003C1 minute\n\n### When to Validate\n\n**ALWAYS validate for:**\n- Unknown or custom datasets\n- DPO training (CRITICAL - 90% of datasets need mapping)\n- Any dataset not explicitly TRL-compatible\n\n**Skip validation for known TRL datasets:**\n- `trl-lib\u002Fultrachat_200k`, `trl-lib\u002FCapybara`, `HuggingFaceH4\u002Fultrachat_200k`, etc.\n\n### Usage\n\n```python\nhf_jobs(\"uv\", {\n    \"script\": \"https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fmcp-tools\u002Fskills\u002Fraw\u002Fmain\u002Fdataset_inspector.py\",\n    \"script_args\": [\"--dataset\", \"username\u002Fdataset-name\", \"--split\", \"train\"]\n})\n```\n\nThe script is fast, and will usually complete synchronously.\n\n### Reading Results\n\nThe output shows compatibility for each training method:\n\n- **`✓ READY`** - Dataset is compatible, use directly\n- **`✗ NEEDS MAPPING`** - Compatible but needs preprocessing (mapping code provided)\n- **`✗ INCOMPATIBLE`** - Cannot be used for this method\n\nWhen mapping is needed, the output includes a **\"MAPPING CODE\"** section with copy-paste ready Python code.\n\n### Example Workflow\n\n```python\n# 1. Inspect dataset (costs ~$0.01, \u003C1 min on CPU)\nhf_jobs(\"uv\", {\n    \"script\": \"https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fmcp-tools\u002Fskills\u002Fraw\u002Fmain\u002Fdataset_inspector.py\",\n    \"script_args\": [\"--dataset\", \"argilla\u002Fdistilabel-math-preference-dpo\", \"--split\", \"train\"]\n})\n\n# 2. Check output markers:\n#    ✓ READY → proceed with training\n#    ✗ NEEDS MAPPING → apply mapping code below\n#    ✗ INCOMPATIBLE → choose different method\u002Fdataset\n\n# 3. If mapping needed, apply before training:\ndef format_for_dpo(example):\n    return {\n        'prompt': example['instruction'],\n        'chosen': example['chosen_response'],\n        'rejected': example['rejected_response'],\n    }\ndataset = dataset.map(format_for_dpo, remove_columns=dataset.column_names)\n\n# 4. Launch training job with confidence\n```\n\n### Common Scenario: DPO Format Mismatch\n\nMost DPO datasets use non-standard column names. Example:\n\n```\nDataset has: instruction, chosen_response, rejected_response\nDPO expects: prompt, chosen, rejected\n```\n\nThe validator detects this and provides exact mapping code to fix it.\n\n## Converting Models to GGUF\n\nAfter training, convert models to **GGUF format** for use with llama.cpp, Ollama, LM Studio, and other local inference tools.\n\n**What is GGUF:**\n- Optimized for CPU\u002FGPU inference with llama.cpp\n- Supports quantization (4-bit, 5-bit, 8-bit) to reduce model size\n- Compatible with Ollama, LM Studio, Jan, GPT4All, llama.cpp\n- Typically 2-8GB for 7B models (vs 14GB unquantized)\n\n**When to convert:**\n- Running models locally with Ollama or LM Studio\n- Reducing model size with quantization\n- Deploying to edge devices\n- Sharing models for local-first use\n\n**See:** `references\u002Fgguf_conversion.md` for complete conversion guide, including production-ready conversion script, quantization options, hardware requirements, usage examples, and troubleshooting.\n\n**Quick conversion:**\n```python\nhf_jobs(\"uv\", {\n    \"script\": \"\u003Csee references\u002Fgguf_conversion.md for complete script>\",\n    \"flavor\": \"a10g-large\",\n    \"timeout\": \"45m\",\n    \"secrets\": {\"HF_TOKEN\": \"$HF_TOKEN\"},\n    \"env\": {\n        \"ADAPTER_MODEL\": \"username\u002Fmy-finetuned-model\",\n        \"BASE_MODEL\": \"Qwen\u002FQwen2.5-0.5B\",\n        \"OUTPUT_REPO\": \"username\u002Fmy-model-gguf\"\n    }\n})\n```\n\n## Common Training Patterns\n\nSee `references\u002Ftraining_patterns.md` for detailed examples including:\n- Quick demo (5-10 minutes)\n- Production with checkpoints\n- Multi-GPU training\n- DPO training (preference learning)\n- GRPO training (online RL)\n\n## Common Failure Modes\n\n### Out of Memory (OOM)\n\n**Fix (try in order):**\n1. Reduce batch size: `per_device_train_batch_size=1`, increase `gradient_accumulation_steps=8`. Effective batch size is `per_device_train_batch_size` x `gradient_accumulation_steps`. For best performance keep effective batch size close to 128. \n2. Enable: `gradient_checkpointing=True`\n3. Upgrade hardware: t4-small → l4x1, a10g-small → a10g-large etc. \n\n### Dataset Misformatted\n\n**Fix:**\n1. Validate first with dataset inspector:\n   ```bash\n   uv run https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fmcp-tools\u002Fskills\u002Fraw\u002Fmain\u002Fdataset_inspector.py \\\n     --dataset name --split train\n   ```\n2. Check output for compatibility markers (✓ READY, ✗ NEEDS MAPPING, ✗ INCOMPATIBLE)\n3. Apply mapping code from inspector output if needed\n\n### Job Timeout\n\n**Fix:**\n1. Check logs for actual runtime: `hf_jobs(\"logs\", {\"job_id\": \"...\"})`\n2. Increase timeout with buffer: `\"timeout\": \"3h\"` (add 30% to estimated time)\n3. Or reduce training: lower `num_train_epochs`, use smaller dataset, enable `max_steps`\n4. Save checkpoints: `save_strategy=\"steps\"`, `save_steps=500`, `hub_strategy=\"every_save\"`\n\n**Note:** Default 30min is insufficient for real training. Minimum 1-2 hours.\n\n### Hub Push Failures\n\n**Fix:**\n1. Add to job: `secrets={\"HF_TOKEN\": \"$HF_TOKEN\"}`\n2. Add to config: `push_to_hub=True`, `hub_model_id=\"username\u002Fmodel-name\"`\n3. Verify auth: `mcp__huggingface__hf_whoami()`\n4. Check token has write permissions and repo exists (or set `hub_private_repo=True`)\n\n### Missing Dependencies\n\n**Fix:**\nAdd to PEP 723 header:\n```python\n# \u002F\u002F\u002F script\n# dependencies = [\"trl>=0.12.0\", \"peft>=0.7.0\", \"trackio\", \"missing-package\"]\n# \u002F\u002F\u002F\n```\n\n## Troubleshooting\n\n**Common issues:**\n- Job times out → Increase timeout, reduce epochs\u002Fdataset, use smaller model\u002FLoRA\n- Model not saved to Hub → Check push_to_hub=True, hub_model_id, secrets=HF_TOKEN\n- Out of Memory (OOM) → Reduce batch size, increase gradient accumulation, enable LoRA, use larger GPU\n- Dataset format error → Validate with dataset inspector (see Dataset Validation section)\n- Import\u002Fmodule errors → Add PEP 723 header with dependencies, verify format\n- Authentication errors → Check `mcp__huggingface__hf_whoami()`, token permissions, secrets parameter\n\n**See:** `references\u002Ftroubleshooting.md` for complete troubleshooting guide\n\n## Resources\n\n### References (In This Skill)\n- `references\u002Ftraining_methods.md` - Overview of SFT, DPO, GRPO, KTO, PPO, Reward Modeling\n- `references\u002Ftraining_patterns.md` - Common training patterns and examples\n- `references\u002Funsloth.md` - Unsloth for fast VLM training (~2x speed, 60% less VRAM)\n- `references\u002Fgguf_conversion.md` - Complete GGUF conversion guide\n- `references\u002Ftrackio_guide.md` - Trackio monitoring setup\n- `references\u002Fhardware_guide.md` - Hardware specs and selection\n- `references\u002Fhub_saving.md` - Hub authentication troubleshooting\n- `references\u002Ftroubleshooting.md` - Common issues and solutions\n- `references\u002Flocal_training_macos.md` - Local training on macOS\n\n### Scripts (In This Skill)\n- `scripts\u002Ftrain_sft_example.py` - Production SFT template\n- `scripts\u002Ftrain_dpo_example.py` - Production DPO template\n- `scripts\u002Ftrain_grpo_example.py` - Production GRPO template\n- `scripts\u002Funsloth_sft_example.py` - Unsloth text LLM training template (faster, less VRAM)\n- `scripts\u002Festimate_cost.py` - Estimate time and cost (offer when appropriate)\n- `scripts\u002Fconvert_to_gguf.py` - Complete GGUF conversion script\n- `scripts\u002Fhf_benchmarks.py` - Search for benchmark results and leaderboards by task, alias or free text.\n\n### External Scripts\n- [Dataset Inspector](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fmcp-tools\u002Fskills\u002Fraw\u002Fmain\u002Fdataset_inspector.py) - Validate dataset format before training (use via `uv run` or `hf_jobs`)\n\n### External Links\n- [TRL Documentation](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftrl)\n- [TRL Jobs Training Guide](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftrl\u002Fen\u002Fjobs_training)\n- [TRL Jobs Package](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftrl-jobs)\n- [HF Jobs Documentation](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Fhuggingface_hub\u002Fguides\u002Fjobs)\n- [TRL Example Scripts](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftrl\u002Ftree\u002Fmain\u002Fexamples\u002Fscripts)\n- [UV Scripts Guide](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002Fguides\u002Fscripts\u002F)\n- [UV Scripts Organization](https:\u002F\u002Fhuggingface.co\u002Fuv-scripts)\n\n## Key Takeaways\n\n1. **Submit scripts inline** - The `script` parameter accepts Python code directly; no file saving required unless user requests\n2. **Jobs are asynchronous** - Don't wait\u002Fpoll; let user check when ready\n3. **Always set timeout** - Default 30 min is insufficient; minimum 1-2 hours recommended\n4. **Always enable Hub push** - Environment is ephemeral; without push, all results lost\n5. **Include Trackio** - Use example scripts as templates for real-time monitoring\n6. **Offer cost estimation** - When parameters are known, use `scripts\u002Festimate_cost.py`\n7. **Use UV scripts (Approach 1)** - Default to `hf_jobs(\"uv\", {...})` with inline scripts; TRL maintained scripts for standard training; avoid bash `trl-jobs` commands in Claude Code\n8. **Use hf_doc_fetch\u002Fhf_doc_search** for latest TRL documentation\n9. **Validate dataset format** before training with dataset inspector (see Dataset Validation section)\n10. **Choose appropriate hardware** for model size; use LoRA for models >7B\n",{"data":39,"body":40},{"name":4,"description":6,"license":30},{"type":41,"children":42},"root",[43,52,59,65,74,119,127,176,194,200,205,238,245,265,319,339,345,350,464,470,483,537,543,548,559,646,656,690,701,744,750,758,764,772,829,835,878,884,892,915,923,933,939,965,971,997,1055,1072,1080,1135,1145,1151,1161,1535,1557,1564,1587,1597,1615,1623,1662,1670,1762,1772,1847,1853,1858,1964,1992,1998,2011,2057,2067,2073,2093,2101,2348,2356,2428,2436,2533,2541,2684,2690,2701,2760,2787,2803,2809,3008,3018,3026,3050,3067,3073,3081,3092,3098,3106,3152,3160,3191,3197,3202,3266,3282,3288,3296,3302,3331,3337,3436,3446,3456,3462,3470,3482,3517,3523,3608,3614,3631,3738,3743,3753,3759,3767,3772,3815,3827,3833,3851,3859,3886,3892,3902,3910,3961,3971,3976,3987,3993,4062,4072,4078,4086,4092,4136,4142,4150,4168,4176,4204,4210,4247,4252,4258,4263,4308,4320,4326,4495,4501,4506,4515,4520,4526,4538,4546,4569,4577,4600,4616,4624,4715,4721,4733,4761,4767,4773,4781,4837,4843,4851,4918,4924,4931,5002,5012,5018,5025,5077,5083,5092,5129,5135,5143,5183,5199,5205,5211,5305,5311,5385,5391,5420,5426,5497,5503,5632],{"type":44,"tag":45,"props":46,"children":48},"element","h1",{"id":47},"trl-training-on-hugging-face-jobs",[49],{"type":50,"value":51},"text","TRL Training on Hugging Face Jobs",{"type":44,"tag":53,"props":54,"children":56},"h2",{"id":55},"overview",[57],{"type":50,"value":58},"Overview",{"type":44,"tag":60,"props":61,"children":62},"p",{},[63],{"type":50,"value":64},"Train language models using TRL (Transformer Reinforcement Learning) on fully managed Hugging Face infrastructure. No local GPU setup required—models train on cloud GPUs and results are automatically saved to the Hugging Face Hub.",{"type":44,"tag":60,"props":66,"children":67},{},[68],{"type":44,"tag":69,"props":70,"children":71},"strong",{},[72],{"type":50,"value":73},"TRL provides multiple training methods:",{"type":44,"tag":75,"props":76,"children":77},"ul",{},[78,89,99,109],{"type":44,"tag":79,"props":80,"children":81},"li",{},[82,87],{"type":44,"tag":69,"props":83,"children":84},{},[85],{"type":50,"value":86},"SFT",{"type":50,"value":88}," (Supervised Fine-Tuning) - Standard instruction tuning",{"type":44,"tag":79,"props":90,"children":91},{},[92,97],{"type":44,"tag":69,"props":93,"children":94},{},[95],{"type":50,"value":96},"DPO",{"type":50,"value":98}," (Direct Preference Optimization) - Alignment from preference data",{"type":44,"tag":79,"props":100,"children":101},{},[102,107],{"type":44,"tag":69,"props":103,"children":104},{},[105],{"type":50,"value":106},"GRPO",{"type":50,"value":108}," (Group Relative Policy Optimization) - Online RL training",{"type":44,"tag":79,"props":110,"children":111},{},[112,117],{"type":44,"tag":69,"props":113,"children":114},{},[115],{"type":50,"value":116},"Reward Modeling",{"type":50,"value":118}," - Train reward models for RLHF",{"type":44,"tag":60,"props":120,"children":121},{},[122],{"type":44,"tag":69,"props":123,"children":124},{},[125],{"type":50,"value":126},"For detailed TRL method documentation:",{"type":44,"tag":128,"props":129,"children":133},"pre",{"className":130,"code":131,"language":23,"meta":132,"style":132},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","hf_doc_search(\"your query\", product=\"trl\")\nhf_doc_fetch(\"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftrl\u002Fsft_trainer\")  # SFT\nhf_doc_fetch(\"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftrl\u002Fdpo_trainer\")  # DPO\n# etc.\n","",[134],{"type":44,"tag":135,"props":136,"children":137},"code",{"__ignoreMap":132},[138,149,158,167],{"type":44,"tag":139,"props":140,"children":143},"span",{"class":141,"line":142},"line",1,[144],{"type":44,"tag":139,"props":145,"children":146},{},[147],{"type":50,"value":148},"hf_doc_search(\"your query\", product=\"trl\")\n",{"type":44,"tag":139,"props":150,"children":152},{"class":141,"line":151},2,[153],{"type":44,"tag":139,"props":154,"children":155},{},[156],{"type":50,"value":157},"hf_doc_fetch(\"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftrl\u002Fsft_trainer\")  # SFT\n",{"type":44,"tag":139,"props":159,"children":161},{"class":141,"line":160},3,[162],{"type":44,"tag":139,"props":163,"children":164},{},[165],{"type":50,"value":166},"hf_doc_fetch(\"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftrl\u002Fdpo_trainer\")  # DPO\n",{"type":44,"tag":139,"props":168,"children":170},{"class":141,"line":169},4,[171],{"type":44,"tag":139,"props":172,"children":173},{},[174],{"type":50,"value":175},"# etc.\n",{"type":44,"tag":60,"props":177,"children":178},{},[179,184,186,192],{"type":44,"tag":69,"props":180,"children":181},{},[182],{"type":50,"value":183},"See also:",{"type":50,"value":185}," ",{"type":44,"tag":135,"props":187,"children":189},{"className":188},[],[190],{"type":50,"value":191},"references\u002Ftraining_methods.md",{"type":50,"value":193}," for method overviews and selection guidance",{"type":44,"tag":53,"props":195,"children":197},{"id":196},"when-to-use-this-skill",[198],{"type":50,"value":199},"When to Use This Skill",{"type":44,"tag":60,"props":201,"children":202},{},[203],{"type":50,"value":204},"Use this skill when users want to:",{"type":44,"tag":75,"props":206,"children":207},{},[208,213,218,223,228,233],{"type":44,"tag":79,"props":209,"children":210},{},[211],{"type":50,"value":212},"Fine-tune language models on cloud GPUs without local infrastructure",{"type":44,"tag":79,"props":214,"children":215},{},[216],{"type":50,"value":217},"Train with TRL methods (SFT, DPO, GRPO, etc.)",{"type":44,"tag":79,"props":219,"children":220},{},[221],{"type":50,"value":222},"Run training jobs on Hugging Face Jobs infrastructure",{"type":44,"tag":79,"props":224,"children":225},{},[226],{"type":50,"value":227},"Convert trained models to GGUF for local deployment (Ollama, LM Studio, llama.cpp)",{"type":44,"tag":79,"props":229,"children":230},{},[231],{"type":50,"value":232},"Ensure trained models are permanently saved to the Hub",{"type":44,"tag":79,"props":234,"children":235},{},[236],{"type":50,"value":237},"Use modern workflows with optimized defaults",{"type":44,"tag":239,"props":240,"children":242},"h3",{"id":241},"when-to-use-unsloth",[243],{"type":50,"value":244},"When to Use Unsloth",{"type":44,"tag":60,"props":246,"children":247},{},[248,250,255,257,263],{"type":50,"value":249},"Use ",{"type":44,"tag":69,"props":251,"children":252},{},[253],{"type":50,"value":254},"Unsloth",{"type":50,"value":256}," (",{"type":44,"tag":135,"props":258,"children":260},{"className":259},[],[261],{"type":50,"value":262},"references\u002Funsloth.md",{"type":50,"value":264},") instead of standard TRL when:",{"type":44,"tag":75,"props":266,"children":267},{},[268,278,288,300],{"type":44,"tag":79,"props":269,"children":270},{},[271,276],{"type":44,"tag":69,"props":272,"children":273},{},[274],{"type":50,"value":275},"Limited GPU memory",{"type":50,"value":277}," - Unsloth uses ~60% less VRAM",{"type":44,"tag":79,"props":279,"children":280},{},[281,286],{"type":44,"tag":69,"props":282,"children":283},{},[284],{"type":50,"value":285},"Speed matters",{"type":50,"value":287}," - Unsloth is ~2x faster",{"type":44,"tag":79,"props":289,"children":290},{},[291,293,298],{"type":50,"value":292},"Training ",{"type":44,"tag":69,"props":294,"children":295},{},[296],{"type":50,"value":297},"large models (>13B)",{"type":50,"value":299}," - memory efficiency is critical",{"type":44,"tag":79,"props":301,"children":302},{},[303,304,309,311,317],{"type":50,"value":292},{"type":44,"tag":69,"props":305,"children":306},{},[307],{"type":50,"value":308},"Vision-Language Models (VLMs)",{"type":50,"value":310}," - Unsloth has ",{"type":44,"tag":135,"props":312,"children":314},{"className":313},[],[315],{"type":50,"value":316},"FastVisionModel",{"type":50,"value":318}," support",{"type":44,"tag":60,"props":320,"children":321},{},[322,324,329,331,337],{"type":50,"value":323},"See ",{"type":44,"tag":135,"props":325,"children":327},{"className":326},[],[328],{"type":50,"value":262},{"type":50,"value":330}," for complete Unsloth documentation and ",{"type":44,"tag":135,"props":332,"children":334},{"className":333},[],[335],{"type":50,"value":336},"scripts\u002Funsloth_sft_example.py",{"type":50,"value":338}," for a production-ready training script.",{"type":44,"tag":53,"props":340,"children":342},{"id":341},"key-directives",[343],{"type":50,"value":344},"Key Directives",{"type":44,"tag":60,"props":346,"children":347},{},[348],{"type":50,"value":349},"When assisting with training jobs:",{"type":44,"tag":351,"props":352,"children":353},"ol",{},[354,410,428,438],{"type":44,"tag":79,"props":355,"children":356},{},[357,370,372,378,380,386,388,394,396,401,403,408],{"type":44,"tag":69,"props":358,"children":359},{},[360,362,368],{"type":50,"value":361},"ALWAYS use ",{"type":44,"tag":135,"props":363,"children":365},{"className":364},[],[366],{"type":50,"value":367},"hf_jobs()",{"type":50,"value":369}," MCP tool",{"type":50,"value":371}," - Submit jobs using ",{"type":44,"tag":135,"props":373,"children":375},{"className":374},[],[376],{"type":50,"value":377},"hf_jobs(\"uv\", {...})",{"type":50,"value":379},", NOT bash ",{"type":44,"tag":135,"props":381,"children":383},{"className":382},[],[384],{"type":50,"value":385},"trl-jobs",{"type":50,"value":387}," commands. The ",{"type":44,"tag":135,"props":389,"children":391},{"className":390},[],[392],{"type":50,"value":393},"script",{"type":50,"value":395}," parameter accepts Python code directly. Do NOT save to local files unless the user explicitly requests it. Pass the script content as a string to ",{"type":44,"tag":135,"props":397,"children":399},{"className":398},[],[400],{"type":50,"value":367},{"type":50,"value":402},". If user asks to \"train a model\", \"fine-tune\", or similar requests, you MUST create the training script AND submit the job immediately using ",{"type":44,"tag":135,"props":404,"children":406},{"className":405},[],[407],{"type":50,"value":367},{"type":50,"value":409},".",{"type":44,"tag":79,"props":411,"children":412},{},[413,418,420,426],{"type":44,"tag":69,"props":414,"children":415},{},[416],{"type":50,"value":417},"Always include Trackio",{"type":50,"value":419}," - Every training script should include Trackio for real-time monitoring. Use example scripts in ",{"type":44,"tag":135,"props":421,"children":423},{"className":422},[],[424],{"type":50,"value":425},"scripts\u002F",{"type":50,"value":427}," as templates.",{"type":44,"tag":79,"props":429,"children":430},{},[431,436],{"type":44,"tag":69,"props":432,"children":433},{},[434],{"type":50,"value":435},"Provide job details after submission",{"type":50,"value":437}," - After submitting, provide job ID, monitoring URL, estimated time, and note that the user can request status checks later.",{"type":44,"tag":79,"props":439,"children":440},{},[441,446,448,454,456,462],{"type":44,"tag":69,"props":442,"children":443},{},[444],{"type":50,"value":445},"Use example scripts as templates",{"type":50,"value":447}," - Reference ",{"type":44,"tag":135,"props":449,"children":451},{"className":450},[],[452],{"type":50,"value":453},"scripts\u002Ftrain_sft_example.py",{"type":50,"value":455},", ",{"type":44,"tag":135,"props":457,"children":459},{"className":458},[],[460],{"type":50,"value":461},"scripts\u002Ftrain_dpo_example.py",{"type":50,"value":463},", etc. as starting points.",{"type":44,"tag":53,"props":465,"children":467},{"id":466},"local-script-execution",[468],{"type":50,"value":469},"Local Script Execution",{"type":44,"tag":60,"props":471,"children":472},{},[473,475,481],{"type":50,"value":474},"Repository scripts use PEP 723 inline dependencies. Run them with ",{"type":44,"tag":135,"props":476,"children":478},{"className":477},[],[479],{"type":50,"value":480},"uv run",{"type":50,"value":482},":",{"type":44,"tag":128,"props":484,"children":488},{"className":485,"code":486,"language":487,"meta":132,"style":132},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","uv run scripts\u002Festimate_cost.py --help\nuv run scripts\u002Fdataset_inspector.py --help\n","bash",[489],{"type":44,"tag":135,"props":490,"children":491},{"__ignoreMap":132},[492,517],{"type":44,"tag":139,"props":493,"children":494},{"class":141,"line":142},[495,501,507,512],{"type":44,"tag":139,"props":496,"children":498},{"style":497},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[499],{"type":50,"value":500},"uv",{"type":44,"tag":139,"props":502,"children":504},{"style":503},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[505],{"type":50,"value":506}," run",{"type":44,"tag":139,"props":508,"children":509},{"style":503},[510],{"type":50,"value":511}," scripts\u002Festimate_cost.py",{"type":44,"tag":139,"props":513,"children":514},{"style":503},[515],{"type":50,"value":516}," --help\n",{"type":44,"tag":139,"props":518,"children":519},{"class":141,"line":151},[520,524,528,533],{"type":44,"tag":139,"props":521,"children":522},{"style":497},[523],{"type":50,"value":500},{"type":44,"tag":139,"props":525,"children":526},{"style":503},[527],{"type":50,"value":506},{"type":44,"tag":139,"props":529,"children":530},{"style":503},[531],{"type":50,"value":532}," scripts\u002Fdataset_inspector.py",{"type":44,"tag":139,"props":534,"children":535},{"style":503},[536],{"type":50,"value":516},{"type":44,"tag":53,"props":538,"children":540},{"id":539},"prerequisites-checklist",[541],{"type":50,"value":542},"Prerequisites Checklist",{"type":44,"tag":60,"props":544,"children":545},{},[546],{"type":50,"value":547},"Before starting any training job, verify:",{"type":44,"tag":239,"props":549,"children":551},{"id":550},"account-authentication",[552,554],{"type":50,"value":553},"✅ ",{"type":44,"tag":69,"props":555,"children":556},{},[557],{"type":50,"value":558},"Account & Authentication",{"type":44,"tag":75,"props":560,"children":561},{},[562,594,605,615,620],{"type":44,"tag":79,"props":563,"children":564},{},[565,567,576,577,584,586,592],{"type":50,"value":566},"Hugging Face Account with ",{"type":44,"tag":568,"props":569,"children":573},"a",{"href":570,"rel":571},"https:\u002F\u002Fhf.co\u002Fpro",[572],"nofollow",[574],{"type":50,"value":575},"Pro",{"type":50,"value":455},{"type":44,"tag":568,"props":578,"children":581},{"href":579,"rel":580},"https:\u002F\u002Fhf.co\u002Fenterprise",[572],[582],{"type":50,"value":583},"Team",{"type":50,"value":585},", or ",{"type":44,"tag":568,"props":587,"children":589},{"href":579,"rel":588},[572],[590],{"type":50,"value":591},"Enterprise",{"type":50,"value":593}," plan (Jobs require paid plan)",{"type":44,"tag":79,"props":595,"children":596},{},[597,599],{"type":50,"value":598},"Authenticated login: Check with ",{"type":44,"tag":135,"props":600,"children":602},{"className":601},[],[603],{"type":50,"value":604},"hf_whoami()",{"type":44,"tag":79,"props":606,"children":607},{},[608,613],{"type":44,"tag":69,"props":609,"children":610},{},[611],{"type":50,"value":612},"HF_TOKEN for Hub Push",{"type":50,"value":614}," ⚠️ CRITICAL - Training environment is ephemeral, must push to Hub or ALL training results are lost",{"type":44,"tag":79,"props":616,"children":617},{},[618],{"type":50,"value":619},"Token must have write permissions",{"type":44,"tag":79,"props":621,"children":622},{},[623,636,638,644],{"type":44,"tag":69,"props":624,"children":625},{},[626,628,634],{"type":50,"value":627},"MUST pass ",{"type":44,"tag":135,"props":629,"children":631},{"className":630},[],[632],{"type":50,"value":633},"secrets={\"HF_TOKEN\": \"$HF_TOKEN\"}",{"type":50,"value":635}," in job config",{"type":50,"value":637}," to make token available (the ",{"type":44,"tag":135,"props":639,"children":641},{"className":640},[],[642],{"type":50,"value":643},"$HF_TOKEN",{"type":50,"value":645}," syntax\nreferences your actual token value)",{"type":44,"tag":239,"props":647,"children":649},{"id":648},"dataset-requirements",[650,651],{"type":50,"value":553},{"type":44,"tag":69,"props":652,"children":653},{},[654],{"type":50,"value":655},"Dataset Requirements",{"type":44,"tag":75,"props":657,"children":658},{},[659,670,675,685],{"type":44,"tag":79,"props":660,"children":661},{},[662,664],{"type":50,"value":663},"Dataset must exist on Hub or be loadable via ",{"type":44,"tag":135,"props":665,"children":667},{"className":666},[],[668],{"type":50,"value":669},"datasets.load_dataset()",{"type":44,"tag":79,"props":671,"children":672},{},[673],{"type":50,"value":674},"Format must match training method (SFT: \"messages\"\u002Ftext\u002Fprompt-completion; DPO: chosen\u002Frejected; GRPO: prompt-only)",{"type":44,"tag":79,"props":676,"children":677},{},[678,683],{"type":44,"tag":69,"props":679,"children":680},{},[681],{"type":50,"value":682},"ALWAYS validate unknown datasets",{"type":50,"value":684}," before GPU training to prevent format failures (see Dataset Validation section below)",{"type":44,"tag":79,"props":686,"children":687},{},[688],{"type":50,"value":689},"Size appropriate for hardware (Demo: 50-100 examples on t4-small; Production: 1K-10K+ on a10g-large\u002Fa100-large)",{"type":44,"tag":239,"props":691,"children":693},{"id":692},"️-critical-settings",[694,696],{"type":50,"value":695},"⚠️ ",{"type":44,"tag":69,"props":697,"children":698},{},[699],{"type":50,"value":700},"Critical Settings",{"type":44,"tag":75,"props":702,"children":703},{},[704,714],{"type":44,"tag":79,"props":705,"children":706},{},[707,712],{"type":44,"tag":69,"props":708,"children":709},{},[710],{"type":50,"value":711},"Timeout must exceed expected training time",{"type":50,"value":713}," - Default 30min is TOO SHORT for most training. Minimum recommended: 1-2 hours. Job fails and loses all progress if timeout is exceeded.",{"type":44,"tag":79,"props":715,"children":716},{},[717,722,724,730,731,737,739],{"type":44,"tag":69,"props":718,"children":719},{},[720],{"type":50,"value":721},"Hub push must be enabled",{"type":50,"value":723}," - Config: ",{"type":44,"tag":135,"props":725,"children":727},{"className":726},[],[728],{"type":50,"value":729},"push_to_hub=True",{"type":50,"value":455},{"type":44,"tag":135,"props":732,"children":734},{"className":733},[],[735],{"type":50,"value":736},"hub_model_id=\"username\u002Fmodel-name\"",{"type":50,"value":738},"; Job: ",{"type":44,"tag":135,"props":740,"children":742},{"className":741},[],[743],{"type":50,"value":633},{"type":44,"tag":53,"props":745,"children":747},{"id":746},"asynchronous-job-guidelines",[748],{"type":50,"value":749},"Asynchronous Job Guidelines",{"type":44,"tag":60,"props":751,"children":752},{},[753],{"type":44,"tag":69,"props":754,"children":755},{},[756],{"type":50,"value":757},"⚠️ IMPORTANT: Training jobs run asynchronously and can take hours",{"type":44,"tag":239,"props":759,"children":761},{"id":760},"action-required",[762],{"type":50,"value":763},"Action Required",{"type":44,"tag":60,"props":765,"children":766},{},[767],{"type":44,"tag":69,"props":768,"children":769},{},[770],{"type":50,"value":771},"When user requests training:",{"type":44,"tag":351,"props":773,"children":774},{},[775,792,809,819],{"type":44,"tag":79,"props":776,"children":777},{},[778,783,785,790],{"type":44,"tag":69,"props":779,"children":780},{},[781],{"type":50,"value":782},"Create the training script",{"type":50,"value":784}," with Trackio included (use ",{"type":44,"tag":135,"props":786,"children":788},{"className":787},[],[789],{"type":50,"value":453},{"type":50,"value":791}," as template)",{"type":44,"tag":79,"props":793,"children":794},{},[795,800,802,807],{"type":44,"tag":69,"props":796,"children":797},{},[798],{"type":50,"value":799},"Submit immediately",{"type":50,"value":801}," using ",{"type":44,"tag":135,"props":803,"children":805},{"className":804},[],[806],{"type":50,"value":367},{"type":50,"value":808}," MCP tool with script content inline - don't save to file unless user requests",{"type":44,"tag":79,"props":810,"children":811},{},[812,817],{"type":44,"tag":69,"props":813,"children":814},{},[815],{"type":50,"value":816},"Report submission",{"type":50,"value":818}," with job ID, monitoring URL, and estimated time",{"type":44,"tag":79,"props":820,"children":821},{},[822,827],{"type":44,"tag":69,"props":823,"children":824},{},[825],{"type":50,"value":826},"Wait for user",{"type":50,"value":828}," to request status checks - don't poll automatically",{"type":44,"tag":239,"props":830,"children":832},{"id":831},"ground-rules",[833],{"type":50,"value":834},"Ground Rules",{"type":44,"tag":75,"props":836,"children":837},{},[838,848,858,868],{"type":44,"tag":79,"props":839,"children":840},{},[841,846],{"type":44,"tag":69,"props":842,"children":843},{},[844],{"type":50,"value":845},"Jobs run in background",{"type":50,"value":847}," - Submission returns immediately; training continues independently",{"type":44,"tag":79,"props":849,"children":850},{},[851,856],{"type":44,"tag":69,"props":852,"children":853},{},[854],{"type":50,"value":855},"Initial logs delayed",{"type":50,"value":857}," - Can take 30-60 seconds for logs to appear",{"type":44,"tag":79,"props":859,"children":860},{},[861,866],{"type":44,"tag":69,"props":862,"children":863},{},[864],{"type":50,"value":865},"User checks status",{"type":50,"value":867}," - Wait for user to request status updates",{"type":44,"tag":79,"props":869,"children":870},{},[871,876],{"type":44,"tag":69,"props":872,"children":873},{},[874],{"type":50,"value":875},"Avoid polling",{"type":50,"value":877}," - Check logs only on user request; provide monitoring links instead",{"type":44,"tag":239,"props":879,"children":881},{"id":880},"after-submission",[882],{"type":50,"value":883},"After Submission",{"type":44,"tag":60,"props":885,"children":886},{},[887],{"type":44,"tag":69,"props":888,"children":889},{},[890],{"type":50,"value":891},"Provide to user:",{"type":44,"tag":75,"props":893,"children":894},{},[895,900,905,910],{"type":44,"tag":79,"props":896,"children":897},{},[898],{"type":50,"value":899},"✅ Job ID and monitoring URL",{"type":44,"tag":79,"props":901,"children":902},{},[903],{"type":50,"value":904},"✅ Expected completion time",{"type":44,"tag":79,"props":906,"children":907},{},[908],{"type":50,"value":909},"✅ Trackio dashboard URL",{"type":44,"tag":79,"props":911,"children":912},{},[913],{"type":50,"value":914},"✅ Note that user can request status checks later",{"type":44,"tag":60,"props":916,"children":917},{},[918],{"type":44,"tag":69,"props":919,"children":920},{},[921],{"type":50,"value":922},"Example Response:",{"type":44,"tag":128,"props":924,"children":928},{"className":925,"code":927,"language":50},[926],"language-text","✅ Job submitted successfully!\n\nJob ID: abc123xyz\nMonitor: https:\u002F\u002Fhuggingface.co\u002Fjobs\u002Fusername\u002Fabc123xyz\n\nExpected time: ~2 hours\nEstimated cost: ~$10\n\nThe job is running in the background. Ask me to check status\u002Flogs when ready!\n",[929],{"type":44,"tag":135,"props":930,"children":931},{"__ignoreMap":132},[932],{"type":50,"value":927},{"type":44,"tag":53,"props":934,"children":936},{"id":935},"quick-start-three-approaches",[937],{"type":50,"value":938},"Quick Start: Three Approaches",{"type":44,"tag":60,"props":940,"children":941},{},[942,947,949,955,957,963],{"type":44,"tag":69,"props":943,"children":944},{},[945],{"type":50,"value":946},"💡 Tip for Demos:",{"type":50,"value":948}," For quick demos on smaller GPUs (t4-small), omit ",{"type":44,"tag":135,"props":950,"children":952},{"className":951},[],[953],{"type":50,"value":954},"eval_dataset",{"type":50,"value":956}," and ",{"type":44,"tag":135,"props":958,"children":960},{"className":959},[],[961],{"type":50,"value":962},"eval_strategy",{"type":50,"value":964}," to save ~40% memory. You'll still see training loss and learning progress.",{"type":44,"tag":239,"props":966,"children":968},{"id":967},"sequence-length-configuration",[969],{"type":50,"value":970},"Sequence Length Configuration",{"type":44,"tag":60,"props":972,"children":973},{},[974,995],{"type":44,"tag":69,"props":975,"children":976},{},[977,979,985,987,993],{"type":50,"value":978},"TRL config classes use ",{"type":44,"tag":135,"props":980,"children":982},{"className":981},[],[983],{"type":50,"value":984},"max_length",{"type":50,"value":986}," (not ",{"type":44,"tag":135,"props":988,"children":990},{"className":989},[],[991],{"type":50,"value":992},"max_seq_length",{"type":50,"value":994},")",{"type":50,"value":996}," to control tokenized sequence length:",{"type":44,"tag":128,"props":998,"children":1000},{"className":130,"code":999,"language":23,"meta":132,"style":132},"# ✅ CORRECT - If you need to set sequence length\nSFTConfig(max_length=512)   # Truncate sequences to 512 tokens\nDPOConfig(max_length=2048)  # Longer context (2048 tokens)\n\n# ❌ WRONG - This parameter doesn't exist\nSFTConfig(max_seq_length=512)  # TypeError!\n",[1001],{"type":44,"tag":135,"props":1002,"children":1003},{"__ignoreMap":132},[1004,1012,1020,1028,1037,1046],{"type":44,"tag":139,"props":1005,"children":1006},{"class":141,"line":142},[1007],{"type":44,"tag":139,"props":1008,"children":1009},{},[1010],{"type":50,"value":1011},"# ✅ CORRECT - If you need to set sequence length\n",{"type":44,"tag":139,"props":1013,"children":1014},{"class":141,"line":151},[1015],{"type":44,"tag":139,"props":1016,"children":1017},{},[1018],{"type":50,"value":1019},"SFTConfig(max_length=512)   # Truncate sequences to 512 tokens\n",{"type":44,"tag":139,"props":1021,"children":1022},{"class":141,"line":160},[1023],{"type":44,"tag":139,"props":1024,"children":1025},{},[1026],{"type":50,"value":1027},"DPOConfig(max_length=2048)  # Longer context (2048 tokens)\n",{"type":44,"tag":139,"props":1029,"children":1030},{"class":141,"line":169},[1031],{"type":44,"tag":139,"props":1032,"children":1034},{"emptyLinePlaceholder":1033},true,[1035],{"type":50,"value":1036},"\n",{"type":44,"tag":139,"props":1038,"children":1040},{"class":141,"line":1039},5,[1041],{"type":44,"tag":139,"props":1042,"children":1043},{},[1044],{"type":50,"value":1045},"# ❌ WRONG - This parameter doesn't exist\n",{"type":44,"tag":139,"props":1047,"children":1049},{"class":141,"line":1048},6,[1050],{"type":44,"tag":139,"props":1051,"children":1052},{},[1053],{"type":50,"value":1054},"SFTConfig(max_seq_length=512)  # TypeError!\n",{"type":44,"tag":60,"props":1056,"children":1057},{},[1058,1063,1064,1070],{"type":44,"tag":69,"props":1059,"children":1060},{},[1061],{"type":50,"value":1062},"Default behavior:",{"type":50,"value":185},{"type":44,"tag":135,"props":1065,"children":1067},{"className":1066},[],[1068],{"type":50,"value":1069},"max_length=1024",{"type":50,"value":1071}," (truncates from right). This works well for most training.",{"type":44,"tag":60,"props":1073,"children":1074},{},[1075],{"type":44,"tag":69,"props":1076,"children":1077},{},[1078],{"type":50,"value":1079},"When to override:",{"type":44,"tag":75,"props":1081,"children":1082},{},[1083,1100,1117],{"type":44,"tag":79,"props":1084,"children":1085},{},[1086,1091,1093,1099],{"type":44,"tag":69,"props":1087,"children":1088},{},[1089],{"type":50,"value":1090},"Longer context",{"type":50,"value":1092},": Set higher (e.g., ",{"type":44,"tag":135,"props":1094,"children":1096},{"className":1095},[],[1097],{"type":50,"value":1098},"max_length=2048",{"type":50,"value":994},{"type":44,"tag":79,"props":1101,"children":1102},{},[1103,1108,1110,1116],{"type":44,"tag":69,"props":1104,"children":1105},{},[1106],{"type":50,"value":1107},"Memory constraints",{"type":50,"value":1109},": Set lower (e.g., ",{"type":44,"tag":135,"props":1111,"children":1113},{"className":1112},[],[1114],{"type":50,"value":1115},"max_length=512",{"type":50,"value":994},{"type":44,"tag":79,"props":1118,"children":1119},{},[1120,1125,1127,1133],{"type":44,"tag":69,"props":1121,"children":1122},{},[1123],{"type":50,"value":1124},"Vision models",{"type":50,"value":1126},": Set ",{"type":44,"tag":135,"props":1128,"children":1130},{"className":1129},[],[1131],{"type":50,"value":1132},"max_length=None",{"type":50,"value":1134}," (prevents cutting image tokens)",{"type":44,"tag":60,"props":1136,"children":1137},{},[1138,1143],{"type":44,"tag":69,"props":1139,"children":1140},{},[1141],{"type":50,"value":1142},"Usually you don't need to set this parameter at all",{"type":50,"value":1144}," - the examples below use the sensible default.",{"type":44,"tag":239,"props":1146,"children":1148},{"id":1147},"approach-1-uv-scripts-recommendeddefault-choice",[1149],{"type":50,"value":1150},"Approach 1: UV Scripts (Recommended—Default Choice)",{"type":44,"tag":60,"props":1152,"children":1153},{},[1154,1156],{"type":50,"value":1155},"UV scripts use PEP 723 inline dependencies for clean, self-contained training. ",{"type":44,"tag":69,"props":1157,"children":1158},{},[1159],{"type":50,"value":1160},"This is the primary approach for Claude Code.",{"type":44,"tag":128,"props":1162,"children":1164},{"className":130,"code":1163,"language":23,"meta":132,"style":132},"hf_jobs(\"uv\", {\n    \"script\": \"\"\"\n# \u002F\u002F\u002F script\n# dependencies = [\"trl>=0.12.0\", \"peft>=0.7.0\", \"trackio\"]\n# \u002F\u002F\u002F\n\nfrom datasets import load_dataset\nfrom peft import LoraConfig\nfrom trl import SFTTrainer, SFTConfig\nimport trackio\n\ndataset = load_dataset(\"trl-lib\u002FCapybara\", split=\"train\")\n\n# Create train\u002Feval split for monitoring\ndataset_split = dataset.train_test_split(test_size=0.1, seed=42)\n\ntrainer = SFTTrainer(\n    model=\"Qwen\u002FQwen2.5-0.5B\",\n    train_dataset=dataset_split[\"train\"],\n    eval_dataset=dataset_split[\"test\"],\n    peft_config=LoraConfig(r=16, lora_alpha=32),\n    args=SFTConfig(\n        output_dir=\"my-model\",\n        push_to_hub=True,\n        hub_model_id=\"username\u002Fmy-model\",\n        num_train_epochs=3,\n        eval_strategy=\"steps\",\n        eval_steps=50,\n        report_to=\"trackio\",\n        project=\"meaningful_prject_name\", # project name for the training name (trackio)\n        run_name=\"meaningful_run_name\",   # descriptive name for the specific training run (trackio)\n    )\n)\n\ntrainer.train()\ntrainer.push_to_hub()\n\"\"\",\n    \"flavor\": \"a10g-large\",\n    \"timeout\": \"2h\",\n    \"secrets\": {\"HF_TOKEN\": \"$HF_TOKEN\"}\n})\n",[1165],{"type":44,"tag":135,"props":1166,"children":1167},{"__ignoreMap":132},[1168,1176,1184,1197,1205,1217,1224,1233,1242,1251,1260,1268,1277,1285,1294,1303,1311,1320,1329,1338,1347,1356,1365,1374,1383,1392,1401,1410,1419,1428,1437,1446,1455,1464,1472,1481,1490,1499,1508,1517,1526],{"type":44,"tag":139,"props":1169,"children":1170},{"class":141,"line":142},[1171],{"type":44,"tag":139,"props":1172,"children":1173},{},[1174],{"type":50,"value":1175},"hf_jobs(\"uv\", {\n",{"type":44,"tag":139,"props":1177,"children":1178},{"class":141,"line":151},[1179],{"type":44,"tag":139,"props":1180,"children":1181},{},[1182],{"type":50,"value":1183},"    \"script\": \"\"\"\n",{"type":44,"tag":139,"props":1185,"children":1186},{"class":141,"line":160},[1187,1192],{"type":44,"tag":139,"props":1188,"children":1189},{},[1190],{"type":50,"value":1191},"#",{"type":44,"tag":139,"props":1193,"children":1194},{},[1195],{"type":50,"value":1196}," \u002F\u002F\u002F script\n",{"type":44,"tag":139,"props":1198,"children":1199},{"class":141,"line":169},[1200],{"type":44,"tag":139,"props":1201,"children":1202},{},[1203],{"type":50,"value":1204},"# dependencies = [\"trl>=0.12.0\", \"peft>=0.7.0\", \"trackio\"]\n",{"type":44,"tag":139,"props":1206,"children":1207},{"class":141,"line":1039},[1208,1212],{"type":44,"tag":139,"props":1209,"children":1210},{},[1211],{"type":50,"value":1191},{"type":44,"tag":139,"props":1213,"children":1214},{},[1215],{"type":50,"value":1216}," \u002F\u002F\u002F\n",{"type":44,"tag":139,"props":1218,"children":1219},{"class":141,"line":1048},[1220],{"type":44,"tag":139,"props":1221,"children":1222},{"emptyLinePlaceholder":1033},[1223],{"type":50,"value":1036},{"type":44,"tag":139,"props":1225,"children":1227},{"class":141,"line":1226},7,[1228],{"type":44,"tag":139,"props":1229,"children":1230},{},[1231],{"type":50,"value":1232},"from datasets import load_dataset\n",{"type":44,"tag":139,"props":1234,"children":1236},{"class":141,"line":1235},8,[1237],{"type":44,"tag":139,"props":1238,"children":1239},{},[1240],{"type":50,"value":1241},"from peft import LoraConfig\n",{"type":44,"tag":139,"props":1243,"children":1245},{"class":141,"line":1244},9,[1246],{"type":44,"tag":139,"props":1247,"children":1248},{},[1249],{"type":50,"value":1250},"from trl import SFTTrainer, SFTConfig\n",{"type":44,"tag":139,"props":1252,"children":1254},{"class":141,"line":1253},10,[1255],{"type":44,"tag":139,"props":1256,"children":1257},{},[1258],{"type":50,"value":1259},"import trackio\n",{"type":44,"tag":139,"props":1261,"children":1263},{"class":141,"line":1262},11,[1264],{"type":44,"tag":139,"props":1265,"children":1266},{"emptyLinePlaceholder":1033},[1267],{"type":50,"value":1036},{"type":44,"tag":139,"props":1269,"children":1271},{"class":141,"line":1270},12,[1272],{"type":44,"tag":139,"props":1273,"children":1274},{},[1275],{"type":50,"value":1276},"dataset = load_dataset(\"trl-lib\u002FCapybara\", split=\"train\")\n",{"type":44,"tag":139,"props":1278,"children":1280},{"class":141,"line":1279},13,[1281],{"type":44,"tag":139,"props":1282,"children":1283},{"emptyLinePlaceholder":1033},[1284],{"type":50,"value":1036},{"type":44,"tag":139,"props":1286,"children":1288},{"class":141,"line":1287},14,[1289],{"type":44,"tag":139,"props":1290,"children":1291},{},[1292],{"type":50,"value":1293},"# Create train\u002Feval split for monitoring\n",{"type":44,"tag":139,"props":1295,"children":1297},{"class":141,"line":1296},15,[1298],{"type":44,"tag":139,"props":1299,"children":1300},{},[1301],{"type":50,"value":1302},"dataset_split = dataset.train_test_split(test_size=0.1, seed=42)\n",{"type":44,"tag":139,"props":1304,"children":1306},{"class":141,"line":1305},16,[1307],{"type":44,"tag":139,"props":1308,"children":1309},{"emptyLinePlaceholder":1033},[1310],{"type":50,"value":1036},{"type":44,"tag":139,"props":1312,"children":1314},{"class":141,"line":1313},17,[1315],{"type":44,"tag":139,"props":1316,"children":1317},{},[1318],{"type":50,"value":1319},"trainer = SFTTrainer(\n",{"type":44,"tag":139,"props":1321,"children":1323},{"class":141,"line":1322},18,[1324],{"type":44,"tag":139,"props":1325,"children":1326},{},[1327],{"type":50,"value":1328},"    model=\"Qwen\u002FQwen2.5-0.5B\",\n",{"type":44,"tag":139,"props":1330,"children":1332},{"class":141,"line":1331},19,[1333],{"type":44,"tag":139,"props":1334,"children":1335},{},[1336],{"type":50,"value":1337},"    train_dataset=dataset_split[\"train\"],\n",{"type":44,"tag":139,"props":1339,"children":1341},{"class":141,"line":1340},20,[1342],{"type":44,"tag":139,"props":1343,"children":1344},{},[1345],{"type":50,"value":1346},"    eval_dataset=dataset_split[\"test\"],\n",{"type":44,"tag":139,"props":1348,"children":1350},{"class":141,"line":1349},21,[1351],{"type":44,"tag":139,"props":1352,"children":1353},{},[1354],{"type":50,"value":1355},"    peft_config=LoraConfig(r=16, lora_alpha=32),\n",{"type":44,"tag":139,"props":1357,"children":1359},{"class":141,"line":1358},22,[1360],{"type":44,"tag":139,"props":1361,"children":1362},{},[1363],{"type":50,"value":1364},"    args=SFTConfig(\n",{"type":44,"tag":139,"props":1366,"children":1368},{"class":141,"line":1367},23,[1369],{"type":44,"tag":139,"props":1370,"children":1371},{},[1372],{"type":50,"value":1373},"        output_dir=\"my-model\",\n",{"type":44,"tag":139,"props":1375,"children":1377},{"class":141,"line":1376},24,[1378],{"type":44,"tag":139,"props":1379,"children":1380},{},[1381],{"type":50,"value":1382},"        push_to_hub=True,\n",{"type":44,"tag":139,"props":1384,"children":1386},{"class":141,"line":1385},25,[1387],{"type":44,"tag":139,"props":1388,"children":1389},{},[1390],{"type":50,"value":1391},"        hub_model_id=\"username\u002Fmy-model\",\n",{"type":44,"tag":139,"props":1393,"children":1395},{"class":141,"line":1394},26,[1396],{"type":44,"tag":139,"props":1397,"children":1398},{},[1399],{"type":50,"value":1400},"        num_train_epochs=3,\n",{"type":44,"tag":139,"props":1402,"children":1404},{"class":141,"line":1403},27,[1405],{"type":44,"tag":139,"props":1406,"children":1407},{},[1408],{"type":50,"value":1409},"        eval_strategy=\"steps\",\n",{"type":44,"tag":139,"props":1411,"children":1413},{"class":141,"line":1412},28,[1414],{"type":44,"tag":139,"props":1415,"children":1416},{},[1417],{"type":50,"value":1418},"        eval_steps=50,\n",{"type":44,"tag":139,"props":1420,"children":1422},{"class":141,"line":1421},29,[1423],{"type":44,"tag":139,"props":1424,"children":1425},{},[1426],{"type":50,"value":1427},"        report_to=\"trackio\",\n",{"type":44,"tag":139,"props":1429,"children":1431},{"class":141,"line":1430},30,[1432],{"type":44,"tag":139,"props":1433,"children":1434},{},[1435],{"type":50,"value":1436},"        project=\"meaningful_prject_name\", # project name for the training name (trackio)\n",{"type":44,"tag":139,"props":1438,"children":1440},{"class":141,"line":1439},31,[1441],{"type":44,"tag":139,"props":1442,"children":1443},{},[1444],{"type":50,"value":1445},"        run_name=\"meaningful_run_name\",   # descriptive name for the specific training run (trackio)\n",{"type":44,"tag":139,"props":1447,"children":1449},{"class":141,"line":1448},32,[1450],{"type":44,"tag":139,"props":1451,"children":1452},{},[1453],{"type":50,"value":1454},"    )\n",{"type":44,"tag":139,"props":1456,"children":1458},{"class":141,"line":1457},33,[1459],{"type":44,"tag":139,"props":1460,"children":1461},{},[1462],{"type":50,"value":1463},")\n",{"type":44,"tag":139,"props":1465,"children":1467},{"class":141,"line":1466},34,[1468],{"type":44,"tag":139,"props":1469,"children":1470},{"emptyLinePlaceholder":1033},[1471],{"type":50,"value":1036},{"type":44,"tag":139,"props":1473,"children":1475},{"class":141,"line":1474},35,[1476],{"type":44,"tag":139,"props":1477,"children":1478},{},[1479],{"type":50,"value":1480},"trainer.train()\n",{"type":44,"tag":139,"props":1482,"children":1484},{"class":141,"line":1483},36,[1485],{"type":44,"tag":139,"props":1486,"children":1487},{},[1488],{"type":50,"value":1489},"trainer.push_to_hub()\n",{"type":44,"tag":139,"props":1491,"children":1493},{"class":141,"line":1492},37,[1494],{"type":44,"tag":139,"props":1495,"children":1496},{},[1497],{"type":50,"value":1498},"\"\"\",\n",{"type":44,"tag":139,"props":1500,"children":1502},{"class":141,"line":1501},38,[1503],{"type":44,"tag":139,"props":1504,"children":1505},{},[1506],{"type":50,"value":1507},"    \"flavor\": \"a10g-large\",\n",{"type":44,"tag":139,"props":1509,"children":1511},{"class":141,"line":1510},39,[1512],{"type":44,"tag":139,"props":1513,"children":1514},{},[1515],{"type":50,"value":1516},"    \"timeout\": \"2h\",\n",{"type":44,"tag":139,"props":1518,"children":1520},{"class":141,"line":1519},40,[1521],{"type":44,"tag":139,"props":1522,"children":1523},{},[1524],{"type":50,"value":1525},"    \"secrets\": {\"HF_TOKEN\": \"$HF_TOKEN\"}\n",{"type":44,"tag":139,"props":1527,"children":1529},{"class":141,"line":1528},41,[1530],{"type":44,"tag":139,"props":1531,"children":1532},{},[1533],{"type":50,"value":1534},"})\n",{"type":44,"tag":60,"props":1536,"children":1537},{},[1538,1543,1545,1550,1552],{"type":44,"tag":69,"props":1539,"children":1540},{},[1541],{"type":50,"value":1542},"Benefits:",{"type":50,"value":1544}," Direct MCP tool usage, clean code, dependencies declared inline (PEP 723), no file saving required, full control\n",{"type":44,"tag":69,"props":1546,"children":1547},{},[1548],{"type":50,"value":1549},"When to use:",{"type":50,"value":1551}," Default choice for all training tasks in Claude Code, custom training logic, any scenario requiring ",{"type":44,"tag":135,"props":1553,"children":1555},{"className":1554},[],[1556],{"type":50,"value":367},{"type":44,"tag":1558,"props":1559,"children":1561},"h4",{"id":1560},"working-with-scripts",[1562],{"type":50,"value":1563},"Working with Scripts",{"type":44,"tag":60,"props":1565,"children":1566},{},[1567,1568,1573,1575,1580,1582],{"type":50,"value":695},{"type":44,"tag":69,"props":1569,"children":1570},{},[1571],{"type":50,"value":1572},"Important:",{"type":50,"value":1574}," The ",{"type":44,"tag":135,"props":1576,"children":1578},{"className":1577},[],[1579],{"type":50,"value":393},{"type":50,"value":1581}," parameter accepts either inline code (as shown above) OR a URL. ",{"type":44,"tag":69,"props":1583,"children":1584},{},[1585],{"type":50,"value":1586},"Local file paths do NOT work.",{"type":44,"tag":60,"props":1588,"children":1589},{},[1590,1595],{"type":44,"tag":69,"props":1591,"children":1592},{},[1593],{"type":50,"value":1594},"Why local paths don't work:",{"type":50,"value":1596},"\nJobs run in isolated Docker containers without access to your local filesystem. Scripts must be:",{"type":44,"tag":75,"props":1598,"children":1599},{},[1600,1605,1610],{"type":44,"tag":79,"props":1601,"children":1602},{},[1603],{"type":50,"value":1604},"Inline code (recommended for custom training)",{"type":44,"tag":79,"props":1606,"children":1607},{},[1608],{"type":50,"value":1609},"Publicly accessible URLs",{"type":44,"tag":79,"props":1611,"children":1612},{},[1613],{"type":50,"value":1614},"Private repo URLs (with HF_TOKEN)",{"type":44,"tag":60,"props":1616,"children":1617},{},[1618],{"type":44,"tag":69,"props":1619,"children":1620},{},[1621],{"type":50,"value":1622},"Common mistakes:",{"type":44,"tag":128,"props":1624,"children":1626},{"className":130,"code":1625,"language":23,"meta":132,"style":132},"# ❌ These will all fail\nhf_jobs(\"uv\", {\"script\": \"train.py\"})\nhf_jobs(\"uv\", {\"script\": \".\u002Fscripts\u002Ftrain.py\"})\nhf_jobs(\"uv\", {\"script\": \"\u002Fpath\u002Fto\u002Ftrain.py\"})\n",[1627],{"type":44,"tag":135,"props":1628,"children":1629},{"__ignoreMap":132},[1630,1638,1646,1654],{"type":44,"tag":139,"props":1631,"children":1632},{"class":141,"line":142},[1633],{"type":44,"tag":139,"props":1634,"children":1635},{},[1636],{"type":50,"value":1637},"# ❌ These will all fail\n",{"type":44,"tag":139,"props":1639,"children":1640},{"class":141,"line":151},[1641],{"type":44,"tag":139,"props":1642,"children":1643},{},[1644],{"type":50,"value":1645},"hf_jobs(\"uv\", {\"script\": \"train.py\"})\n",{"type":44,"tag":139,"props":1647,"children":1648},{"class":141,"line":160},[1649],{"type":44,"tag":139,"props":1650,"children":1651},{},[1652],{"type":50,"value":1653},"hf_jobs(\"uv\", {\"script\": \".\u002Fscripts\u002Ftrain.py\"})\n",{"type":44,"tag":139,"props":1655,"children":1656},{"class":141,"line":169},[1657],{"type":44,"tag":139,"props":1658,"children":1659},{},[1660],{"type":50,"value":1661},"hf_jobs(\"uv\", {\"script\": \"\u002Fpath\u002Fto\u002Ftrain.py\"})\n",{"type":44,"tag":60,"props":1663,"children":1664},{},[1665],{"type":44,"tag":69,"props":1666,"children":1667},{},[1668],{"type":50,"value":1669},"Correct approaches:",{"type":44,"tag":128,"props":1671,"children":1673},{"className":130,"code":1672,"language":23,"meta":132,"style":132},"# ✅ Inline code (recommended)\nhf_jobs(\"uv\", {\"script\": \"# \u002F\u002F\u002F script\\n# dependencies = [...]\\n# \u002F\u002F\u002F\\n\\n\u003Cyour code>\"})\n\n# ✅ From Hugging Face Hub\nhf_jobs(\"uv\", {\"script\": \"https:\u002F\u002Fhuggingface.co\u002Fuser\u002Frepo\u002Fresolve\u002Fmain\u002Ftrain.py\"})\n\n# ✅ From GitHub\nhf_jobs(\"uv\", {\"script\": \"https:\u002F\u002Fraw.githubusercontent.com\u002Fuser\u002Frepo\u002Fmain\u002Ftrain.py\"})\n\n# ✅ From Gist\nhf_jobs(\"uv\", {\"script\": \"https:\u002F\u002Fgist.githubusercontent.com\u002Fuser\u002Fid\u002Fraw\u002Ftrain.py\"})\n",[1674],{"type":44,"tag":135,"props":1675,"children":1676},{"__ignoreMap":132},[1677,1685,1693,1700,1708,1716,1723,1731,1739,1746,1754],{"type":44,"tag":139,"props":1678,"children":1679},{"class":141,"line":142},[1680],{"type":44,"tag":139,"props":1681,"children":1682},{},[1683],{"type":50,"value":1684},"# ✅ Inline code (recommended)\n",{"type":44,"tag":139,"props":1686,"children":1687},{"class":141,"line":151},[1688],{"type":44,"tag":139,"props":1689,"children":1690},{},[1691],{"type":50,"value":1692},"hf_jobs(\"uv\", {\"script\": \"# \u002F\u002F\u002F script\\n# dependencies = [...]\\n# \u002F\u002F\u002F\\n\\n\u003Cyour code>\"})\n",{"type":44,"tag":139,"props":1694,"children":1695},{"class":141,"line":160},[1696],{"type":44,"tag":139,"props":1697,"children":1698},{"emptyLinePlaceholder":1033},[1699],{"type":50,"value":1036},{"type":44,"tag":139,"props":1701,"children":1702},{"class":141,"line":169},[1703],{"type":44,"tag":139,"props":1704,"children":1705},{},[1706],{"type":50,"value":1707},"# ✅ From Hugging Face Hub\n",{"type":44,"tag":139,"props":1709,"children":1710},{"class":141,"line":1039},[1711],{"type":44,"tag":139,"props":1712,"children":1713},{},[1714],{"type":50,"value":1715},"hf_jobs(\"uv\", {\"script\": \"https:\u002F\u002Fhuggingface.co\u002Fuser\u002Frepo\u002Fresolve\u002Fmain\u002Ftrain.py\"})\n",{"type":44,"tag":139,"props":1717,"children":1718},{"class":141,"line":1048},[1719],{"type":44,"tag":139,"props":1720,"children":1721},{"emptyLinePlaceholder":1033},[1722],{"type":50,"value":1036},{"type":44,"tag":139,"props":1724,"children":1725},{"class":141,"line":1226},[1726],{"type":44,"tag":139,"props":1727,"children":1728},{},[1729],{"type":50,"value":1730},"# ✅ From GitHub\n",{"type":44,"tag":139,"props":1732,"children":1733},{"class":141,"line":1235},[1734],{"type":44,"tag":139,"props":1735,"children":1736},{},[1737],{"type":50,"value":1738},"hf_jobs(\"uv\", {\"script\": \"https:\u002F\u002Fraw.githubusercontent.com\u002Fuser\u002Frepo\u002Fmain\u002Ftrain.py\"})\n",{"type":44,"tag":139,"props":1740,"children":1741},{"class":141,"line":1244},[1742],{"type":44,"tag":139,"props":1743,"children":1744},{"emptyLinePlaceholder":1033},[1745],{"type":50,"value":1036},{"type":44,"tag":139,"props":1747,"children":1748},{"class":141,"line":1253},[1749],{"type":44,"tag":139,"props":1750,"children":1751},{},[1752],{"type":50,"value":1753},"# ✅ From Gist\n",{"type":44,"tag":139,"props":1755,"children":1756},{"class":141,"line":1262},[1757],{"type":44,"tag":139,"props":1758,"children":1759},{},[1760],{"type":50,"value":1761},"hf_jobs(\"uv\", {\"script\": \"https:\u002F\u002Fgist.githubusercontent.com\u002Fuser\u002Fid\u002Fraw\u002Ftrain.py\"})\n",{"type":44,"tag":60,"props":1763,"children":1764},{},[1765,1770],{"type":44,"tag":69,"props":1766,"children":1767},{},[1768],{"type":50,"value":1769},"To use local scripts:",{"type":50,"value":1771}," Upload to HF Hub first:",{"type":44,"tag":128,"props":1773,"children":1775},{"className":485,"code":1774,"language":487,"meta":132,"style":132},"hf repos create my-training-scripts --type model\nhf upload my-training-scripts .\u002Ftrain.py train.py\n# Use: https:\u002F\u002Fhuggingface.co\u002FUSERNAME\u002Fmy-training-scripts\u002Fresolve\u002Fmain\u002Ftrain.py\n",[1776],{"type":44,"tag":135,"props":1777,"children":1778},{"__ignoreMap":132},[1779,1812,1838],{"type":44,"tag":139,"props":1780,"children":1781},{"class":141,"line":142},[1782,1787,1792,1797,1802,1807],{"type":44,"tag":139,"props":1783,"children":1784},{"style":497},[1785],{"type":50,"value":1786},"hf",{"type":44,"tag":139,"props":1788,"children":1789},{"style":503},[1790],{"type":50,"value":1791}," repos",{"type":44,"tag":139,"props":1793,"children":1794},{"style":503},[1795],{"type":50,"value":1796}," create",{"type":44,"tag":139,"props":1798,"children":1799},{"style":503},[1800],{"type":50,"value":1801}," my-training-scripts",{"type":44,"tag":139,"props":1803,"children":1804},{"style":503},[1805],{"type":50,"value":1806}," --type",{"type":44,"tag":139,"props":1808,"children":1809},{"style":503},[1810],{"type":50,"value":1811}," model\n",{"type":44,"tag":139,"props":1813,"children":1814},{"class":141,"line":151},[1815,1819,1824,1828,1833],{"type":44,"tag":139,"props":1816,"children":1817},{"style":497},[1818],{"type":50,"value":1786},{"type":44,"tag":139,"props":1820,"children":1821},{"style":503},[1822],{"type":50,"value":1823}," upload",{"type":44,"tag":139,"props":1825,"children":1826},{"style":503},[1827],{"type":50,"value":1801},{"type":44,"tag":139,"props":1829,"children":1830},{"style":503},[1831],{"type":50,"value":1832}," .\u002Ftrain.py",{"type":44,"tag":139,"props":1834,"children":1835},{"style":503},[1836],{"type":50,"value":1837}," train.py\n",{"type":44,"tag":139,"props":1839,"children":1840},{"class":141,"line":160},[1841],{"type":44,"tag":139,"props":1842,"children":1844},{"style":1843},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[1845],{"type":50,"value":1846},"# Use: https:\u002F\u002Fhuggingface.co\u002FUSERNAME\u002Fmy-training-scripts\u002Fresolve\u002Fmain\u002Ftrain.py\n",{"type":44,"tag":239,"props":1848,"children":1850},{"id":1849},"approach-2-trl-maintained-scripts-official-examples",[1851],{"type":50,"value":1852},"Approach 2: TRL Maintained Scripts (Official Examples)",{"type":44,"tag":60,"props":1854,"children":1855},{},[1856],{"type":50,"value":1857},"TRL provides battle-tested scripts for all methods. Can be run from URLs:",{"type":44,"tag":128,"props":1859,"children":1861},{"className":130,"code":1860,"language":23,"meta":132,"style":132},"hf_jobs(\"uv\", {\n    \"script\": \"https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftrl\u002Fblob\u002Fmain\u002Ftrl\u002Fscripts\u002Fsft.py\",\n    \"script_args\": [\n        \"--model_name_or_path\", \"Qwen\u002FQwen2.5-0.5B\",\n        \"--dataset_name\", \"trl-lib\u002FCapybara\",\n        \"--output_dir\", \"my-model\",\n        \"--push_to_hub\",\n        \"--hub_model_id\", \"username\u002Fmy-model\"\n    ],\n    \"flavor\": \"a10g-large\",\n    \"timeout\": \"2h\",\n    \"secrets\": {\"HF_TOKEN\": \"$HF_TOKEN\"}\n})\n",[1862],{"type":44,"tag":135,"props":1863,"children":1864},{"__ignoreMap":132},[1865,1872,1880,1888,1896,1904,1912,1920,1928,1936,1943,1950,1957],{"type":44,"tag":139,"props":1866,"children":1867},{"class":141,"line":142},[1868],{"type":44,"tag":139,"props":1869,"children":1870},{},[1871],{"type":50,"value":1175},{"type":44,"tag":139,"props":1873,"children":1874},{"class":141,"line":151},[1875],{"type":44,"tag":139,"props":1876,"children":1877},{},[1878],{"type":50,"value":1879},"    \"script\": \"https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftrl\u002Fblob\u002Fmain\u002Ftrl\u002Fscripts\u002Fsft.py\",\n",{"type":44,"tag":139,"props":1881,"children":1882},{"class":141,"line":160},[1883],{"type":44,"tag":139,"props":1884,"children":1885},{},[1886],{"type":50,"value":1887},"    \"script_args\": [\n",{"type":44,"tag":139,"props":1889,"children":1890},{"class":141,"line":169},[1891],{"type":44,"tag":139,"props":1892,"children":1893},{},[1894],{"type":50,"value":1895},"        \"--model_name_or_path\", \"Qwen\u002FQwen2.5-0.5B\",\n",{"type":44,"tag":139,"props":1897,"children":1898},{"class":141,"line":1039},[1899],{"type":44,"tag":139,"props":1900,"children":1901},{},[1902],{"type":50,"value":1903},"        \"--dataset_name\", \"trl-lib\u002FCapybara\",\n",{"type":44,"tag":139,"props":1905,"children":1906},{"class":141,"line":1048},[1907],{"type":44,"tag":139,"props":1908,"children":1909},{},[1910],{"type":50,"value":1911},"        \"--output_dir\", \"my-model\",\n",{"type":44,"tag":139,"props":1913,"children":1914},{"class":141,"line":1226},[1915],{"type":44,"tag":139,"props":1916,"children":1917},{},[1918],{"type":50,"value":1919},"        \"--push_to_hub\",\n",{"type":44,"tag":139,"props":1921,"children":1922},{"class":141,"line":1235},[1923],{"type":44,"tag":139,"props":1924,"children":1925},{},[1926],{"type":50,"value":1927},"        \"--hub_model_id\", \"username\u002Fmy-model\"\n",{"type":44,"tag":139,"props":1929,"children":1930},{"class":141,"line":1244},[1931],{"type":44,"tag":139,"props":1932,"children":1933},{},[1934],{"type":50,"value":1935},"    ],\n",{"type":44,"tag":139,"props":1937,"children":1938},{"class":141,"line":1253},[1939],{"type":44,"tag":139,"props":1940,"children":1941},{},[1942],{"type":50,"value":1507},{"type":44,"tag":139,"props":1944,"children":1945},{"class":141,"line":1262},[1946],{"type":44,"tag":139,"props":1947,"children":1948},{},[1949],{"type":50,"value":1516},{"type":44,"tag":139,"props":1951,"children":1952},{"class":141,"line":1270},[1953],{"type":44,"tag":139,"props":1954,"children":1955},{},[1956],{"type":50,"value":1525},{"type":44,"tag":139,"props":1958,"children":1959},{"class":141,"line":1279},[1960],{"type":44,"tag":139,"props":1961,"children":1962},{},[1963],{"type":50,"value":1534},{"type":44,"tag":60,"props":1965,"children":1966},{},[1967,1971,1973,1977,1979,1984,1986],{"type":44,"tag":69,"props":1968,"children":1969},{},[1970],{"type":50,"value":1542},{"type":50,"value":1972}," No code to write, maintained by TRL team, production-tested\n",{"type":44,"tag":69,"props":1974,"children":1975},{},[1976],{"type":50,"value":1549},{"type":50,"value":1978}," Standard TRL training, quick experiments, don't need custom code\n",{"type":44,"tag":69,"props":1980,"children":1981},{},[1982],{"type":50,"value":1983},"Available:",{"type":50,"value":1985}," Scripts are available from ",{"type":44,"tag":568,"props":1987,"children":1990},{"href":1988,"rel":1989},"https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftrl\u002Ftree\u002Fmain\u002Fexamples\u002Fscripts",[572],[1991],{"type":50,"value":1988},{"type":44,"tag":239,"props":1993,"children":1995},{"id":1994},"finding-more-uv-scripts-on-hub",[1996],{"type":50,"value":1997},"Finding More UV Scripts on Hub",{"type":44,"tag":60,"props":1999,"children":2000},{},[2001,2003,2009],{"type":50,"value":2002},"The ",{"type":44,"tag":135,"props":2004,"children":2006},{"className":2005},[],[2007],{"type":50,"value":2008},"uv-scripts",{"type":50,"value":2010}," organization provides ready-to-use UV scripts stored as datasets on Hugging Face Hub:",{"type":44,"tag":128,"props":2012,"children":2014},{"className":130,"code":2013,"language":23,"meta":132,"style":132},"# Discover available UV script collections\ndataset_search({\"author\": \"uv-scripts\", \"sort\": \"downloads\", \"limit\": 20})\n\n# Explore a specific collection\nhub_repo_details([\"uv-scripts\u002Fclassification\"], repo_type=\"dataset\", include_readme=True)\n",[2015],{"type":44,"tag":135,"props":2016,"children":2017},{"__ignoreMap":132},[2018,2026,2034,2041,2049],{"type":44,"tag":139,"props":2019,"children":2020},{"class":141,"line":142},[2021],{"type":44,"tag":139,"props":2022,"children":2023},{},[2024],{"type":50,"value":2025},"# Discover available UV script collections\n",{"type":44,"tag":139,"props":2027,"children":2028},{"class":141,"line":151},[2029],{"type":44,"tag":139,"props":2030,"children":2031},{},[2032],{"type":50,"value":2033},"dataset_search({\"author\": \"uv-scripts\", \"sort\": \"downloads\", \"limit\": 20})\n",{"type":44,"tag":139,"props":2035,"children":2036},{"class":141,"line":160},[2037],{"type":44,"tag":139,"props":2038,"children":2039},{"emptyLinePlaceholder":1033},[2040],{"type":50,"value":1036},{"type":44,"tag":139,"props":2042,"children":2043},{"class":141,"line":169},[2044],{"type":44,"tag":139,"props":2045,"children":2046},{},[2047],{"type":50,"value":2048},"# Explore a specific collection\n",{"type":44,"tag":139,"props":2050,"children":2051},{"class":141,"line":1039},[2052],{"type":44,"tag":139,"props":2053,"children":2054},{},[2055],{"type":50,"value":2056},"hub_repo_details([\"uv-scripts\u002Fclassification\"], repo_type=\"dataset\", include_readme=True)\n",{"type":44,"tag":60,"props":2058,"children":2059},{},[2060,2065],{"type":44,"tag":69,"props":2061,"children":2062},{},[2063],{"type":50,"value":2064},"Popular collections:",{"type":50,"value":2066}," ocr, classification, synthetic-data, vllm, dataset-creation",{"type":44,"tag":239,"props":2068,"children":2070},{"id":2069},"approach-3-hf-jobs-cli-direct-terminal-commands",[2071],{"type":50,"value":2072},"Approach 3: HF Jobs CLI (Direct Terminal Commands)",{"type":44,"tag":60,"props":2074,"children":2075},{},[2076,2078,2083,2085,2091],{"type":50,"value":2077},"When the ",{"type":44,"tag":135,"props":2079,"children":2081},{"className":2080},[],[2082],{"type":50,"value":367},{"type":50,"value":2084}," MCP tool is unavailable, use the ",{"type":44,"tag":135,"props":2086,"children":2088},{"className":2087},[],[2089],{"type":50,"value":2090},"hf jobs",{"type":50,"value":2092}," CLI directly.",{"type":44,"tag":60,"props":2094,"children":2095},{},[2096],{"type":44,"tag":69,"props":2097,"children":2098},{},[2099],{"type":50,"value":2100},"⚠️ CRITICAL: CLI Syntax Rules",{"type":44,"tag":128,"props":2102,"children":2104},{"className":485,"code":2103,"language":487,"meta":132,"style":132},"# ✅ CORRECT syntax - flags BEFORE script URL\nhf jobs uv run --flavor a10g-large --timeout 2h --secrets HF_TOKEN \"https:\u002F\u002Fexample.com\u002Ftrain.py\"\n\n# ❌ WRONG - \"run uv\" instead of \"uv run\"\nhf jobs run uv \"https:\u002F\u002Fexample.com\u002Ftrain.py\" --flavor a10g-large\n\n# ❌ WRONG - flags AFTER script URL (will be ignored!)\nhf jobs uv run \"https:\u002F\u002Fexample.com\u002Ftrain.py\" --flavor a10g-large\n\n# ❌ WRONG - \"--secret\" instead of \"--secrets\" (plural)\nhf jobs uv run --secret HF_TOKEN \"https:\u002F\u002Fexample.com\u002Ftrain.py\"\n",[2105],{"type":44,"tag":135,"props":2106,"children":2107},{"__ignoreMap":132},[2108,2116,2183,2190,2198,2239,2246,2254,2293,2300,2308],{"type":44,"tag":139,"props":2109,"children":2110},{"class":141,"line":142},[2111],{"type":44,"tag":139,"props":2112,"children":2113},{"style":1843},[2114],{"type":50,"value":2115},"# ✅ CORRECT syntax - flags BEFORE script URL\n",{"type":44,"tag":139,"props":2117,"children":2118},{"class":141,"line":151},[2119,2123,2128,2133,2137,2142,2147,2152,2157,2162,2167,2173,2178],{"type":44,"tag":139,"props":2120,"children":2121},{"style":497},[2122],{"type":50,"value":1786},{"type":44,"tag":139,"props":2124,"children":2125},{"style":503},[2126],{"type":50,"value":2127}," jobs",{"type":44,"tag":139,"props":2129,"children":2130},{"style":503},[2131],{"type":50,"value":2132}," uv",{"type":44,"tag":139,"props":2134,"children":2135},{"style":503},[2136],{"type":50,"value":506},{"type":44,"tag":139,"props":2138,"children":2139},{"style":503},[2140],{"type":50,"value":2141}," --flavor",{"type":44,"tag":139,"props":2143,"children":2144},{"style":503},[2145],{"type":50,"value":2146}," a10g-large",{"type":44,"tag":139,"props":2148,"children":2149},{"style":503},[2150],{"type":50,"value":2151}," --timeout",{"type":44,"tag":139,"props":2153,"children":2154},{"style":503},[2155],{"type":50,"value":2156}," 2h",{"type":44,"tag":139,"props":2158,"children":2159},{"style":503},[2160],{"type":50,"value":2161}," --secrets",{"type":44,"tag":139,"props":2163,"children":2164},{"style":503},[2165],{"type":50,"value":2166}," HF_TOKEN",{"type":44,"tag":139,"props":2168,"children":2170},{"style":2169},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[2171],{"type":50,"value":2172}," \"",{"type":44,"tag":139,"props":2174,"children":2175},{"style":503},[2176],{"type":50,"value":2177},"https:\u002F\u002Fexample.com\u002Ftrain.py",{"type":44,"tag":139,"props":2179,"children":2180},{"style":2169},[2181],{"type":50,"value":2182},"\"\n",{"type":44,"tag":139,"props":2184,"children":2185},{"class":141,"line":160},[2186],{"type":44,"tag":139,"props":2187,"children":2188},{"emptyLinePlaceholder":1033},[2189],{"type":50,"value":1036},{"type":44,"tag":139,"props":2191,"children":2192},{"class":141,"line":169},[2193],{"type":44,"tag":139,"props":2194,"children":2195},{"style":1843},[2196],{"type":50,"value":2197},"# ❌ WRONG - \"run uv\" instead of \"uv run\"\n",{"type":44,"tag":139,"props":2199,"children":2200},{"class":141,"line":1039},[2201,2205,2209,2213,2217,2221,2225,2230,2234],{"type":44,"tag":139,"props":2202,"children":2203},{"style":497},[2204],{"type":50,"value":1786},{"type":44,"tag":139,"props":2206,"children":2207},{"style":503},[2208],{"type":50,"value":2127},{"type":44,"tag":139,"props":2210,"children":2211},{"style":503},[2212],{"type":50,"value":506},{"type":44,"tag":139,"props":2214,"children":2215},{"style":503},[2216],{"type":50,"value":2132},{"type":44,"tag":139,"props":2218,"children":2219},{"style":2169},[2220],{"type":50,"value":2172},{"type":44,"tag":139,"props":2222,"children":2223},{"style":503},[2224],{"type":50,"value":2177},{"type":44,"tag":139,"props":2226,"children":2227},{"style":2169},[2228],{"type":50,"value":2229},"\"",{"type":44,"tag":139,"props":2231,"children":2232},{"style":503},[2233],{"type":50,"value":2141},{"type":44,"tag":139,"props":2235,"children":2236},{"style":503},[2237],{"type":50,"value":2238}," a10g-large\n",{"type":44,"tag":139,"props":2240,"children":2241},{"class":141,"line":1048},[2242],{"type":44,"tag":139,"props":2243,"children":2244},{"emptyLinePlaceholder":1033},[2245],{"type":50,"value":1036},{"type":44,"tag":139,"props":2247,"children":2248},{"class":141,"line":1226},[2249],{"type":44,"tag":139,"props":2250,"children":2251},{"style":1843},[2252],{"type":50,"value":2253},"# ❌ WRONG - flags AFTER script URL (will be ignored!)\n",{"type":44,"tag":139,"props":2255,"children":2256},{"class":141,"line":1235},[2257,2261,2265,2269,2273,2277,2281,2285,2289],{"type":44,"tag":139,"props":2258,"children":2259},{"style":497},[2260],{"type":50,"value":1786},{"type":44,"tag":139,"props":2262,"children":2263},{"style":503},[2264],{"type":50,"value":2127},{"type":44,"tag":139,"props":2266,"children":2267},{"style":503},[2268],{"type":50,"value":2132},{"type":44,"tag":139,"props":2270,"children":2271},{"style":503},[2272],{"type":50,"value":506},{"type":44,"tag":139,"props":2274,"children":2275},{"style":2169},[2276],{"type":50,"value":2172},{"type":44,"tag":139,"props":2278,"children":2279},{"style":503},[2280],{"type":50,"value":2177},{"type":44,"tag":139,"props":2282,"children":2283},{"style":2169},[2284],{"type":50,"value":2229},{"type":44,"tag":139,"props":2286,"children":2287},{"style":503},[2288],{"type":50,"value":2141},{"type":44,"tag":139,"props":2290,"children":2291},{"style":503},[2292],{"type":50,"value":2238},{"type":44,"tag":139,"props":2294,"children":2295},{"class":141,"line":1244},[2296],{"type":44,"tag":139,"props":2297,"children":2298},{"emptyLinePlaceholder":1033},[2299],{"type":50,"value":1036},{"type":44,"tag":139,"props":2301,"children":2302},{"class":141,"line":1253},[2303],{"type":44,"tag":139,"props":2304,"children":2305},{"style":1843},[2306],{"type":50,"value":2307},"# ❌ WRONG - \"--secret\" instead of \"--secrets\" (plural)\n",{"type":44,"tag":139,"props":2309,"children":2310},{"class":141,"line":1262},[2311,2315,2319,2323,2327,2332,2336,2340,2344],{"type":44,"tag":139,"props":2312,"children":2313},{"style":497},[2314],{"type":50,"value":1786},{"type":44,"tag":139,"props":2316,"children":2317},{"style":503},[2318],{"type":50,"value":2127},{"type":44,"tag":139,"props":2320,"children":2321},{"style":503},[2322],{"type":50,"value":2132},{"type":44,"tag":139,"props":2324,"children":2325},{"style":503},[2326],{"type":50,"value":506},{"type":44,"tag":139,"props":2328,"children":2329},{"style":503},[2330],{"type":50,"value":2331}," --secret",{"type":44,"tag":139,"props":2333,"children":2334},{"style":503},[2335],{"type":50,"value":2166},{"type":44,"tag":139,"props":2337,"children":2338},{"style":2169},[2339],{"type":50,"value":2172},{"type":44,"tag":139,"props":2341,"children":2342},{"style":503},[2343],{"type":50,"value":2177},{"type":44,"tag":139,"props":2345,"children":2346},{"style":2169},[2347],{"type":50,"value":2182},{"type":44,"tag":60,"props":2349,"children":2350},{},[2351],{"type":44,"tag":69,"props":2352,"children":2353},{},[2354],{"type":50,"value":2355},"Key syntax rules:",{"type":44,"tag":351,"props":2357,"children":2358},{},[2359,2379,2406,2423],{"type":44,"tag":79,"props":2360,"children":2361},{},[2362,2364,2370,2372,2378],{"type":50,"value":2363},"Command order is ",{"type":44,"tag":135,"props":2365,"children":2367},{"className":2366},[],[2368],{"type":50,"value":2369},"hf jobs uv run",{"type":50,"value":2371}," (NOT ",{"type":44,"tag":135,"props":2373,"children":2375},{"className":2374},[],[2376],{"type":50,"value":2377},"hf jobs run uv",{"type":50,"value":994},{"type":44,"tag":79,"props":2380,"children":2381},{},[2382,2384,2390,2391,2397,2398,2404],{"type":50,"value":2383},"All flags (",{"type":44,"tag":135,"props":2385,"children":2387},{"className":2386},[],[2388],{"type":50,"value":2389},"--flavor",{"type":50,"value":455},{"type":44,"tag":135,"props":2392,"children":2394},{"className":2393},[],[2395],{"type":50,"value":2396},"--timeout",{"type":50,"value":455},{"type":44,"tag":135,"props":2399,"children":2401},{"className":2400},[],[2402],{"type":50,"value":2403},"--secrets",{"type":50,"value":2405},") must come BEFORE the script URL",{"type":44,"tag":79,"props":2407,"children":2408},{},[2409,2410,2415,2417],{"type":50,"value":249},{"type":44,"tag":135,"props":2411,"children":2413},{"className":2412},[],[2414],{"type":50,"value":2403},{"type":50,"value":2416}," (plural), not ",{"type":44,"tag":135,"props":2418,"children":2420},{"className":2419},[],[2421],{"type":50,"value":2422},"--secret",{"type":44,"tag":79,"props":2424,"children":2425},{},[2426],{"type":50,"value":2427},"Script URL must be the last positional argument",{"type":44,"tag":60,"props":2429,"children":2430},{},[2431],{"type":44,"tag":69,"props":2432,"children":2433},{},[2434],{"type":50,"value":2435},"Complete CLI example:",{"type":44,"tag":128,"props":2437,"children":2439},{"className":485,"code":2438,"language":487,"meta":132,"style":132},"hf jobs uv run \\\n  --flavor a10g-large \\\n  --timeout 2h \\\n  --secrets HF_TOKEN \\\n  \"https:\u002F\u002Fhuggingface.co\u002Fuser\u002Frepo\u002Fresolve\u002Fmain\u002Ftrain.py\"\n",[2440],{"type":44,"tag":135,"props":2441,"children":2442},{"__ignoreMap":132},[2443,2468,2484,2500,2516],{"type":44,"tag":139,"props":2444,"children":2445},{"class":141,"line":142},[2446,2450,2454,2458,2462],{"type":44,"tag":139,"props":2447,"children":2448},{"style":497},[2449],{"type":50,"value":1786},{"type":44,"tag":139,"props":2451,"children":2452},{"style":503},[2453],{"type":50,"value":2127},{"type":44,"tag":139,"props":2455,"children":2456},{"style":503},[2457],{"type":50,"value":2132},{"type":44,"tag":139,"props":2459,"children":2460},{"style":503},[2461],{"type":50,"value":506},{"type":44,"tag":139,"props":2463,"children":2465},{"style":2464},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[2466],{"type":50,"value":2467}," \\\n",{"type":44,"tag":139,"props":2469,"children":2470},{"class":141,"line":151},[2471,2476,2480],{"type":44,"tag":139,"props":2472,"children":2473},{"style":503},[2474],{"type":50,"value":2475},"  --flavor",{"type":44,"tag":139,"props":2477,"children":2478},{"style":503},[2479],{"type":50,"value":2146},{"type":44,"tag":139,"props":2481,"children":2482},{"style":2464},[2483],{"type":50,"value":2467},{"type":44,"tag":139,"props":2485,"children":2486},{"class":141,"line":160},[2487,2492,2496],{"type":44,"tag":139,"props":2488,"children":2489},{"style":503},[2490],{"type":50,"value":2491},"  --timeout",{"type":44,"tag":139,"props":2493,"children":2494},{"style":503},[2495],{"type":50,"value":2156},{"type":44,"tag":139,"props":2497,"children":2498},{"style":2464},[2499],{"type":50,"value":2467},{"type":44,"tag":139,"props":2501,"children":2502},{"class":141,"line":169},[2503,2508,2512],{"type":44,"tag":139,"props":2504,"children":2505},{"style":503},[2506],{"type":50,"value":2507},"  --secrets",{"type":44,"tag":139,"props":2509,"children":2510},{"style":503},[2511],{"type":50,"value":2166},{"type":44,"tag":139,"props":2513,"children":2514},{"style":2464},[2515],{"type":50,"value":2467},{"type":44,"tag":139,"props":2517,"children":2518},{"class":141,"line":1039},[2519,2524,2529],{"type":44,"tag":139,"props":2520,"children":2521},{"style":2169},[2522],{"type":50,"value":2523},"  \"",{"type":44,"tag":139,"props":2525,"children":2526},{"style":503},[2527],{"type":50,"value":2528},"https:\u002F\u002Fhuggingface.co\u002Fuser\u002Frepo\u002Fresolve\u002Fmain\u002Ftrain.py",{"type":44,"tag":139,"props":2530,"children":2531},{"style":2169},[2532],{"type":50,"value":2182},{"type":44,"tag":60,"props":2534,"children":2535},{},[2536],{"type":44,"tag":69,"props":2537,"children":2538},{},[2539],{"type":50,"value":2540},"Check job status via CLI:",{"type":44,"tag":128,"props":2542,"children":2544},{"className":485,"code":2543,"language":487,"meta":132,"style":132},"hf jobs ps                        # List all jobs\nhf jobs logs \u003Cjob-id>             # View logs\nhf jobs inspect \u003Cjob-id>          # Job details\nhf jobs cancel \u003Cjob-id>           # Cancel a job\n",[2545],{"type":44,"tag":135,"props":2546,"children":2547},{"__ignoreMap":132},[2548,2569,2610,2647],{"type":44,"tag":139,"props":2549,"children":2550},{"class":141,"line":142},[2551,2555,2559,2564],{"type":44,"tag":139,"props":2552,"children":2553},{"style":497},[2554],{"type":50,"value":1786},{"type":44,"tag":139,"props":2556,"children":2557},{"style":503},[2558],{"type":50,"value":2127},{"type":44,"tag":139,"props":2560,"children":2561},{"style":503},[2562],{"type":50,"value":2563}," ps",{"type":44,"tag":139,"props":2565,"children":2566},{"style":1843},[2567],{"type":50,"value":2568},"                        # List all jobs\n",{"type":44,"tag":139,"props":2570,"children":2571},{"class":141,"line":151},[2572,2576,2580,2585,2590,2595,2600,2605],{"type":44,"tag":139,"props":2573,"children":2574},{"style":497},[2575],{"type":50,"value":1786},{"type":44,"tag":139,"props":2577,"children":2578},{"style":503},[2579],{"type":50,"value":2127},{"type":44,"tag":139,"props":2581,"children":2582},{"style":503},[2583],{"type":50,"value":2584}," logs",{"type":44,"tag":139,"props":2586,"children":2587},{"style":2169},[2588],{"type":50,"value":2589}," \u003C",{"type":44,"tag":139,"props":2591,"children":2592},{"style":503},[2593],{"type":50,"value":2594},"job-i",{"type":44,"tag":139,"props":2596,"children":2597},{"style":2464},[2598],{"type":50,"value":2599},"d",{"type":44,"tag":139,"props":2601,"children":2602},{"style":2169},[2603],{"type":50,"value":2604},">",{"type":44,"tag":139,"props":2606,"children":2607},{"style":1843},[2608],{"type":50,"value":2609},"             # View logs\n",{"type":44,"tag":139,"props":2611,"children":2612},{"class":141,"line":160},[2613,2617,2621,2626,2630,2634,2638,2642],{"type":44,"tag":139,"props":2614,"children":2615},{"style":497},[2616],{"type":50,"value":1786},{"type":44,"tag":139,"props":2618,"children":2619},{"style":503},[2620],{"type":50,"value":2127},{"type":44,"tag":139,"props":2622,"children":2623},{"style":503},[2624],{"type":50,"value":2625}," inspect",{"type":44,"tag":139,"props":2627,"children":2628},{"style":2169},[2629],{"type":50,"value":2589},{"type":44,"tag":139,"props":2631,"children":2632},{"style":503},[2633],{"type":50,"value":2594},{"type":44,"tag":139,"props":2635,"children":2636},{"style":2464},[2637],{"type":50,"value":2599},{"type":44,"tag":139,"props":2639,"children":2640},{"style":2169},[2641],{"type":50,"value":2604},{"type":44,"tag":139,"props":2643,"children":2644},{"style":1843},[2645],{"type":50,"value":2646},"          # Job details\n",{"type":44,"tag":139,"props":2648,"children":2649},{"class":141,"line":169},[2650,2654,2658,2663,2667,2671,2675,2679],{"type":44,"tag":139,"props":2651,"children":2652},{"style":497},[2653],{"type":50,"value":1786},{"type":44,"tag":139,"props":2655,"children":2656},{"style":503},[2657],{"type":50,"value":2127},{"type":44,"tag":139,"props":2659,"children":2660},{"style":503},[2661],{"type":50,"value":2662}," cancel",{"type":44,"tag":139,"props":2664,"children":2665},{"style":2169},[2666],{"type":50,"value":2589},{"type":44,"tag":139,"props":2668,"children":2669},{"style":503},[2670],{"type":50,"value":2594},{"type":44,"tag":139,"props":2672,"children":2673},{"style":2464},[2674],{"type":50,"value":2599},{"type":44,"tag":139,"props":2676,"children":2677},{"style":2169},[2678],{"type":50,"value":2604},{"type":44,"tag":139,"props":2680,"children":2681},{"style":1843},[2682],{"type":50,"value":2683},"           # Cancel a job\n",{"type":44,"tag":239,"props":2685,"children":2687},{"id":2686},"approach-4-trl-jobs-package-simplified-training",[2688],{"type":50,"value":2689},"Approach 4: TRL Jobs Package (Simplified Training)",{"type":44,"tag":60,"props":2691,"children":2692},{},[2693,2694,2699],{"type":50,"value":2002},{"type":44,"tag":135,"props":2695,"children":2697},{"className":2696},[],[2698],{"type":50,"value":385},{"type":50,"value":2700}," package provides optimized defaults and one-liner training.",{"type":44,"tag":128,"props":2702,"children":2704},{"className":485,"code":2703,"language":487,"meta":132,"style":132},"uvx trl-jobs sft \\\n  --model_name Qwen\u002FQwen2.5-0.5B \\\n  --dataset_name trl-lib\u002FCapybara\n\n",[2705],{"type":44,"tag":135,"props":2706,"children":2707},{"__ignoreMap":132},[2708,2730,2747],{"type":44,"tag":139,"props":2709,"children":2710},{"class":141,"line":142},[2711,2716,2721,2726],{"type":44,"tag":139,"props":2712,"children":2713},{"style":497},[2714],{"type":50,"value":2715},"uvx",{"type":44,"tag":139,"props":2717,"children":2718},{"style":503},[2719],{"type":50,"value":2720}," trl-jobs",{"type":44,"tag":139,"props":2722,"children":2723},{"style":503},[2724],{"type":50,"value":2725}," sft",{"type":44,"tag":139,"props":2727,"children":2728},{"style":2464},[2729],{"type":50,"value":2467},{"type":44,"tag":139,"props":2731,"children":2732},{"class":141,"line":151},[2733,2738,2743],{"type":44,"tag":139,"props":2734,"children":2735},{"style":503},[2736],{"type":50,"value":2737},"  --model_name",{"type":44,"tag":139,"props":2739,"children":2740},{"style":503},[2741],{"type":50,"value":2742}," Qwen\u002FQwen2.5-0.5B",{"type":44,"tag":139,"props":2744,"children":2745},{"style":2464},[2746],{"type":50,"value":2467},{"type":44,"tag":139,"props":2748,"children":2749},{"class":141,"line":160},[2750,2755],{"type":44,"tag":139,"props":2751,"children":2752},{"style":503},[2753],{"type":50,"value":2754},"  --dataset_name",{"type":44,"tag":139,"props":2756,"children":2757},{"style":503},[2758],{"type":50,"value":2759}," trl-lib\u002FCapybara\n",{"type":44,"tag":60,"props":2761,"children":2762},{},[2763,2767,2769,2773,2775,2780,2781],{"type":44,"tag":69,"props":2764,"children":2765},{},[2766],{"type":50,"value":1542},{"type":50,"value":2768}," Pre-configured settings, automatic Trackio integration, automatic Hub push, one-line commands\n",{"type":44,"tag":69,"props":2770,"children":2771},{},[2772],{"type":50,"value":1549},{"type":50,"value":2774}," User working in terminal directly (not Claude Code context), quick local experimentation\n",{"type":44,"tag":69,"props":2776,"children":2777},{},[2778],{"type":50,"value":2779},"Repository:",{"type":50,"value":185},{"type":44,"tag":568,"props":2782,"children":2785},{"href":2783,"rel":2784},"https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftrl-jobs",[572],[2786],{"type":50,"value":2783},{"type":44,"tag":60,"props":2788,"children":2789},{},[2790,2791],{"type":50,"value":695},{"type":44,"tag":69,"props":2792,"children":2793},{},[2794,2796,2801],{"type":50,"value":2795},"In Claude Code context, prefer using ",{"type":44,"tag":135,"props":2797,"children":2799},{"className":2798},[],[2800],{"type":50,"value":367},{"type":50,"value":2802}," MCP tool (Approach 1) when available.",{"type":44,"tag":53,"props":2804,"children":2806},{"id":2805},"hardware-selection",[2807],{"type":50,"value":2808},"Hardware Selection",{"type":44,"tag":2810,"props":2811,"children":2812},"table",{},[2813,2842],{"type":44,"tag":2814,"props":2815,"children":2816},"thead",{},[2817],{"type":44,"tag":2818,"props":2819,"children":2820},"tr",{},[2821,2827,2832,2837],{"type":44,"tag":2822,"props":2823,"children":2824},"th",{},[2825],{"type":50,"value":2826},"Model Size",{"type":44,"tag":2822,"props":2828,"children":2829},{},[2830],{"type":50,"value":2831},"Recommended Hardware",{"type":44,"tag":2822,"props":2833,"children":2834},{},[2835],{"type":50,"value":2836},"Cost (approx\u002Fhr)",{"type":44,"tag":2822,"props":2838,"children":2839},{},[2840],{"type":50,"value":2841},"Use Case",{"type":44,"tag":2843,"props":2844,"children":2845},"tbody",{},[2846,2874,2908,2942,2975],{"type":44,"tag":2818,"props":2847,"children":2848},{},[2849,2855,2864,2869],{"type":44,"tag":2850,"props":2851,"children":2852},"td",{},[2853],{"type":50,"value":2854},"\u003C1B params",{"type":44,"tag":2850,"props":2856,"children":2857},{},[2858],{"type":44,"tag":135,"props":2859,"children":2861},{"className":2860},[],[2862],{"type":50,"value":2863},"t4-small",{"type":44,"tag":2850,"props":2865,"children":2866},{},[2867],{"type":50,"value":2868},"~$0.75",{"type":44,"tag":2850,"props":2870,"children":2871},{},[2872],{"type":50,"value":2873},"Demos, quick tests only without eval steps",{"type":44,"tag":2818,"props":2875,"children":2876},{},[2877,2882,2898,2903],{"type":44,"tag":2850,"props":2878,"children":2879},{},[2880],{"type":50,"value":2881},"1-3B params",{"type":44,"tag":2850,"props":2883,"children":2884},{},[2885,2891,2892],{"type":44,"tag":135,"props":2886,"children":2888},{"className":2887},[],[2889],{"type":50,"value":2890},"t4-medium",{"type":50,"value":455},{"type":44,"tag":135,"props":2893,"children":2895},{"className":2894},[],[2896],{"type":50,"value":2897},"l4x1",{"type":44,"tag":2850,"props":2899,"children":2900},{},[2901],{"type":50,"value":2902},"~$1.50-2.50",{"type":44,"tag":2850,"props":2904,"children":2905},{},[2906],{"type":50,"value":2907},"Development",{"type":44,"tag":2818,"props":2909,"children":2910},{},[2911,2916,2932,2937],{"type":44,"tag":2850,"props":2912,"children":2913},{},[2914],{"type":50,"value":2915},"3-7B params",{"type":44,"tag":2850,"props":2917,"children":2918},{},[2919,2925,2926],{"type":44,"tag":135,"props":2920,"children":2922},{"className":2921},[],[2923],{"type":50,"value":2924},"a10g-small",{"type":50,"value":455},{"type":44,"tag":135,"props":2927,"children":2929},{"className":2928},[],[2930],{"type":50,"value":2931},"a10g-large",{"type":44,"tag":2850,"props":2933,"children":2934},{},[2935],{"type":50,"value":2936},"~$3.50-5.00",{"type":44,"tag":2850,"props":2938,"children":2939},{},[2940],{"type":50,"value":2941},"Production training",{"type":44,"tag":2818,"props":2943,"children":2944},{},[2945,2950,2965,2970],{"type":44,"tag":2850,"props":2946,"children":2947},{},[2948],{"type":50,"value":2949},"7-13B params",{"type":44,"tag":2850,"props":2951,"children":2952},{},[2953,2958,2959],{"type":44,"tag":135,"props":2954,"children":2956},{"className":2955},[],[2957],{"type":50,"value":2931},{"type":50,"value":455},{"type":44,"tag":135,"props":2960,"children":2962},{"className":2961},[],[2963],{"type":50,"value":2964},"a100-large",{"type":44,"tag":2850,"props":2966,"children":2967},{},[2968],{"type":50,"value":2969},"~$5-10",{"type":44,"tag":2850,"props":2971,"children":2972},{},[2973],{"type":50,"value":2974},"Large models (use LoRA)",{"type":44,"tag":2818,"props":2976,"children":2977},{},[2978,2983,2998,3003],{"type":44,"tag":2850,"props":2979,"children":2980},{},[2981],{"type":50,"value":2982},"13B+ params",{"type":44,"tag":2850,"props":2984,"children":2985},{},[2986,2991,2992],{"type":44,"tag":135,"props":2987,"children":2989},{"className":2988},[],[2990],{"type":50,"value":2964},{"type":50,"value":455},{"type":44,"tag":135,"props":2993,"children":2995},{"className":2994},[],[2996],{"type":50,"value":2997},"a10g-largex2",{"type":44,"tag":2850,"props":2999,"children":3000},{},[3001],{"type":50,"value":3002},"~$10-20",{"type":44,"tag":2850,"props":3004,"children":3005},{},[3006],{"type":50,"value":3007},"Very large (use LoRA)",{"type":44,"tag":60,"props":3009,"children":3010},{},[3011,3016],{"type":44,"tag":69,"props":3012,"children":3013},{},[3014],{"type":50,"value":3015},"GPU Flavors:",{"type":50,"value":3017}," cpu-basic\u002Fupgrade\u002Fperformance\u002Fxl, t4-small\u002Fmedium, l4x1\u002Fx4, a10g-small\u002Flarge\u002Flargex2\u002Flargex4, a100-large, h100\u002Fh100x8",{"type":44,"tag":60,"props":3019,"children":3020},{},[3021],{"type":44,"tag":69,"props":3022,"children":3023},{},[3024],{"type":50,"value":3025},"Guidelines:",{"type":44,"tag":75,"props":3027,"children":3028},{},[3029,3040,3045],{"type":44,"tag":79,"props":3030,"children":3031},{},[3032,3033,3038],{"type":50,"value":249},{"type":44,"tag":69,"props":3034,"children":3035},{},[3036],{"type":50,"value":3037},"LoRA\u002FPEFT",{"type":50,"value":3039}," for models >7B to reduce memory",{"type":44,"tag":79,"props":3041,"children":3042},{},[3043],{"type":50,"value":3044},"Multi-GPU automatically handled by TRL\u002FAccelerate",{"type":44,"tag":79,"props":3046,"children":3047},{},[3048],{"type":50,"value":3049},"Start with smaller hardware for testing",{"type":44,"tag":60,"props":3051,"children":3052},{},[3053,3058,3059,3065],{"type":44,"tag":69,"props":3054,"children":3055},{},[3056],{"type":50,"value":3057},"See:",{"type":50,"value":185},{"type":44,"tag":135,"props":3060,"children":3062},{"className":3061},[],[3063],{"type":50,"value":3064},"references\u002Fhardware_guide.md",{"type":50,"value":3066}," for detailed specifications",{"type":44,"tag":53,"props":3068,"children":3070},{"id":3069},"critical-saving-results-to-hub",[3071],{"type":50,"value":3072},"Critical: Saving Results to Hub",{"type":44,"tag":60,"props":3074,"children":3075},{},[3076],{"type":44,"tag":69,"props":3077,"children":3078},{},[3079],{"type":50,"value":3080},"⚠️ EPHEMERAL ENVIRONMENT—MUST PUSH TO HUB",{"type":44,"tag":60,"props":3082,"children":3083},{},[3084,3086,3091],{"type":50,"value":3085},"The Jobs environment is temporary. All files are deleted when the job ends. If the model isn't pushed to Hub, ",{"type":44,"tag":69,"props":3087,"children":3088},{},[3089],{"type":50,"value":3090},"ALL TRAINING IS LOST",{"type":50,"value":409},{"type":44,"tag":239,"props":3093,"children":3095},{"id":3094},"required-configuration",[3096],{"type":50,"value":3097},"Required Configuration",{"type":44,"tag":60,"props":3099,"children":3100},{},[3101],{"type":44,"tag":69,"props":3102,"children":3103},{},[3104],{"type":50,"value":3105},"In training script\u002Fconfig:",{"type":44,"tag":128,"props":3107,"children":3109},{"className":130,"code":3108,"language":23,"meta":132,"style":132},"SFTConfig(\n    push_to_hub=True,\n    hub_model_id=\"username\u002Fmodel-name\",  # MUST specify\n    hub_strategy=\"every_save\",  # Optional: push checkpoints\n)\n",[3110],{"type":44,"tag":135,"props":3111,"children":3112},{"__ignoreMap":132},[3113,3121,3129,3137,3145],{"type":44,"tag":139,"props":3114,"children":3115},{"class":141,"line":142},[3116],{"type":44,"tag":139,"props":3117,"children":3118},{},[3119],{"type":50,"value":3120},"SFTConfig(\n",{"type":44,"tag":139,"props":3122,"children":3123},{"class":141,"line":151},[3124],{"type":44,"tag":139,"props":3125,"children":3126},{},[3127],{"type":50,"value":3128},"    push_to_hub=True,\n",{"type":44,"tag":139,"props":3130,"children":3131},{"class":141,"line":160},[3132],{"type":44,"tag":139,"props":3133,"children":3134},{},[3135],{"type":50,"value":3136},"    hub_model_id=\"username\u002Fmodel-name\",  # MUST specify\n",{"type":44,"tag":139,"props":3138,"children":3139},{"class":141,"line":169},[3140],{"type":44,"tag":139,"props":3141,"children":3142},{},[3143],{"type":50,"value":3144},"    hub_strategy=\"every_save\",  # Optional: push checkpoints\n",{"type":44,"tag":139,"props":3146,"children":3147},{"class":141,"line":1039},[3148],{"type":44,"tag":139,"props":3149,"children":3150},{},[3151],{"type":50,"value":1463},{"type":44,"tag":60,"props":3153,"children":3154},{},[3155],{"type":44,"tag":69,"props":3156,"children":3157},{},[3158],{"type":50,"value":3159},"In job submission:",{"type":44,"tag":128,"props":3161,"children":3163},{"className":130,"code":3162,"language":23,"meta":132,"style":132},"{\n    \"secrets\": {\"HF_TOKEN\": \"$HF_TOKEN\"}  # Enables authentication\n}\n",[3164],{"type":44,"tag":135,"props":3165,"children":3166},{"__ignoreMap":132},[3167,3175,3183],{"type":44,"tag":139,"props":3168,"children":3169},{"class":141,"line":142},[3170],{"type":44,"tag":139,"props":3171,"children":3172},{},[3173],{"type":50,"value":3174},"{\n",{"type":44,"tag":139,"props":3176,"children":3177},{"class":141,"line":151},[3178],{"type":44,"tag":139,"props":3179,"children":3180},{},[3181],{"type":50,"value":3182},"    \"secrets\": {\"HF_TOKEN\": \"$HF_TOKEN\"}  # Enables authentication\n",{"type":44,"tag":139,"props":3184,"children":3185},{"class":141,"line":160},[3186],{"type":44,"tag":139,"props":3187,"children":3188},{},[3189],{"type":50,"value":3190},"}\n",{"type":44,"tag":239,"props":3192,"children":3194},{"id":3193},"verification-checklist",[3195],{"type":50,"value":3196},"Verification Checklist",{"type":44,"tag":60,"props":3198,"children":3199},{},[3200],{"type":50,"value":3201},"Before submitting:",{"type":44,"tag":75,"props":3203,"children":3206},{"className":3204},[3205],"contains-task-list",[3207,3225,3241,3257],{"type":44,"tag":79,"props":3208,"children":3211},{"className":3209},[3210],"task-list-item",[3212,3217,3218,3223],{"type":44,"tag":3213,"props":3214,"children":3216},"input",{"disabled":1033,"type":3215},"checkbox",[],{"type":50,"value":185},{"type":44,"tag":135,"props":3219,"children":3221},{"className":3220},[],[3222],{"type":50,"value":729},{"type":50,"value":3224}," set in config",{"type":44,"tag":79,"props":3226,"children":3228},{"className":3227},[3210],[3229,3232,3233,3239],{"type":44,"tag":3213,"props":3230,"children":3231},{"disabled":1033,"type":3215},[],{"type":50,"value":185},{"type":44,"tag":135,"props":3234,"children":3236},{"className":3235},[],[3237],{"type":50,"value":3238},"hub_model_id",{"type":50,"value":3240}," includes username\u002Frepo-name",{"type":44,"tag":79,"props":3242,"children":3244},{"className":3243},[3210],[3245,3248,3249,3255],{"type":44,"tag":3213,"props":3246,"children":3247},{"disabled":1033,"type":3215},[],{"type":50,"value":185},{"type":44,"tag":135,"props":3250,"children":3252},{"className":3251},[],[3253],{"type":50,"value":3254},"secrets",{"type":50,"value":3256}," parameter includes HF_TOKEN",{"type":44,"tag":79,"props":3258,"children":3260},{"className":3259},[3210],[3261,3264],{"type":44,"tag":3213,"props":3262,"children":3263},{"disabled":1033,"type":3215},[],{"type":50,"value":3265}," User has write access to target repo",{"type":44,"tag":60,"props":3267,"children":3268},{},[3269,3273,3274,3280],{"type":44,"tag":69,"props":3270,"children":3271},{},[3272],{"type":50,"value":3057},{"type":50,"value":185},{"type":44,"tag":135,"props":3275,"children":3277},{"className":3276},[],[3278],{"type":50,"value":3279},"references\u002Fhub_saving.md",{"type":50,"value":3281}," for detailed troubleshooting",{"type":44,"tag":53,"props":3283,"children":3285},{"id":3284},"timeout-management",[3286],{"type":50,"value":3287},"Timeout Management",{"type":44,"tag":60,"props":3289,"children":3290},{},[3291],{"type":44,"tag":69,"props":3292,"children":3293},{},[3294],{"type":50,"value":3295},"⚠️ DEFAULT: 30 MINUTES—TOO SHORT FOR TRAINING",{"type":44,"tag":239,"props":3297,"children":3299},{"id":3298},"setting-timeouts",[3300],{"type":50,"value":3301},"Setting Timeouts",{"type":44,"tag":128,"props":3303,"children":3305},{"className":130,"code":3304,"language":23,"meta":132,"style":132},"{\n    \"timeout\": \"2h\"   # 2 hours (formats: \"90m\", \"2h\", \"1.5h\", or seconds as integer)\n}\n",[3306],{"type":44,"tag":135,"props":3307,"children":3308},{"__ignoreMap":132},[3309,3316,3324],{"type":44,"tag":139,"props":3310,"children":3311},{"class":141,"line":142},[3312],{"type":44,"tag":139,"props":3313,"children":3314},{},[3315],{"type":50,"value":3174},{"type":44,"tag":139,"props":3317,"children":3318},{"class":141,"line":151},[3319],{"type":44,"tag":139,"props":3320,"children":3321},{},[3322],{"type":50,"value":3323},"    \"timeout\": \"2h\"   # 2 hours (formats: \"90m\", \"2h\", \"1.5h\", or seconds as integer)\n",{"type":44,"tag":139,"props":3325,"children":3326},{"class":141,"line":160},[3327],{"type":44,"tag":139,"props":3328,"children":3329},{},[3330],{"type":50,"value":3190},{"type":44,"tag":239,"props":3332,"children":3334},{"id":3333},"timeout-guidelines",[3335],{"type":50,"value":3336},"Timeout Guidelines",{"type":44,"tag":2810,"props":3338,"children":3339},{},[3340,3361],{"type":44,"tag":2814,"props":3341,"children":3342},{},[3343],{"type":44,"tag":2818,"props":3344,"children":3345},{},[3346,3351,3356],{"type":44,"tag":2822,"props":3347,"children":3348},{},[3349],{"type":50,"value":3350},"Scenario",{"type":44,"tag":2822,"props":3352,"children":3353},{},[3354],{"type":50,"value":3355},"Recommended",{"type":44,"tag":2822,"props":3357,"children":3358},{},[3359],{"type":50,"value":3360},"Notes",{"type":44,"tag":2843,"props":3362,"children":3363},{},[3364,3382,3400,3418],{"type":44,"tag":2818,"props":3365,"children":3366},{},[3367,3372,3377],{"type":44,"tag":2850,"props":3368,"children":3369},{},[3370],{"type":50,"value":3371},"Quick demo (50-100 examples)",{"type":44,"tag":2850,"props":3373,"children":3374},{},[3375],{"type":50,"value":3376},"10-30 min",{"type":44,"tag":2850,"props":3378,"children":3379},{},[3380],{"type":50,"value":3381},"Verify setup",{"type":44,"tag":2818,"props":3383,"children":3384},{},[3385,3390,3395],{"type":44,"tag":2850,"props":3386,"children":3387},{},[3388],{"type":50,"value":3389},"Development training",{"type":44,"tag":2850,"props":3391,"children":3392},{},[3393],{"type":50,"value":3394},"1-2 hours",{"type":44,"tag":2850,"props":3396,"children":3397},{},[3398],{"type":50,"value":3399},"Small datasets",{"type":44,"tag":2818,"props":3401,"children":3402},{},[3403,3408,3413],{"type":44,"tag":2850,"props":3404,"children":3405},{},[3406],{"type":50,"value":3407},"Production (3-7B model)",{"type":44,"tag":2850,"props":3409,"children":3410},{},[3411],{"type":50,"value":3412},"4-6 hours",{"type":44,"tag":2850,"props":3414,"children":3415},{},[3416],{"type":50,"value":3417},"Full datasets",{"type":44,"tag":2818,"props":3419,"children":3420},{},[3421,3426,3431],{"type":44,"tag":2850,"props":3422,"children":3423},{},[3424],{"type":50,"value":3425},"Large model with LoRA",{"type":44,"tag":2850,"props":3427,"children":3428},{},[3429],{"type":50,"value":3430},"3-6 hours",{"type":44,"tag":2850,"props":3432,"children":3433},{},[3434],{"type":50,"value":3435},"Depends on dataset",{"type":44,"tag":60,"props":3437,"children":3438},{},[3439,3444],{"type":44,"tag":69,"props":3440,"children":3441},{},[3442],{"type":50,"value":3443},"Always add 20-30% buffer",{"type":50,"value":3445}," for model\u002Fdataset loading, checkpoint saving, Hub push operations, and network delays.",{"type":44,"tag":60,"props":3447,"children":3448},{},[3449,3454],{"type":44,"tag":69,"props":3450,"children":3451},{},[3452],{"type":50,"value":3453},"On timeout:",{"type":50,"value":3455}," Job killed immediately, all unsaved progress lost, must restart from beginning",{"type":44,"tag":53,"props":3457,"children":3459},{"id":3458},"choose-a-base-model-model-selection",[3460],{"type":50,"value":3461},"Choose a Base Model (Model Selection)",{"type":44,"tag":60,"props":3463,"children":3464},{},[3465],{"type":44,"tag":69,"props":3466,"children":3467},{},[3468],{"type":50,"value":3469},"Identify models to train based on task type or benchmark results.",{"type":44,"tag":60,"props":3471,"children":3472},{},[3473,3474,3480],{"type":50,"value":249},{"type":44,"tag":135,"props":3475,"children":3477},{"className":3476},[],[3478],{"type":50,"value":3479},"scripts\u002Fhf_benchmarks.py",{"type":50,"value":3481}," to identify top-performing models for specific tasks. This helps the user select a model as the base for training, whilst keeping size and hardware constraints in mind.",{"type":44,"tag":128,"props":3483,"children":3485},{"className":485,"code":3484,"language":487,"meta":132,"style":132},"# Get help on the benchmarks command:\nuv run scripts\u002Fhf_benchmarks.py --help\n",[3486],{"type":44,"tag":135,"props":3487,"children":3488},{"__ignoreMap":132},[3489,3497],{"type":44,"tag":139,"props":3490,"children":3491},{"class":141,"line":142},[3492],{"type":44,"tag":139,"props":3493,"children":3494},{"style":1843},[3495],{"type":50,"value":3496},"# Get help on the benchmarks command:\n",{"type":44,"tag":139,"props":3498,"children":3499},{"class":141,"line":151},[3500,3504,3508,3513],{"type":44,"tag":139,"props":3501,"children":3502},{"style":497},[3503],{"type":50,"value":500},{"type":44,"tag":139,"props":3505,"children":3506},{"style":503},[3507],{"type":50,"value":506},{"type":44,"tag":139,"props":3509,"children":3510},{"style":503},[3511],{"type":50,"value":3512}," scripts\u002Fhf_benchmarks.py",{"type":44,"tag":139,"props":3514,"children":3515},{"style":503},[3516],{"type":50,"value":516},{"type":44,"tag":239,"props":3518,"children":3520},{"id":3519},"example-choosing-an-ocr-base-model",[3521],{"type":50,"value":3522},"Example -- choosing an OCR base model",{"type":44,"tag":128,"props":3524,"children":3526},{"className":485,"code":3525,"language":487,"meta":132,"style":132},"# Search for benchmarks containing whose name contains the text `ocr`\nuv run scripts\u002Fhf_benchmarks.py search --query ocr\n\n# Get the ranked leaderboard for the allenai\u002FolmOCR-bench benchmark \nuv run scripts\u002Fhf_benchmarks.py leaderboard allenai\u002FolmOCR-bench\n",[3527],{"type":44,"tag":135,"props":3528,"children":3529},{"__ignoreMap":132},[3530,3538,3568,3575,3583],{"type":44,"tag":139,"props":3531,"children":3532},{"class":141,"line":142},[3533],{"type":44,"tag":139,"props":3534,"children":3535},{"style":1843},[3536],{"type":50,"value":3537},"# Search for benchmarks containing whose name contains the text `ocr`\n",{"type":44,"tag":139,"props":3539,"children":3540},{"class":141,"line":151},[3541,3545,3549,3553,3558,3563],{"type":44,"tag":139,"props":3542,"children":3543},{"style":497},[3544],{"type":50,"value":500},{"type":44,"tag":139,"props":3546,"children":3547},{"style":503},[3548],{"type":50,"value":506},{"type":44,"tag":139,"props":3550,"children":3551},{"style":503},[3552],{"type":50,"value":3512},{"type":44,"tag":139,"props":3554,"children":3555},{"style":503},[3556],{"type":50,"value":3557}," search",{"type":44,"tag":139,"props":3559,"children":3560},{"style":503},[3561],{"type":50,"value":3562}," --query",{"type":44,"tag":139,"props":3564,"children":3565},{"style":503},[3566],{"type":50,"value":3567}," ocr\n",{"type":44,"tag":139,"props":3569,"children":3570},{"class":141,"line":160},[3571],{"type":44,"tag":139,"props":3572,"children":3573},{"emptyLinePlaceholder":1033},[3574],{"type":50,"value":1036},{"type":44,"tag":139,"props":3576,"children":3577},{"class":141,"line":169},[3578],{"type":44,"tag":139,"props":3579,"children":3580},{"style":1843},[3581],{"type":50,"value":3582},"# Get the ranked leaderboard for the allenai\u002FolmOCR-bench benchmark \n",{"type":44,"tag":139,"props":3584,"children":3585},{"class":141,"line":1039},[3586,3590,3594,3598,3603],{"type":44,"tag":139,"props":3587,"children":3588},{"style":497},[3589],{"type":50,"value":500},{"type":44,"tag":139,"props":3591,"children":3592},{"style":503},[3593],{"type":50,"value":506},{"type":44,"tag":139,"props":3595,"children":3596},{"style":503},[3597],{"type":50,"value":3512},{"type":44,"tag":139,"props":3599,"children":3600},{"style":503},[3601],{"type":50,"value":3602}," leaderboard",{"type":44,"tag":139,"props":3604,"children":3605},{"style":503},[3606],{"type":50,"value":3607}," allenai\u002FolmOCR-bench\n",{"type":44,"tag":53,"props":3609,"children":3611},{"id":3610},"cost-estimation",[3612],{"type":50,"value":3613},"Cost Estimation",{"type":44,"tag":60,"props":3615,"children":3616},{},[3617,3622,3624,3630],{"type":44,"tag":69,"props":3618,"children":3619},{},[3620],{"type":50,"value":3621},"Offer to estimate cost when planning jobs with known parameters.",{"type":50,"value":3623}," Use ",{"type":44,"tag":135,"props":3625,"children":3627},{"className":3626},[],[3628],{"type":50,"value":3629},"scripts\u002Festimate_cost.py",{"type":50,"value":482},{"type":44,"tag":128,"props":3632,"children":3634},{"className":485,"code":3633,"language":487,"meta":132,"style":132},"uv run scripts\u002Festimate_cost.py \\\n  --model meta-llama\u002FLlama-2-7b-hf \\\n  --dataset trl-lib\u002FCapybara \\\n  --hardware a10g-large \\\n  --dataset-size 16000 \\\n  --epochs 3\n",[3635],{"type":44,"tag":135,"props":3636,"children":3637},{"__ignoreMap":132},[3638,3657,3674,3691,3707,3725],{"type":44,"tag":139,"props":3639,"children":3640},{"class":141,"line":142},[3641,3645,3649,3653],{"type":44,"tag":139,"props":3642,"children":3643},{"style":497},[3644],{"type":50,"value":500},{"type":44,"tag":139,"props":3646,"children":3647},{"style":503},[3648],{"type":50,"value":506},{"type":44,"tag":139,"props":3650,"children":3651},{"style":503},[3652],{"type":50,"value":511},{"type":44,"tag":139,"props":3654,"children":3655},{"style":2464},[3656],{"type":50,"value":2467},{"type":44,"tag":139,"props":3658,"children":3659},{"class":141,"line":151},[3660,3665,3670],{"type":44,"tag":139,"props":3661,"children":3662},{"style":503},[3663],{"type":50,"value":3664},"  --model",{"type":44,"tag":139,"props":3666,"children":3667},{"style":503},[3668],{"type":50,"value":3669}," meta-llama\u002FLlama-2-7b-hf",{"type":44,"tag":139,"props":3671,"children":3672},{"style":2464},[3673],{"type":50,"value":2467},{"type":44,"tag":139,"props":3675,"children":3676},{"class":141,"line":160},[3677,3682,3687],{"type":44,"tag":139,"props":3678,"children":3679},{"style":503},[3680],{"type":50,"value":3681},"  --dataset",{"type":44,"tag":139,"props":3683,"children":3684},{"style":503},[3685],{"type":50,"value":3686}," trl-lib\u002FCapybara",{"type":44,"tag":139,"props":3688,"children":3689},{"style":2464},[3690],{"type":50,"value":2467},{"type":44,"tag":139,"props":3692,"children":3693},{"class":141,"line":169},[3694,3699,3703],{"type":44,"tag":139,"props":3695,"children":3696},{"style":503},[3697],{"type":50,"value":3698},"  --hardware",{"type":44,"tag":139,"props":3700,"children":3701},{"style":503},[3702],{"type":50,"value":2146},{"type":44,"tag":139,"props":3704,"children":3705},{"style":2464},[3706],{"type":50,"value":2467},{"type":44,"tag":139,"props":3708,"children":3709},{"class":141,"line":1039},[3710,3715,3721],{"type":44,"tag":139,"props":3711,"children":3712},{"style":503},[3713],{"type":50,"value":3714},"  --dataset-size",{"type":44,"tag":139,"props":3716,"children":3718},{"style":3717},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[3719],{"type":50,"value":3720}," 16000",{"type":44,"tag":139,"props":3722,"children":3723},{"style":2464},[3724],{"type":50,"value":2467},{"type":44,"tag":139,"props":3726,"children":3727},{"class":141,"line":1048},[3728,3733],{"type":44,"tag":139,"props":3729,"children":3730},{"style":503},[3731],{"type":50,"value":3732},"  --epochs",{"type":44,"tag":139,"props":3734,"children":3735},{"style":3717},[3736],{"type":50,"value":3737}," 3\n",{"type":44,"tag":60,"props":3739,"children":3740},{},[3741],{"type":50,"value":3742},"Output includes estimated time, cost, recommended timeout (with buffer), and optimization suggestions.",{"type":44,"tag":60,"props":3744,"children":3745},{},[3746,3751],{"type":44,"tag":69,"props":3747,"children":3748},{},[3749],{"type":50,"value":3750},"When to offer:",{"type":50,"value":3752}," User planning a job, asks about cost\u002Ftime, choosing hardware, job will run >1 hour or cost >$5",{"type":44,"tag":53,"props":3754,"children":3756},{"id":3755},"example-training-scripts",[3757],{"type":50,"value":3758},"Example Training Scripts",{"type":44,"tag":60,"props":3760,"children":3761},{},[3762],{"type":44,"tag":69,"props":3763,"children":3764},{},[3765],{"type":50,"value":3766},"Production-ready templates with all best practices:",{"type":44,"tag":60,"props":3768,"children":3769},{},[3770],{"type":50,"value":3771},"Load these scripts for correctly:",{"type":44,"tag":75,"props":3773,"children":3774},{},[3775,3788,3801],{"type":44,"tag":79,"props":3776,"children":3777},{},[3778,3786],{"type":44,"tag":69,"props":3779,"children":3780},{},[3781],{"type":44,"tag":135,"props":3782,"children":3784},{"className":3783},[],[3785],{"type":50,"value":453},{"type":50,"value":3787}," - Complete SFT training with Trackio, LoRA, checkpoints",{"type":44,"tag":79,"props":3789,"children":3790},{},[3791,3799],{"type":44,"tag":69,"props":3792,"children":3793},{},[3794],{"type":44,"tag":135,"props":3795,"children":3797},{"className":3796},[],[3798],{"type":50,"value":461},{"type":50,"value":3800}," - DPO training for preference learning",{"type":44,"tag":79,"props":3802,"children":3803},{},[3804,3813],{"type":44,"tag":69,"props":3805,"children":3806},{},[3807],{"type":44,"tag":135,"props":3808,"children":3810},{"className":3809},[],[3811],{"type":50,"value":3812},"scripts\u002Ftrain_grpo_example.py",{"type":50,"value":3814}," - GRPO training for online RL",{"type":44,"tag":60,"props":3816,"children":3817},{},[3818,3820,3825],{"type":50,"value":3819},"These scripts demonstrate proper Hub saving, Trackio integration, checkpoint management, and optimized parameters. Pass their content inline to ",{"type":44,"tag":135,"props":3821,"children":3823},{"className":3822},[],[3824],{"type":50,"value":367},{"type":50,"value":3826}," or use as templates for custom scripts.",{"type":44,"tag":53,"props":3828,"children":3830},{"id":3829},"monitoring-and-tracking",[3831],{"type":50,"value":3832},"Monitoring and Tracking",{"type":44,"tag":60,"props":3834,"children":3835},{},[3836,3841,3843,3849],{"type":44,"tag":69,"props":3837,"children":3838},{},[3839],{"type":50,"value":3840},"Trackio",{"type":50,"value":3842}," provides real-time metrics visualization. See ",{"type":44,"tag":135,"props":3844,"children":3846},{"className":3845},[],[3847],{"type":50,"value":3848},"references\u002Ftrackio_guide.md",{"type":50,"value":3850}," for complete setup guide.",{"type":44,"tag":60,"props":3852,"children":3853},{},[3854],{"type":44,"tag":69,"props":3855,"children":3856},{},[3857],{"type":50,"value":3858},"Key points:",{"type":44,"tag":75,"props":3860,"children":3861},{},[3862,3875],{"type":44,"tag":79,"props":3863,"children":3864},{},[3865,3867,3873],{"type":50,"value":3866},"Add ",{"type":44,"tag":135,"props":3868,"children":3870},{"className":3869},[],[3871],{"type":50,"value":3872},"trackio",{"type":50,"value":3874}," to dependencies",{"type":44,"tag":79,"props":3876,"children":3877},{},[3878,3880],{"type":50,"value":3879},"Configure trainer with ",{"type":44,"tag":135,"props":3881,"children":3883},{"className":3882},[],[3884],{"type":50,"value":3885},"report_to=\"trackio\" and run_name=\"meaningful_name\"",{"type":44,"tag":239,"props":3887,"children":3889},{"id":3888},"trackio-configuration-defaults",[3890],{"type":50,"value":3891},"Trackio Configuration Defaults",{"type":44,"tag":60,"props":3893,"children":3894},{},[3895,3900],{"type":44,"tag":69,"props":3896,"children":3897},{},[3898],{"type":50,"value":3899},"Use sensible defaults unless user specifies otherwise.",{"type":50,"value":3901}," When generating training scripts with Trackio:",{"type":44,"tag":60,"props":3903,"children":3904},{},[3905],{"type":44,"tag":69,"props":3906,"children":3907},{},[3908],{"type":50,"value":3909},"Default Configuration:",{"type":44,"tag":75,"props":3911,"children":3912},{},[3913,3931,3941,3951],{"type":44,"tag":79,"props":3914,"children":3915},{},[3916,3921,3923,3929],{"type":44,"tag":69,"props":3917,"children":3918},{},[3919],{"type":50,"value":3920},"Space ID",{"type":50,"value":3922},": ",{"type":44,"tag":135,"props":3924,"children":3926},{"className":3925},[],[3927],{"type":50,"value":3928},"{username}\u002Ftrackio",{"type":50,"value":3930}," (use \"trackio\" as default space name)",{"type":44,"tag":79,"props":3932,"children":3933},{},[3934,3939],{"type":44,"tag":69,"props":3935,"children":3936},{},[3937],{"type":50,"value":3938},"Run naming",{"type":50,"value":3940},": Unless otherwise specified, name the run in a way the user will recognize (e.g., descriptive of the task, model, or purpose)",{"type":44,"tag":79,"props":3942,"children":3943},{},[3944,3949],{"type":44,"tag":69,"props":3945,"children":3946},{},[3947],{"type":50,"value":3948},"Config",{"type":50,"value":3950},": Keep minimal - only include hyperparameters and model\u002Fdataset info",{"type":44,"tag":79,"props":3952,"children":3953},{},[3954,3959],{"type":44,"tag":69,"props":3955,"children":3956},{},[3957],{"type":50,"value":3958},"Project Name",{"type":50,"value":3960},": Use a Project Name to associate runs with a particular Project",{"type":44,"tag":60,"props":3962,"children":3963},{},[3964,3969],{"type":44,"tag":69,"props":3965,"children":3966},{},[3967],{"type":50,"value":3968},"User overrides:",{"type":50,"value":3970}," If user requests specific trackio configuration (custom space, run naming, grouping, or additional config), apply their preferences instead of defaults.",{"type":44,"tag":60,"props":3972,"children":3973},{},[3974],{"type":50,"value":3975},"This is useful for managing multiple jobs with the same configuration or keeping training scripts portable.",{"type":44,"tag":60,"props":3977,"children":3978},{},[3979,3980,3985],{"type":50,"value":323},{"type":44,"tag":135,"props":3981,"children":3983},{"className":3982},[],[3984],{"type":50,"value":3848},{"type":50,"value":3986}," for complete documentation including grouping runs for experiments.",{"type":44,"tag":239,"props":3988,"children":3990},{"id":3989},"check-job-status",[3991],{"type":50,"value":3992},"Check Job Status",{"type":44,"tag":128,"props":3994,"children":3996},{"className":130,"code":3995,"language":23,"meta":132,"style":132},"# List all jobs\nhf_jobs(\"ps\")\n\n# Inspect specific job\nhf_jobs(\"inspect\", {\"job_id\": \"your-job-id\"})\n\n# View logs\nhf_jobs(\"logs\", {\"job_id\": \"your-job-id\"})\n",[3997],{"type":44,"tag":135,"props":3998,"children":3999},{"__ignoreMap":132},[4000,4008,4016,4023,4031,4039,4046,4054],{"type":44,"tag":139,"props":4001,"children":4002},{"class":141,"line":142},[4003],{"type":44,"tag":139,"props":4004,"children":4005},{},[4006],{"type":50,"value":4007},"# List all jobs\n",{"type":44,"tag":139,"props":4009,"children":4010},{"class":141,"line":151},[4011],{"type":44,"tag":139,"props":4012,"children":4013},{},[4014],{"type":50,"value":4015},"hf_jobs(\"ps\")\n",{"type":44,"tag":139,"props":4017,"children":4018},{"class":141,"line":160},[4019],{"type":44,"tag":139,"props":4020,"children":4021},{"emptyLinePlaceholder":1033},[4022],{"type":50,"value":1036},{"type":44,"tag":139,"props":4024,"children":4025},{"class":141,"line":169},[4026],{"type":44,"tag":139,"props":4027,"children":4028},{},[4029],{"type":50,"value":4030},"# Inspect specific job\n",{"type":44,"tag":139,"props":4032,"children":4033},{"class":141,"line":1039},[4034],{"type":44,"tag":139,"props":4035,"children":4036},{},[4037],{"type":50,"value":4038},"hf_jobs(\"inspect\", {\"job_id\": \"your-job-id\"})\n",{"type":44,"tag":139,"props":4040,"children":4041},{"class":141,"line":1048},[4042],{"type":44,"tag":139,"props":4043,"children":4044},{"emptyLinePlaceholder":1033},[4045],{"type":50,"value":1036},{"type":44,"tag":139,"props":4047,"children":4048},{"class":141,"line":1226},[4049],{"type":44,"tag":139,"props":4050,"children":4051},{},[4052],{"type":50,"value":4053},"# View logs\n",{"type":44,"tag":139,"props":4055,"children":4056},{"class":141,"line":1235},[4057],{"type":44,"tag":139,"props":4058,"children":4059},{},[4060],{"type":50,"value":4061},"hf_jobs(\"logs\", {\"job_id\": \"your-job-id\"})\n",{"type":44,"tag":60,"props":4063,"children":4064},{},[4065,4070],{"type":44,"tag":69,"props":4066,"children":4067},{},[4068],{"type":50,"value":4069},"Remember:",{"type":50,"value":4071}," Wait for user to request status checks. Avoid polling repeatedly.",{"type":44,"tag":53,"props":4073,"children":4075},{"id":4074},"dataset-validation",[4076],{"type":50,"value":4077},"Dataset Validation",{"type":44,"tag":60,"props":4079,"children":4080},{},[4081],{"type":44,"tag":69,"props":4082,"children":4083},{},[4084],{"type":50,"value":4085},"Validate dataset format BEFORE launching GPU training to prevent the #1 cause of training failures: format mismatches.",{"type":44,"tag":239,"props":4087,"children":4089},{"id":4088},"why-validate",[4090],{"type":50,"value":4091},"Why Validate",{"type":44,"tag":75,"props":4093,"children":4094},{},[4095,4100,4126,4131],{"type":44,"tag":79,"props":4096,"children":4097},{},[4098],{"type":50,"value":4099},"50%+ of training failures are due to dataset format issues",{"type":44,"tag":79,"props":4101,"children":4102},{},[4103,4105,4111,4112,4118,4119,4125],{"type":50,"value":4104},"DPO especially strict: requires exact column names (",{"type":44,"tag":135,"props":4106,"children":4108},{"className":4107},[],[4109],{"type":50,"value":4110},"prompt",{"type":50,"value":455},{"type":44,"tag":135,"props":4113,"children":4115},{"className":4114},[],[4116],{"type":50,"value":4117},"chosen",{"type":50,"value":455},{"type":44,"tag":135,"props":4120,"children":4122},{"className":4121},[],[4123],{"type":50,"value":4124},"rejected",{"type":50,"value":994},{"type":44,"tag":79,"props":4127,"children":4128},{},[4129],{"type":50,"value":4130},"Failed GPU jobs waste $1-10 and 30-60 minutes",{"type":44,"tag":79,"props":4132,"children":4133},{},[4134],{"type":50,"value":4135},"Validation on CPU costs ~$0.01 and takes \u003C1 minute",{"type":44,"tag":239,"props":4137,"children":4139},{"id":4138},"when-to-validate",[4140],{"type":50,"value":4141},"When to Validate",{"type":44,"tag":60,"props":4143,"children":4144},{},[4145],{"type":44,"tag":69,"props":4146,"children":4147},{},[4148],{"type":50,"value":4149},"ALWAYS validate for:",{"type":44,"tag":75,"props":4151,"children":4152},{},[4153,4158,4163],{"type":44,"tag":79,"props":4154,"children":4155},{},[4156],{"type":50,"value":4157},"Unknown or custom datasets",{"type":44,"tag":79,"props":4159,"children":4160},{},[4161],{"type":50,"value":4162},"DPO training (CRITICAL - 90% of datasets need mapping)",{"type":44,"tag":79,"props":4164,"children":4165},{},[4166],{"type":50,"value":4167},"Any dataset not explicitly TRL-compatible",{"type":44,"tag":60,"props":4169,"children":4170},{},[4171],{"type":44,"tag":69,"props":4172,"children":4173},{},[4174],{"type":50,"value":4175},"Skip validation for known TRL datasets:",{"type":44,"tag":75,"props":4177,"children":4178},{},[4179],{"type":44,"tag":79,"props":4180,"children":4181},{},[4182,4188,4189,4195,4196,4202],{"type":44,"tag":135,"props":4183,"children":4185},{"className":4184},[],[4186],{"type":50,"value":4187},"trl-lib\u002Fultrachat_200k",{"type":50,"value":455},{"type":44,"tag":135,"props":4190,"children":4192},{"className":4191},[],[4193],{"type":50,"value":4194},"trl-lib\u002FCapybara",{"type":50,"value":455},{"type":44,"tag":135,"props":4197,"children":4199},{"className":4198},[],[4200],{"type":50,"value":4201},"HuggingFaceH4\u002Fultrachat_200k",{"type":50,"value":4203},", etc.",{"type":44,"tag":239,"props":4205,"children":4207},{"id":4206},"usage",[4208],{"type":50,"value":4209},"Usage",{"type":44,"tag":128,"props":4211,"children":4213},{"className":130,"code":4212,"language":23,"meta":132,"style":132},"hf_jobs(\"uv\", {\n    \"script\": \"https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fmcp-tools\u002Fskills\u002Fraw\u002Fmain\u002Fdataset_inspector.py\",\n    \"script_args\": [\"--dataset\", \"username\u002Fdataset-name\", \"--split\", \"train\"]\n})\n",[4214],{"type":44,"tag":135,"props":4215,"children":4216},{"__ignoreMap":132},[4217,4224,4232,4240],{"type":44,"tag":139,"props":4218,"children":4219},{"class":141,"line":142},[4220],{"type":44,"tag":139,"props":4221,"children":4222},{},[4223],{"type":50,"value":1175},{"type":44,"tag":139,"props":4225,"children":4226},{"class":141,"line":151},[4227],{"type":44,"tag":139,"props":4228,"children":4229},{},[4230],{"type":50,"value":4231},"    \"script\": \"https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fmcp-tools\u002Fskills\u002Fraw\u002Fmain\u002Fdataset_inspector.py\",\n",{"type":44,"tag":139,"props":4233,"children":4234},{"class":141,"line":160},[4235],{"type":44,"tag":139,"props":4236,"children":4237},{},[4238],{"type":50,"value":4239},"    \"script_args\": [\"--dataset\", \"username\u002Fdataset-name\", \"--split\", \"train\"]\n",{"type":44,"tag":139,"props":4241,"children":4242},{"class":141,"line":169},[4243],{"type":44,"tag":139,"props":4244,"children":4245},{},[4246],{"type":50,"value":1534},{"type":44,"tag":60,"props":4248,"children":4249},{},[4250],{"type":50,"value":4251},"The script is fast, and will usually complete synchronously.",{"type":44,"tag":239,"props":4253,"children":4255},{"id":4254},"reading-results",[4256],{"type":50,"value":4257},"Reading Results",{"type":44,"tag":60,"props":4259,"children":4260},{},[4261],{"type":50,"value":4262},"The output shows compatibility for each training method:",{"type":44,"tag":75,"props":4264,"children":4265},{},[4266,4280,4294],{"type":44,"tag":79,"props":4267,"children":4268},{},[4269,4278],{"type":44,"tag":69,"props":4270,"children":4271},{},[4272],{"type":44,"tag":135,"props":4273,"children":4275},{"className":4274},[],[4276],{"type":50,"value":4277},"✓ READY",{"type":50,"value":4279}," - Dataset is compatible, use directly",{"type":44,"tag":79,"props":4281,"children":4282},{},[4283,4292],{"type":44,"tag":69,"props":4284,"children":4285},{},[4286],{"type":44,"tag":135,"props":4287,"children":4289},{"className":4288},[],[4290],{"type":50,"value":4291},"✗ NEEDS MAPPING",{"type":50,"value":4293}," - Compatible but needs preprocessing (mapping code provided)",{"type":44,"tag":79,"props":4295,"children":4296},{},[4297,4306],{"type":44,"tag":69,"props":4298,"children":4299},{},[4300],{"type":44,"tag":135,"props":4301,"children":4303},{"className":4302},[],[4304],{"type":50,"value":4305},"✗ INCOMPATIBLE",{"type":50,"value":4307}," - Cannot be used for this method",{"type":44,"tag":60,"props":4309,"children":4310},{},[4311,4313,4318],{"type":50,"value":4312},"When mapping is needed, the output includes a ",{"type":44,"tag":69,"props":4314,"children":4315},{},[4316],{"type":50,"value":4317},"\"MAPPING CODE\"",{"type":50,"value":4319}," section with copy-paste ready Python code.",{"type":44,"tag":239,"props":4321,"children":4323},{"id":4322},"example-workflow",[4324],{"type":50,"value":4325},"Example Workflow",{"type":44,"tag":128,"props":4327,"children":4329},{"className":130,"code":4328,"language":23,"meta":132,"style":132},"# 1. Inspect dataset (costs ~$0.01, \u003C1 min on CPU)\nhf_jobs(\"uv\", {\n    \"script\": \"https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fmcp-tools\u002Fskills\u002Fraw\u002Fmain\u002Fdataset_inspector.py\",\n    \"script_args\": [\"--dataset\", \"argilla\u002Fdistilabel-math-preference-dpo\", \"--split\", \"train\"]\n})\n\n# 2. Check output markers:\n#    ✓ READY → proceed with training\n#    ✗ NEEDS MAPPING → apply mapping code below\n#    ✗ INCOMPATIBLE → choose different method\u002Fdataset\n\n# 3. If mapping needed, apply before training:\ndef format_for_dpo(example):\n    return {\n        'prompt': example['instruction'],\n        'chosen': example['chosen_response'],\n        'rejected': example['rejected_response'],\n    }\ndataset = dataset.map(format_for_dpo, remove_columns=dataset.column_names)\n\n# 4. Launch training job with confidence\n",[4330],{"type":44,"tag":135,"props":4331,"children":4332},{"__ignoreMap":132},[4333,4341,4348,4355,4363,4370,4377,4385,4393,4401,4409,4416,4424,4432,4440,4448,4456,4464,4472,4480,4487],{"type":44,"tag":139,"props":4334,"children":4335},{"class":141,"line":142},[4336],{"type":44,"tag":139,"props":4337,"children":4338},{},[4339],{"type":50,"value":4340},"# 1. Inspect dataset (costs ~$0.01, \u003C1 min on CPU)\n",{"type":44,"tag":139,"props":4342,"children":4343},{"class":141,"line":151},[4344],{"type":44,"tag":139,"props":4345,"children":4346},{},[4347],{"type":50,"value":1175},{"type":44,"tag":139,"props":4349,"children":4350},{"class":141,"line":160},[4351],{"type":44,"tag":139,"props":4352,"children":4353},{},[4354],{"type":50,"value":4231},{"type":44,"tag":139,"props":4356,"children":4357},{"class":141,"line":169},[4358],{"type":44,"tag":139,"props":4359,"children":4360},{},[4361],{"type":50,"value":4362},"    \"script_args\": [\"--dataset\", \"argilla\u002Fdistilabel-math-preference-dpo\", \"--split\", \"train\"]\n",{"type":44,"tag":139,"props":4364,"children":4365},{"class":141,"line":1039},[4366],{"type":44,"tag":139,"props":4367,"children":4368},{},[4369],{"type":50,"value":1534},{"type":44,"tag":139,"props":4371,"children":4372},{"class":141,"line":1048},[4373],{"type":44,"tag":139,"props":4374,"children":4375},{"emptyLinePlaceholder":1033},[4376],{"type":50,"value":1036},{"type":44,"tag":139,"props":4378,"children":4379},{"class":141,"line":1226},[4380],{"type":44,"tag":139,"props":4381,"children":4382},{},[4383],{"type":50,"value":4384},"# 2. Check output markers:\n",{"type":44,"tag":139,"props":4386,"children":4387},{"class":141,"line":1235},[4388],{"type":44,"tag":139,"props":4389,"children":4390},{},[4391],{"type":50,"value":4392},"#    ✓ READY → proceed with training\n",{"type":44,"tag":139,"props":4394,"children":4395},{"class":141,"line":1244},[4396],{"type":44,"tag":139,"props":4397,"children":4398},{},[4399],{"type":50,"value":4400},"#    ✗ NEEDS MAPPING → apply mapping code below\n",{"type":44,"tag":139,"props":4402,"children":4403},{"class":141,"line":1253},[4404],{"type":44,"tag":139,"props":4405,"children":4406},{},[4407],{"type":50,"value":4408},"#    ✗ INCOMPATIBLE → choose different method\u002Fdataset\n",{"type":44,"tag":139,"props":4410,"children":4411},{"class":141,"line":1262},[4412],{"type":44,"tag":139,"props":4413,"children":4414},{"emptyLinePlaceholder":1033},[4415],{"type":50,"value":1036},{"type":44,"tag":139,"props":4417,"children":4418},{"class":141,"line":1270},[4419],{"type":44,"tag":139,"props":4420,"children":4421},{},[4422],{"type":50,"value":4423},"# 3. If mapping needed, apply before training:\n",{"type":44,"tag":139,"props":4425,"children":4426},{"class":141,"line":1279},[4427],{"type":44,"tag":139,"props":4428,"children":4429},{},[4430],{"type":50,"value":4431},"def format_for_dpo(example):\n",{"type":44,"tag":139,"props":4433,"children":4434},{"class":141,"line":1287},[4435],{"type":44,"tag":139,"props":4436,"children":4437},{},[4438],{"type":50,"value":4439},"    return {\n",{"type":44,"tag":139,"props":4441,"children":4442},{"class":141,"line":1296},[4443],{"type":44,"tag":139,"props":4444,"children":4445},{},[4446],{"type":50,"value":4447},"        'prompt': example['instruction'],\n",{"type":44,"tag":139,"props":4449,"children":4450},{"class":141,"line":1305},[4451],{"type":44,"tag":139,"props":4452,"children":4453},{},[4454],{"type":50,"value":4455},"        'chosen': example['chosen_response'],\n",{"type":44,"tag":139,"props":4457,"children":4458},{"class":141,"line":1313},[4459],{"type":44,"tag":139,"props":4460,"children":4461},{},[4462],{"type":50,"value":4463},"        'rejected': example['rejected_response'],\n",{"type":44,"tag":139,"props":4465,"children":4466},{"class":141,"line":1322},[4467],{"type":44,"tag":139,"props":4468,"children":4469},{},[4470],{"type":50,"value":4471},"    }\n",{"type":44,"tag":139,"props":4473,"children":4474},{"class":141,"line":1331},[4475],{"type":44,"tag":139,"props":4476,"children":4477},{},[4478],{"type":50,"value":4479},"dataset = dataset.map(format_for_dpo, remove_columns=dataset.column_names)\n",{"type":44,"tag":139,"props":4481,"children":4482},{"class":141,"line":1340},[4483],{"type":44,"tag":139,"props":4484,"children":4485},{"emptyLinePlaceholder":1033},[4486],{"type":50,"value":1036},{"type":44,"tag":139,"props":4488,"children":4489},{"class":141,"line":1349},[4490],{"type":44,"tag":139,"props":4491,"children":4492},{},[4493],{"type":50,"value":4494},"# 4. Launch training job with confidence\n",{"type":44,"tag":239,"props":4496,"children":4498},{"id":4497},"common-scenario-dpo-format-mismatch",[4499],{"type":50,"value":4500},"Common Scenario: DPO Format Mismatch",{"type":44,"tag":60,"props":4502,"children":4503},{},[4504],{"type":50,"value":4505},"Most DPO datasets use non-standard column names. Example:",{"type":44,"tag":128,"props":4507,"children":4510},{"className":4508,"code":4509,"language":50},[926],"Dataset has: instruction, chosen_response, rejected_response\nDPO expects: prompt, chosen, rejected\n",[4511],{"type":44,"tag":135,"props":4512,"children":4513},{"__ignoreMap":132},[4514],{"type":50,"value":4509},{"type":44,"tag":60,"props":4516,"children":4517},{},[4518],{"type":50,"value":4519},"The validator detects this and provides exact mapping code to fix it.",{"type":44,"tag":53,"props":4521,"children":4523},{"id":4522},"converting-models-to-gguf",[4524],{"type":50,"value":4525},"Converting Models to GGUF",{"type":44,"tag":60,"props":4527,"children":4528},{},[4529,4531,4536],{"type":50,"value":4530},"After training, convert models to ",{"type":44,"tag":69,"props":4532,"children":4533},{},[4534],{"type":50,"value":4535},"GGUF format",{"type":50,"value":4537}," for use with llama.cpp, Ollama, LM Studio, and other local inference tools.",{"type":44,"tag":60,"props":4539,"children":4540},{},[4541],{"type":44,"tag":69,"props":4542,"children":4543},{},[4544],{"type":50,"value":4545},"What is GGUF:",{"type":44,"tag":75,"props":4547,"children":4548},{},[4549,4554,4559,4564],{"type":44,"tag":79,"props":4550,"children":4551},{},[4552],{"type":50,"value":4553},"Optimized for CPU\u002FGPU inference with llama.cpp",{"type":44,"tag":79,"props":4555,"children":4556},{},[4557],{"type":50,"value":4558},"Supports quantization (4-bit, 5-bit, 8-bit) to reduce model size",{"type":44,"tag":79,"props":4560,"children":4561},{},[4562],{"type":50,"value":4563},"Compatible with Ollama, LM Studio, Jan, GPT4All, llama.cpp",{"type":44,"tag":79,"props":4565,"children":4566},{},[4567],{"type":50,"value":4568},"Typically 2-8GB for 7B models (vs 14GB unquantized)",{"type":44,"tag":60,"props":4570,"children":4571},{},[4572],{"type":44,"tag":69,"props":4573,"children":4574},{},[4575],{"type":50,"value":4576},"When to convert:",{"type":44,"tag":75,"props":4578,"children":4579},{},[4580,4585,4590,4595],{"type":44,"tag":79,"props":4581,"children":4582},{},[4583],{"type":50,"value":4584},"Running models locally with Ollama or LM Studio",{"type":44,"tag":79,"props":4586,"children":4587},{},[4588],{"type":50,"value":4589},"Reducing model size with quantization",{"type":44,"tag":79,"props":4591,"children":4592},{},[4593],{"type":50,"value":4594},"Deploying to edge devices",{"type":44,"tag":79,"props":4596,"children":4597},{},[4598],{"type":50,"value":4599},"Sharing models for local-first use",{"type":44,"tag":60,"props":4601,"children":4602},{},[4603,4607,4608,4614],{"type":44,"tag":69,"props":4604,"children":4605},{},[4606],{"type":50,"value":3057},{"type":50,"value":185},{"type":44,"tag":135,"props":4609,"children":4611},{"className":4610},[],[4612],{"type":50,"value":4613},"references\u002Fgguf_conversion.md",{"type":50,"value":4615}," for complete conversion guide, including production-ready conversion script, quantization options, hardware requirements, usage examples, and troubleshooting.",{"type":44,"tag":60,"props":4617,"children":4618},{},[4619],{"type":44,"tag":69,"props":4620,"children":4621},{},[4622],{"type":50,"value":4623},"Quick conversion:",{"type":44,"tag":128,"props":4625,"children":4627},{"className":130,"code":4626,"language":23,"meta":132,"style":132},"hf_jobs(\"uv\", {\n    \"script\": \"\u003Csee references\u002Fgguf_conversion.md for complete script>\",\n    \"flavor\": \"a10g-large\",\n    \"timeout\": \"45m\",\n    \"secrets\": {\"HF_TOKEN\": \"$HF_TOKEN\"},\n    \"env\": {\n        \"ADAPTER_MODEL\": \"username\u002Fmy-finetuned-model\",\n        \"BASE_MODEL\": \"Qwen\u002FQwen2.5-0.5B\",\n        \"OUTPUT_REPO\": \"username\u002Fmy-model-gguf\"\n    }\n})\n",[4628],{"type":44,"tag":135,"props":4629,"children":4630},{"__ignoreMap":132},[4631,4638,4646,4653,4661,4669,4677,4685,4693,4701,4708],{"type":44,"tag":139,"props":4632,"children":4633},{"class":141,"line":142},[4634],{"type":44,"tag":139,"props":4635,"children":4636},{},[4637],{"type":50,"value":1175},{"type":44,"tag":139,"props":4639,"children":4640},{"class":141,"line":151},[4641],{"type":44,"tag":139,"props":4642,"children":4643},{},[4644],{"type":50,"value":4645},"    \"script\": \"\u003Csee references\u002Fgguf_conversion.md for complete script>\",\n",{"type":44,"tag":139,"props":4647,"children":4648},{"class":141,"line":160},[4649],{"type":44,"tag":139,"props":4650,"children":4651},{},[4652],{"type":50,"value":1507},{"type":44,"tag":139,"props":4654,"children":4655},{"class":141,"line":169},[4656],{"type":44,"tag":139,"props":4657,"children":4658},{},[4659],{"type":50,"value":4660},"    \"timeout\": \"45m\",\n",{"type":44,"tag":139,"props":4662,"children":4663},{"class":141,"line":1039},[4664],{"type":44,"tag":139,"props":4665,"children":4666},{},[4667],{"type":50,"value":4668},"    \"secrets\": {\"HF_TOKEN\": \"$HF_TOKEN\"},\n",{"type":44,"tag":139,"props":4670,"children":4671},{"class":141,"line":1048},[4672],{"type":44,"tag":139,"props":4673,"children":4674},{},[4675],{"type":50,"value":4676},"    \"env\": {\n",{"type":44,"tag":139,"props":4678,"children":4679},{"class":141,"line":1226},[4680],{"type":44,"tag":139,"props":4681,"children":4682},{},[4683],{"type":50,"value":4684},"        \"ADAPTER_MODEL\": \"username\u002Fmy-finetuned-model\",\n",{"type":44,"tag":139,"props":4686,"children":4687},{"class":141,"line":1235},[4688],{"type":44,"tag":139,"props":4689,"children":4690},{},[4691],{"type":50,"value":4692},"        \"BASE_MODEL\": \"Qwen\u002FQwen2.5-0.5B\",\n",{"type":44,"tag":139,"props":4694,"children":4695},{"class":141,"line":1244},[4696],{"type":44,"tag":139,"props":4697,"children":4698},{},[4699],{"type":50,"value":4700},"        \"OUTPUT_REPO\": \"username\u002Fmy-model-gguf\"\n",{"type":44,"tag":139,"props":4702,"children":4703},{"class":141,"line":1253},[4704],{"type":44,"tag":139,"props":4705,"children":4706},{},[4707],{"type":50,"value":4471},{"type":44,"tag":139,"props":4709,"children":4710},{"class":141,"line":1262},[4711],{"type":44,"tag":139,"props":4712,"children":4713},{},[4714],{"type":50,"value":1534},{"type":44,"tag":53,"props":4716,"children":4718},{"id":4717},"common-training-patterns",[4719],{"type":50,"value":4720},"Common Training Patterns",{"type":44,"tag":60,"props":4722,"children":4723},{},[4724,4725,4731],{"type":50,"value":323},{"type":44,"tag":135,"props":4726,"children":4728},{"className":4727},[],[4729],{"type":50,"value":4730},"references\u002Ftraining_patterns.md",{"type":50,"value":4732}," for detailed examples including:",{"type":44,"tag":75,"props":4734,"children":4735},{},[4736,4741,4746,4751,4756],{"type":44,"tag":79,"props":4737,"children":4738},{},[4739],{"type":50,"value":4740},"Quick demo (5-10 minutes)",{"type":44,"tag":79,"props":4742,"children":4743},{},[4744],{"type":50,"value":4745},"Production with checkpoints",{"type":44,"tag":79,"props":4747,"children":4748},{},[4749],{"type":50,"value":4750},"Multi-GPU training",{"type":44,"tag":79,"props":4752,"children":4753},{},[4754],{"type":50,"value":4755},"DPO training (preference learning)",{"type":44,"tag":79,"props":4757,"children":4758},{},[4759],{"type":50,"value":4760},"GRPO training (online RL)",{"type":44,"tag":53,"props":4762,"children":4764},{"id":4763},"common-failure-modes",[4765],{"type":50,"value":4766},"Common Failure Modes",{"type":44,"tag":239,"props":4768,"children":4770},{"id":4769},"out-of-memory-oom",[4771],{"type":50,"value":4772},"Out of Memory (OOM)",{"type":44,"tag":60,"props":4774,"children":4775},{},[4776],{"type":44,"tag":69,"props":4777,"children":4778},{},[4779],{"type":50,"value":4780},"Fix (try in order):",{"type":44,"tag":351,"props":4782,"children":4783},{},[4784,4821,4832],{"type":44,"tag":79,"props":4785,"children":4786},{},[4787,4789,4795,4797,4803,4805,4811,4813,4819],{"type":50,"value":4788},"Reduce batch size: ",{"type":44,"tag":135,"props":4790,"children":4792},{"className":4791},[],[4793],{"type":50,"value":4794},"per_device_train_batch_size=1",{"type":50,"value":4796},", increase ",{"type":44,"tag":135,"props":4798,"children":4800},{"className":4799},[],[4801],{"type":50,"value":4802},"gradient_accumulation_steps=8",{"type":50,"value":4804},". Effective batch size is ",{"type":44,"tag":135,"props":4806,"children":4808},{"className":4807},[],[4809],{"type":50,"value":4810},"per_device_train_batch_size",{"type":50,"value":4812}," x ",{"type":44,"tag":135,"props":4814,"children":4816},{"className":4815},[],[4817],{"type":50,"value":4818},"gradient_accumulation_steps",{"type":50,"value":4820},". For best performance keep effective batch size close to 128.",{"type":44,"tag":79,"props":4822,"children":4823},{},[4824,4826],{"type":50,"value":4825},"Enable: ",{"type":44,"tag":135,"props":4827,"children":4829},{"className":4828},[],[4830],{"type":50,"value":4831},"gradient_checkpointing=True",{"type":44,"tag":79,"props":4833,"children":4834},{},[4835],{"type":50,"value":4836},"Upgrade hardware: t4-small → l4x1, a10g-small → a10g-large etc.",{"type":44,"tag":239,"props":4838,"children":4840},{"id":4839},"dataset-misformatted",[4841],{"type":50,"value":4842},"Dataset Misformatted",{"type":44,"tag":60,"props":4844,"children":4845},{},[4846],{"type":44,"tag":69,"props":4847,"children":4848},{},[4849],{"type":50,"value":4850},"Fix:",{"type":44,"tag":351,"props":4852,"children":4853},{},[4854,4908,4913],{"type":44,"tag":79,"props":4855,"children":4856},{},[4857,4859],{"type":50,"value":4858},"Validate first with dataset inspector:\n",{"type":44,"tag":128,"props":4860,"children":4862},{"className":485,"code":4861,"language":487,"meta":132,"style":132},"uv run https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fmcp-tools\u002Fskills\u002Fraw\u002Fmain\u002Fdataset_inspector.py \\\n  --dataset name --split train\n",[4863],{"type":44,"tag":135,"props":4864,"children":4865},{"__ignoreMap":132},[4866,4886],{"type":44,"tag":139,"props":4867,"children":4868},{"class":141,"line":142},[4869,4873,4877,4882],{"type":44,"tag":139,"props":4870,"children":4871},{"style":497},[4872],{"type":50,"value":500},{"type":44,"tag":139,"props":4874,"children":4875},{"style":503},[4876],{"type":50,"value":506},{"type":44,"tag":139,"props":4878,"children":4879},{"style":503},[4880],{"type":50,"value":4881}," https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fmcp-tools\u002Fskills\u002Fraw\u002Fmain\u002Fdataset_inspector.py",{"type":44,"tag":139,"props":4883,"children":4884},{"style":2464},[4885],{"type":50,"value":2467},{"type":44,"tag":139,"props":4887,"children":4888},{"class":141,"line":151},[4889,4893,4898,4903],{"type":44,"tag":139,"props":4890,"children":4891},{"style":503},[4892],{"type":50,"value":3681},{"type":44,"tag":139,"props":4894,"children":4895},{"style":503},[4896],{"type":50,"value":4897}," name",{"type":44,"tag":139,"props":4899,"children":4900},{"style":503},[4901],{"type":50,"value":4902}," --split",{"type":44,"tag":139,"props":4904,"children":4905},{"style":503},[4906],{"type":50,"value":4907}," train\n",{"type":44,"tag":79,"props":4909,"children":4910},{},[4911],{"type":50,"value":4912},"Check output for compatibility markers (✓ READY, ✗ NEEDS MAPPING, ✗ INCOMPATIBLE)",{"type":44,"tag":79,"props":4914,"children":4915},{},[4916],{"type":50,"value":4917},"Apply mapping code from inspector output if needed",{"type":44,"tag":239,"props":4919,"children":4921},{"id":4920},"job-timeout",[4922],{"type":50,"value":4923},"Job Timeout",{"type":44,"tag":60,"props":4925,"children":4926},{},[4927],{"type":44,"tag":69,"props":4928,"children":4929},{},[4930],{"type":50,"value":4850},{"type":44,"tag":351,"props":4932,"children":4933},{},[4934,4945,4958,4977],{"type":44,"tag":79,"props":4935,"children":4936},{},[4937,4939],{"type":50,"value":4938},"Check logs for actual runtime: ",{"type":44,"tag":135,"props":4940,"children":4942},{"className":4941},[],[4943],{"type":50,"value":4944},"hf_jobs(\"logs\", {\"job_id\": \"...\"})",{"type":44,"tag":79,"props":4946,"children":4947},{},[4948,4950,4956],{"type":50,"value":4949},"Increase timeout with buffer: ",{"type":44,"tag":135,"props":4951,"children":4953},{"className":4952},[],[4954],{"type":50,"value":4955},"\"timeout\": \"3h\"",{"type":50,"value":4957}," (add 30% to estimated time)",{"type":44,"tag":79,"props":4959,"children":4960},{},[4961,4963,4969,4971],{"type":50,"value":4962},"Or reduce training: lower ",{"type":44,"tag":135,"props":4964,"children":4966},{"className":4965},[],[4967],{"type":50,"value":4968},"num_train_epochs",{"type":50,"value":4970},", use smaller dataset, enable ",{"type":44,"tag":135,"props":4972,"children":4974},{"className":4973},[],[4975],{"type":50,"value":4976},"max_steps",{"type":44,"tag":79,"props":4978,"children":4979},{},[4980,4982,4988,4989,4995,4996],{"type":50,"value":4981},"Save checkpoints: ",{"type":44,"tag":135,"props":4983,"children":4985},{"className":4984},[],[4986],{"type":50,"value":4987},"save_strategy=\"steps\"",{"type":50,"value":455},{"type":44,"tag":135,"props":4990,"children":4992},{"className":4991},[],[4993],{"type":50,"value":4994},"save_steps=500",{"type":50,"value":455},{"type":44,"tag":135,"props":4997,"children":4999},{"className":4998},[],[5000],{"type":50,"value":5001},"hub_strategy=\"every_save\"",{"type":44,"tag":60,"props":5003,"children":5004},{},[5005,5010],{"type":44,"tag":69,"props":5006,"children":5007},{},[5008],{"type":50,"value":5009},"Note:",{"type":50,"value":5011}," Default 30min is insufficient for real training. Minimum 1-2 hours.",{"type":44,"tag":239,"props":5013,"children":5015},{"id":5014},"hub-push-failures",[5016],{"type":50,"value":5017},"Hub Push Failures",{"type":44,"tag":60,"props":5019,"children":5020},{},[5021],{"type":44,"tag":69,"props":5022,"children":5023},{},[5024],{"type":50,"value":4850},{"type":44,"tag":351,"props":5026,"children":5027},{},[5028,5038,5054,5065],{"type":44,"tag":79,"props":5029,"children":5030},{},[5031,5033],{"type":50,"value":5032},"Add to job: ",{"type":44,"tag":135,"props":5034,"children":5036},{"className":5035},[],[5037],{"type":50,"value":633},{"type":44,"tag":79,"props":5039,"children":5040},{},[5041,5043,5048,5049],{"type":50,"value":5042},"Add to config: ",{"type":44,"tag":135,"props":5044,"children":5046},{"className":5045},[],[5047],{"type":50,"value":729},{"type":50,"value":455},{"type":44,"tag":135,"props":5050,"children":5052},{"className":5051},[],[5053],{"type":50,"value":736},{"type":44,"tag":79,"props":5055,"children":5056},{},[5057,5059],{"type":50,"value":5058},"Verify auth: ",{"type":44,"tag":135,"props":5060,"children":5062},{"className":5061},[],[5063],{"type":50,"value":5064},"mcp__huggingface__hf_whoami()",{"type":44,"tag":79,"props":5066,"children":5067},{},[5068,5070,5076],{"type":50,"value":5069},"Check token has write permissions and repo exists (or set ",{"type":44,"tag":135,"props":5071,"children":5073},{"className":5072},[],[5074],{"type":50,"value":5075},"hub_private_repo=True",{"type":50,"value":994},{"type":44,"tag":239,"props":5078,"children":5080},{"id":5079},"missing-dependencies",[5081],{"type":50,"value":5082},"Missing Dependencies",{"type":44,"tag":60,"props":5084,"children":5085},{},[5086,5090],{"type":44,"tag":69,"props":5087,"children":5088},{},[5089],{"type":50,"value":4850},{"type":50,"value":5091},"\nAdd to PEP 723 header:",{"type":44,"tag":128,"props":5093,"children":5095},{"className":130,"code":5094,"language":23,"meta":132,"style":132},"# \u002F\u002F\u002F script\n# dependencies = [\"trl>=0.12.0\", \"peft>=0.7.0\", \"trackio\", \"missing-package\"]\n# \u002F\u002F\u002F\n",[5096],{"type":44,"tag":135,"props":5097,"children":5098},{"__ignoreMap":132},[5099,5110,5118],{"type":44,"tag":139,"props":5100,"children":5101},{"class":141,"line":142},[5102,5106],{"type":44,"tag":139,"props":5103,"children":5104},{},[5105],{"type":50,"value":1191},{"type":44,"tag":139,"props":5107,"children":5108},{},[5109],{"type":50,"value":1196},{"type":44,"tag":139,"props":5111,"children":5112},{"class":141,"line":151},[5113],{"type":44,"tag":139,"props":5114,"children":5115},{},[5116],{"type":50,"value":5117},"# dependencies = [\"trl>=0.12.0\", \"peft>=0.7.0\", \"trackio\", \"missing-package\"]\n",{"type":44,"tag":139,"props":5119,"children":5120},{"class":141,"line":160},[5121,5125],{"type":44,"tag":139,"props":5122,"children":5123},{},[5124],{"type":50,"value":1191},{"type":44,"tag":139,"props":5126,"children":5127},{},[5128],{"type":50,"value":1216},{"type":44,"tag":53,"props":5130,"children":5132},{"id":5131},"troubleshooting",[5133],{"type":50,"value":5134},"Troubleshooting",{"type":44,"tag":60,"props":5136,"children":5137},{},[5138],{"type":44,"tag":69,"props":5139,"children":5140},{},[5141],{"type":50,"value":5142},"Common issues:",{"type":44,"tag":75,"props":5144,"children":5145},{},[5146,5151,5156,5161,5166,5171],{"type":44,"tag":79,"props":5147,"children":5148},{},[5149],{"type":50,"value":5150},"Job times out → Increase timeout, reduce epochs\u002Fdataset, use smaller model\u002FLoRA",{"type":44,"tag":79,"props":5152,"children":5153},{},[5154],{"type":50,"value":5155},"Model not saved to Hub → Check push_to_hub=True, hub_model_id, secrets=HF_TOKEN",{"type":44,"tag":79,"props":5157,"children":5158},{},[5159],{"type":50,"value":5160},"Out of Memory (OOM) → Reduce batch size, increase gradient accumulation, enable LoRA, use larger GPU",{"type":44,"tag":79,"props":5162,"children":5163},{},[5164],{"type":50,"value":5165},"Dataset format error → Validate with dataset inspector (see Dataset Validation section)",{"type":44,"tag":79,"props":5167,"children":5168},{},[5169],{"type":50,"value":5170},"Import\u002Fmodule errors → Add PEP 723 header with dependencies, verify format",{"type":44,"tag":79,"props":5172,"children":5173},{},[5174,5176,5181],{"type":50,"value":5175},"Authentication errors → Check ",{"type":44,"tag":135,"props":5177,"children":5179},{"className":5178},[],[5180],{"type":50,"value":5064},{"type":50,"value":5182},", token permissions, secrets parameter",{"type":44,"tag":60,"props":5184,"children":5185},{},[5186,5190,5191,5197],{"type":44,"tag":69,"props":5187,"children":5188},{},[5189],{"type":50,"value":3057},{"type":50,"value":185},{"type":44,"tag":135,"props":5192,"children":5194},{"className":5193},[],[5195],{"type":50,"value":5196},"references\u002Ftroubleshooting.md",{"type":50,"value":5198}," for complete troubleshooting guide",{"type":44,"tag":53,"props":5200,"children":5202},{"id":5201},"resources",[5203],{"type":50,"value":5204},"Resources",{"type":44,"tag":239,"props":5206,"children":5208},{"id":5207},"references-in-this-skill",[5209],{"type":50,"value":5210},"References (In This Skill)",{"type":44,"tag":75,"props":5212,"children":5213},{},[5214,5224,5234,5244,5254,5264,5274,5284,5294],{"type":44,"tag":79,"props":5215,"children":5216},{},[5217,5222],{"type":44,"tag":135,"props":5218,"children":5220},{"className":5219},[],[5221],{"type":50,"value":191},{"type":50,"value":5223}," - Overview of SFT, DPO, GRPO, KTO, PPO, Reward Modeling",{"type":44,"tag":79,"props":5225,"children":5226},{},[5227,5232],{"type":44,"tag":135,"props":5228,"children":5230},{"className":5229},[],[5231],{"type":50,"value":4730},{"type":50,"value":5233}," - Common training patterns and examples",{"type":44,"tag":79,"props":5235,"children":5236},{},[5237,5242],{"type":44,"tag":135,"props":5238,"children":5240},{"className":5239},[],[5241],{"type":50,"value":262},{"type":50,"value":5243}," - Unsloth for fast VLM training (~2x speed, 60% less VRAM)",{"type":44,"tag":79,"props":5245,"children":5246},{},[5247,5252],{"type":44,"tag":135,"props":5248,"children":5250},{"className":5249},[],[5251],{"type":50,"value":4613},{"type":50,"value":5253}," - Complete GGUF conversion guide",{"type":44,"tag":79,"props":5255,"children":5256},{},[5257,5262],{"type":44,"tag":135,"props":5258,"children":5260},{"className":5259},[],[5261],{"type":50,"value":3848},{"type":50,"value":5263}," - Trackio monitoring setup",{"type":44,"tag":79,"props":5265,"children":5266},{},[5267,5272],{"type":44,"tag":135,"props":5268,"children":5270},{"className":5269},[],[5271],{"type":50,"value":3064},{"type":50,"value":5273}," - Hardware specs and selection",{"type":44,"tag":79,"props":5275,"children":5276},{},[5277,5282],{"type":44,"tag":135,"props":5278,"children":5280},{"className":5279},[],[5281],{"type":50,"value":3279},{"type":50,"value":5283}," - Hub authentication troubleshooting",{"type":44,"tag":79,"props":5285,"children":5286},{},[5287,5292],{"type":44,"tag":135,"props":5288,"children":5290},{"className":5289},[],[5291],{"type":50,"value":5196},{"type":50,"value":5293}," - Common issues and solutions",{"type":44,"tag":79,"props":5295,"children":5296},{},[5297,5303],{"type":44,"tag":135,"props":5298,"children":5300},{"className":5299},[],[5301],{"type":50,"value":5302},"references\u002Flocal_training_macos.md",{"type":50,"value":5304}," - Local training on macOS",{"type":44,"tag":239,"props":5306,"children":5308},{"id":5307},"scripts-in-this-skill",[5309],{"type":50,"value":5310},"Scripts (In This Skill)",{"type":44,"tag":75,"props":5312,"children":5313},{},[5314,5324,5334,5344,5354,5364,5375],{"type":44,"tag":79,"props":5315,"children":5316},{},[5317,5322],{"type":44,"tag":135,"props":5318,"children":5320},{"className":5319},[],[5321],{"type":50,"value":453},{"type":50,"value":5323}," - Production SFT template",{"type":44,"tag":79,"props":5325,"children":5326},{},[5327,5332],{"type":44,"tag":135,"props":5328,"children":5330},{"className":5329},[],[5331],{"type":50,"value":461},{"type":50,"value":5333}," - Production DPO template",{"type":44,"tag":79,"props":5335,"children":5336},{},[5337,5342],{"type":44,"tag":135,"props":5338,"children":5340},{"className":5339},[],[5341],{"type":50,"value":3812},{"type":50,"value":5343}," - Production GRPO template",{"type":44,"tag":79,"props":5345,"children":5346},{},[5347,5352],{"type":44,"tag":135,"props":5348,"children":5350},{"className":5349},[],[5351],{"type":50,"value":336},{"type":50,"value":5353}," - Unsloth text LLM training template (faster, less VRAM)",{"type":44,"tag":79,"props":5355,"children":5356},{},[5357,5362],{"type":44,"tag":135,"props":5358,"children":5360},{"className":5359},[],[5361],{"type":50,"value":3629},{"type":50,"value":5363}," - Estimate time and cost (offer when appropriate)",{"type":44,"tag":79,"props":5365,"children":5366},{},[5367,5373],{"type":44,"tag":135,"props":5368,"children":5370},{"className":5369},[],[5371],{"type":50,"value":5372},"scripts\u002Fconvert_to_gguf.py",{"type":50,"value":5374}," - Complete GGUF conversion script",{"type":44,"tag":79,"props":5376,"children":5377},{},[5378,5383],{"type":44,"tag":135,"props":5379,"children":5381},{"className":5380},[],[5382],{"type":50,"value":3479},{"type":50,"value":5384}," - Search for benchmark results and leaderboards by task, alias or free text.",{"type":44,"tag":239,"props":5386,"children":5388},{"id":5387},"external-scripts",[5389],{"type":50,"value":5390},"External Scripts",{"type":44,"tag":75,"props":5392,"children":5393},{},[5394],{"type":44,"tag":79,"props":5395,"children":5396},{},[5397,5404,5406,5411,5413,5419],{"type":44,"tag":568,"props":5398,"children":5401},{"href":5399,"rel":5400},"https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fmcp-tools\u002Fskills\u002Fraw\u002Fmain\u002Fdataset_inspector.py",[572],[5402],{"type":50,"value":5403},"Dataset Inspector",{"type":50,"value":5405}," - Validate dataset format before training (use via ",{"type":44,"tag":135,"props":5407,"children":5409},{"className":5408},[],[5410],{"type":50,"value":480},{"type":50,"value":5412}," or ",{"type":44,"tag":135,"props":5414,"children":5416},{"className":5415},[],[5417],{"type":50,"value":5418},"hf_jobs",{"type":50,"value":994},{"type":44,"tag":239,"props":5421,"children":5423},{"id":5422},"external-links",[5424],{"type":50,"value":5425},"External Links",{"type":44,"tag":75,"props":5427,"children":5428},{},[5429,5439,5449,5458,5468,5477,5487],{"type":44,"tag":79,"props":5430,"children":5431},{},[5432],{"type":44,"tag":568,"props":5433,"children":5436},{"href":5434,"rel":5435},"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftrl",[572],[5437],{"type":50,"value":5438},"TRL Documentation",{"type":44,"tag":79,"props":5440,"children":5441},{},[5442],{"type":44,"tag":568,"props":5443,"children":5446},{"href":5444,"rel":5445},"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftrl\u002Fen\u002Fjobs_training",[572],[5447],{"type":50,"value":5448},"TRL Jobs Training Guide",{"type":44,"tag":79,"props":5450,"children":5451},{},[5452],{"type":44,"tag":568,"props":5453,"children":5455},{"href":2783,"rel":5454},[572],[5456],{"type":50,"value":5457},"TRL Jobs Package",{"type":44,"tag":79,"props":5459,"children":5460},{},[5461],{"type":44,"tag":568,"props":5462,"children":5465},{"href":5463,"rel":5464},"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Fhuggingface_hub\u002Fguides\u002Fjobs",[572],[5466],{"type":50,"value":5467},"HF Jobs Documentation",{"type":44,"tag":79,"props":5469,"children":5470},{},[5471],{"type":44,"tag":568,"props":5472,"children":5474},{"href":1988,"rel":5473},[572],[5475],{"type":50,"value":5476},"TRL Example Scripts",{"type":44,"tag":79,"props":5478,"children":5479},{},[5480],{"type":44,"tag":568,"props":5481,"children":5484},{"href":5482,"rel":5483},"https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002Fguides\u002Fscripts\u002F",[572],[5485],{"type":50,"value":5486},"UV Scripts Guide",{"type":44,"tag":79,"props":5488,"children":5489},{},[5490],{"type":44,"tag":568,"props":5491,"children":5494},{"href":5492,"rel":5493},"https:\u002F\u002Fhuggingface.co\u002Fuv-scripts",[572],[5495],{"type":50,"value":5496},"UV Scripts Organization",{"type":44,"tag":53,"props":5498,"children":5500},{"id":5499},"key-takeaways",[5501],{"type":50,"value":5502},"Key Takeaways",{"type":44,"tag":351,"props":5504,"children":5505},{},[5506,5523,5533,5543,5553,5563,5578,5602,5612,5622],{"type":44,"tag":79,"props":5507,"children":5508},{},[5509,5514,5516,5521],{"type":44,"tag":69,"props":5510,"children":5511},{},[5512],{"type":50,"value":5513},"Submit scripts inline",{"type":50,"value":5515}," - The ",{"type":44,"tag":135,"props":5517,"children":5519},{"className":5518},[],[5520],{"type":50,"value":393},{"type":50,"value":5522}," parameter accepts Python code directly; no file saving required unless user requests",{"type":44,"tag":79,"props":5524,"children":5525},{},[5526,5531],{"type":44,"tag":69,"props":5527,"children":5528},{},[5529],{"type":50,"value":5530},"Jobs are asynchronous",{"type":50,"value":5532}," - Don't wait\u002Fpoll; let user check when ready",{"type":44,"tag":79,"props":5534,"children":5535},{},[5536,5541],{"type":44,"tag":69,"props":5537,"children":5538},{},[5539],{"type":50,"value":5540},"Always set timeout",{"type":50,"value":5542}," - Default 30 min is insufficient; minimum 1-2 hours recommended",{"type":44,"tag":79,"props":5544,"children":5545},{},[5546,5551],{"type":44,"tag":69,"props":5547,"children":5548},{},[5549],{"type":50,"value":5550},"Always enable Hub push",{"type":50,"value":5552}," - Environment is ephemeral; without push, all results lost",{"type":44,"tag":79,"props":5554,"children":5555},{},[5556,5561],{"type":44,"tag":69,"props":5557,"children":5558},{},[5559],{"type":50,"value":5560},"Include Trackio",{"type":50,"value":5562}," - Use example scripts as templates for real-time monitoring",{"type":44,"tag":79,"props":5564,"children":5565},{},[5566,5571,5573],{"type":44,"tag":69,"props":5567,"children":5568},{},[5569],{"type":50,"value":5570},"Offer cost estimation",{"type":50,"value":5572}," - When parameters are known, use ",{"type":44,"tag":135,"props":5574,"children":5576},{"className":5575},[],[5577],{"type":50,"value":3629},{"type":44,"tag":79,"props":5579,"children":5580},{},[5581,5586,5588,5593,5595,5600],{"type":44,"tag":69,"props":5582,"children":5583},{},[5584],{"type":50,"value":5585},"Use UV scripts (Approach 1)",{"type":50,"value":5587}," - Default to ",{"type":44,"tag":135,"props":5589,"children":5591},{"className":5590},[],[5592],{"type":50,"value":377},{"type":50,"value":5594}," with inline scripts; TRL maintained scripts for standard training; avoid bash ",{"type":44,"tag":135,"props":5596,"children":5598},{"className":5597},[],[5599],{"type":50,"value":385},{"type":50,"value":5601}," commands in Claude Code",{"type":44,"tag":79,"props":5603,"children":5604},{},[5605,5610],{"type":44,"tag":69,"props":5606,"children":5607},{},[5608],{"type":50,"value":5609},"Use hf_doc_fetch\u002Fhf_doc_search",{"type":50,"value":5611}," for latest TRL documentation",{"type":44,"tag":79,"props":5613,"children":5614},{},[5615,5620],{"type":44,"tag":69,"props":5616,"children":5617},{},[5618],{"type":50,"value":5619},"Validate dataset format",{"type":50,"value":5621}," before training with dataset inspector (see Dataset Validation section)",{"type":44,"tag":79,"props":5623,"children":5624},{},[5625,5630],{"type":44,"tag":69,"props":5626,"children":5627},{},[5628],{"type":50,"value":5629},"Choose appropriate hardware",{"type":50,"value":5631}," for model size; use LoRA for models >7B",{"type":44,"tag":5633,"props":5634,"children":5635},"style",{},[5636],{"type":50,"value":5637},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":5639,"total":1376},[5640,5655,5669,5682,5695,5710,5724],{"slug":5641,"name":5641,"fn":5642,"description":5643,"org":5644,"tags":5645,"stars":27,"repoUrl":28,"updatedAt":5654},"hf-cli","manage Hugging Face Hub resources via CLI","Hugging Face Hub CLI (`hf`) for downloading, uploading, and managing models, datasets, spaces, buckets, repos, papers, jobs, and more on the Hugging Face Hub. Use when: handling authentication; managing local cache; managing Hugging Face Buckets; running or scheduling jobs on Hugging Face infrastructure; managing Hugging Face repos; discussions and pull requests; browsing models, datasets and spaces; reading, searching, or browsing academic papers; managing collections; querying datasets; configuring spaces; setting up webhooks; or deploying and managing HF Inference Endpoints. Make sure to use this skill whenever the user mentions 'hf', 'huggingface', 'Hugging Face', 'huggingface-cli', or 'hugging face cli', or wants to do anything related to the Hugging Face ecosystem and to AI and ML in general. Also use for cloud storage needs like training checkpoints, data pipelines, or agent traces. Use even if the user doesn't explicitly ask for a CLI command. Replaces the deprecated `huggingface-cli`.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5646,5649,5652,5653],{"name":5647,"slug":5648,"type":14},"CLI","cli",{"name":5650,"slug":5651,"type":14},"Datasets","datasets",{"name":9,"slug":13,"type":14},{"name":16,"slug":17,"type":14},"2026-04-06T18:25:34.020855",{"slug":5656,"name":5656,"fn":5657,"description":5658,"org":5659,"tags":5660,"stars":27,"repoUrl":28,"updatedAt":5668},"hf-cloud-aws-context-discovery","discover local AWS environment context","Discover the user's local AWS context (active profile, region, account ID, caller identity) at the start of any AWS task. Use this skill before any other AWS work — deploying to SageMaker, creating resources, calling AWS APIs, or anything that touches an AWS account. Use it especially when the user has not specified a region or profile explicitly, when they say things like \"use my AWS account\", \"deploy to AWS\", \"use my profile\", or when about to make any AWS CLI or SDK call. Never guess the region or account ID — always use this skill to read it from the local configuration first.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5661,5664,5665],{"name":5662,"slug":5663,"type":14},"AWS","aws",{"name":5647,"slug":5648,"type":14},{"name":5666,"slug":5667,"type":14},"Configuration","configuration","2026-07-08T05:55:33.716099",{"slug":5670,"name":5670,"fn":5671,"description":5672,"org":5673,"tags":5674,"stars":27,"repoUrl":28,"updatedAt":5681},"hf-cloud-python-env-setup","set up Python environments for AWS","Set up an isolated Python environment for SageMaker \u002F AWS work, with the right Python version and current boto3. Use this skill whenever Python code will be executed for a SageMaker deployment, training job, or any AWS automation — including when about to run `pip install`, when about to invoke `boto3`, when creating or activating a virtualenv, or when the user asks to \"set up the environment\". Never use system Python and never `pip install` into it. Always isolate. This skill prevents the most common failure modes: wrong Python version, dependency conflicts, and stale SDKs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5675,5676,5677,5680],{"name":25,"slug":26,"type":14},{"name":5662,"slug":5663,"type":14},{"name":5678,"slug":5679,"type":14},"Engineering","engineering",{"name":22,"slug":23,"type":14},"2026-07-08T05:55:32.505017",{"slug":5683,"name":5683,"fn":5684,"description":5685,"org":5686,"tags":5687,"stars":27,"repoUrl":28,"updatedAt":5694},"hf-cloud-sagemaker-deployment-planner","plan model deployments to Amazon SageMaker","Plan and coordinate the deployment of a model to Amazon SageMaker AI. Use this skill whenever the user wants to deploy, host, serve, or expose a model on SageMaker or AWS — including phrases like \"deploy a model\", \"host this LLM on AWS\", \"serve this embedding model\", \"deploy a reranker\", \"deploy a text-to-image \u002F diffusion model\", \"host this for async inference\", \"create an endpoint\", \"serve my fine-tuned model\", or any request that involves making a model available for inference on AWS. Use this even when the user is vague (e.g. \"I just want to get this running on AWS, you figure it out\"). Works for text-generation LLMs, embedding models, rerankers, classifiers, text-to-image \u002F diffusion models — picks the right serving stack and chooses between real-time and async inference. This is the entry-point skill for SageMaker deployment work — it asks clarifying questions, picks a deployment pathway, and coordinates the other deployment skills.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5688,5689,5690,5693],{"name":25,"slug":26,"type":14},{"name":5662,"slug":5663,"type":14},{"name":5691,"slug":5692,"type":14},"Deployment","deployment",{"name":9,"slug":13,"type":14},"2026-07-08T05:55:37.387689",{"slug":5696,"name":5696,"fn":5697,"description":5698,"org":5699,"tags":5700,"stars":27,"repoUrl":28,"updatedAt":5709},"hf-cloud-sagemaker-iam-preflight","configure SageMaker IAM roles","Ensure a usable SageMaker execution role exists before deploying or training. Use this skill whenever about to create a SageMaker endpoint, model, training job, or any resource that requires an execution role. Use it especially when the user has not provided a role ARN explicitly, when scripts are about to call `iam:CreateRole`, or when an AccessDenied error mentions an IAM action. Never blindly call `iam:CreateRole` — always check for existing roles first. This skill prevents the most common SageMaker deployment failure: trying to create IAM resources from an SSO principal that has no IAM write permissions.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5701,5702,5703,5706],{"name":25,"slug":26,"type":14},{"name":5662,"slug":5663,"type":14},{"name":5704,"slug":5705,"type":14},"Permissions","permissions",{"name":5707,"slug":5708,"type":14},"Security","security","2026-07-08T05:55:34.948771",{"slug":5711,"name":5711,"fn":5712,"description":5713,"org":5714,"tags":5715,"stars":27,"repoUrl":28,"updatedAt":5723},"hf-cloud-sagemaker-production-defaults","create production-ready SageMaker endpoints","Create a SageMaker endpoint (real-time or async) with autoscaling, CloudWatch alarms, and tagging enabled by default. Use this skill whenever about to create a SageMaker endpoint, write deployment code that calls `create_endpoint`, or finalize a deployment after the image URI and IAM role are known. Provides deploy.py for real-time endpoints and deploy_async.py for async endpoints (with genuine scale-to-zero support). This is the last step in the SageMaker deployment workflow. Never generate a bare `create_endpoint` call without these defaults — endpoints without autoscaling or alarms are demos, not deployments.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5716,5717,5718,5719,5720],{"name":25,"slug":26,"type":14},{"name":5662,"slug":5663,"type":14},{"name":5691,"slug":5692,"type":14},{"name":9,"slug":13,"type":14},{"name":5721,"slug":5722,"type":14},"Monitoring","monitoring","2026-07-08T05:55:38.664702",{"slug":5725,"name":5725,"fn":5726,"description":5727,"org":5728,"tags":5729,"stars":27,"repoUrl":28,"updatedAt":5733},"hf-cloud-serving-image-selection","select SageMaker serving containers","Pick the right serving container for a SageMaker model deployment and find its current image URI. Use this skill whenever about to deploy a model to a SageMaker endpoint and an image URI needs to be chosen — including when the user says \"deploy this LLM\", \"host this HuggingFace model\", \"serve this fine-tuned model\", \"deploy this embedding model\", \"host a reranker\", \"serve a sentence-transformers model\", or when about to hardcode any container URI in deployment code. HuggingFace-curated Deep Learning Containers are ALWAYS preferred: HuggingFace vLLM (LLMs and generative rerankers), HuggingFace vLLM-Omni (multimodal), TEI (embeddings\u002Fcross-encoder rerankers), HF Inference Toolkit (other transformers). Generic images (AWS vLLM, DJL-LMI, SGLang) are used only when no HuggingFace image is compatible — never merely because they carry a newer version. Never hardcode a container URI from memory and never default to TGI. Prevents stale-image failures and wrong-region URIs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5730,5731,5732],{"name":25,"slug":26,"type":14},{"name":5662,"slug":5663,"type":14},{"name":5691,"slug":5692,"type":14},"2026-07-08T05:55:36.173465",{"items":5735,"total":1492},[5736,5752,5765,5772,5778,5785,5792,5799,5807,5813,5826,5840],{"slug":5737,"name":5737,"fn":5738,"description":5739,"org":5740,"tags":5741,"stars":5749,"repoUrl":5750,"updatedAt":5751},"train-sentence-transformers","train sentence-transformers models","Train or fine-tune sentence-transformers models across `SentenceTransformer` (bi-encoder; dense or static embedding model; for retrieval, similarity, clustering, classification, paraphrase mining, dedup, multimodal), `CrossEncoder` (reranker; pair scoring for two-stage retrieval \u002F pair classification), and `SparseEncoder` (SPLADE, sparse embedding model; for learned-sparse retrieval). Covers loss selection, hard-negative mining, evaluators, distillation, LoRA, Matryoshka, and Hugging Face Hub publishing. Use for any sentence-transformers training task.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5742,5743,5744,5745,5746],{"name":19,"slug":20,"type":14},{"name":9,"slug":13,"type":14},{"name":16,"slug":17,"type":14},{"name":22,"slug":23,"type":14},{"name":5747,"slug":5748,"type":14},"Search","search",18914,"https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fsentence-transformers","2026-05-08T05:09:16.820066",{"slug":5753,"name":5753,"fn":5,"description":5754,"org":5755,"tags":5756,"stars":5762,"repoUrl":5763,"updatedAt":5764},"trl-training","Train and fine-tune transformer language models using TRL (Transformers Reinforcement Learning). Supports SFT, DPO, GRPO, KTO, RLOO and Reward Model training via CLI commands.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5757,5758,5759,5760,5761],{"name":25,"slug":26,"type":14},{"name":19,"slug":20,"type":14},{"name":9,"slug":13,"type":14},{"name":16,"slug":17,"type":14},{"name":22,"slug":23,"type":14},18850,"https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftrl","2026-04-06T18:25:32.746828",{"slug":5641,"name":5641,"fn":5642,"description":5643,"org":5766,"tags":5767,"stars":27,"repoUrl":28,"updatedAt":5654},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5768,5769,5770,5771],{"name":5647,"slug":5648,"type":14},{"name":5650,"slug":5651,"type":14},{"name":9,"slug":13,"type":14},{"name":16,"slug":17,"type":14},{"slug":5656,"name":5656,"fn":5657,"description":5658,"org":5773,"tags":5774,"stars":27,"repoUrl":28,"updatedAt":5668},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5775,5776,5777],{"name":5662,"slug":5663,"type":14},{"name":5647,"slug":5648,"type":14},{"name":5666,"slug":5667,"type":14},{"slug":5670,"name":5670,"fn":5671,"description":5672,"org":5779,"tags":5780,"stars":27,"repoUrl":28,"updatedAt":5681},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5781,5782,5783,5784],{"name":25,"slug":26,"type":14},{"name":5662,"slug":5663,"type":14},{"name":5678,"slug":5679,"type":14},{"name":22,"slug":23,"type":14},{"slug":5683,"name":5683,"fn":5684,"description":5685,"org":5786,"tags":5787,"stars":27,"repoUrl":28,"updatedAt":5694},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5788,5789,5790,5791],{"name":25,"slug":26,"type":14},{"name":5662,"slug":5663,"type":14},{"name":5691,"slug":5692,"type":14},{"name":9,"slug":13,"type":14},{"slug":5696,"name":5696,"fn":5697,"description":5698,"org":5793,"tags":5794,"stars":27,"repoUrl":28,"updatedAt":5709},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5795,5796,5797,5798],{"name":25,"slug":26,"type":14},{"name":5662,"slug":5663,"type":14},{"name":5704,"slug":5705,"type":14},{"name":5707,"slug":5708,"type":14},{"slug":5711,"name":5711,"fn":5712,"description":5713,"org":5800,"tags":5801,"stars":27,"repoUrl":28,"updatedAt":5723},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5802,5803,5804,5805,5806],{"name":25,"slug":26,"type":14},{"name":5662,"slug":5663,"type":14},{"name":5691,"slug":5692,"type":14},{"name":9,"slug":13,"type":14},{"name":5721,"slug":5722,"type":14},{"slug":5725,"name":5725,"fn":5726,"description":5727,"org":5808,"tags":5809,"stars":27,"repoUrl":28,"updatedAt":5733},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5810,5811,5812],{"name":25,"slug":26,"type":14},{"name":5662,"slug":5663,"type":14},{"name":5691,"slug":5692,"type":14},{"slug":5814,"name":5814,"fn":5815,"description":5816,"org":5817,"tags":5818,"stars":27,"repoUrl":28,"updatedAt":5825},"hf-mcp","access Hugging Face Hub via MCP","Use Hugging Face Hub via MCP server tools. Search models, datasets, Spaces, papers. Get repo details, fetch documentation, run compute jobs, and use Gradio Spaces as AI tools. Available when connected to the HF MCP server.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5819,5820,5821,5822],{"name":5650,"slug":5651,"type":14},{"name":9,"slug":13,"type":14},{"name":16,"slug":17,"type":14},{"name":5823,"slug":5824,"type":14},"MCP","mcp","2026-04-06T18:25:50.364185",{"slug":5827,"name":5827,"fn":5828,"description":5829,"org":5830,"tags":5831,"stars":27,"repoUrl":28,"updatedAt":5839},"hf-mem","estimate memory for Hugging Face models","Hugging Face CLI to estimate the required memory to load Safetensors or GGUF model weights for inference from the Hugging Face Hub",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5832,5833,5834,5835,5836],{"name":25,"slug":26,"type":14},{"name":5647,"slug":5648,"type":14},{"name":9,"slug":13,"type":14},{"name":16,"slug":17,"type":14},{"name":5837,"slug":5838,"type":14},"Performance","performance","2026-06-13T07:23:57.101435",{"slug":5841,"name":5841,"fn":5842,"description":5843,"org":5844,"tags":5845,"stars":27,"repoUrl":28,"updatedAt":5854},"huggingface-best","find and compare Hugging Face models","Use when the user asks about finding the best, top, or recommended model for a task, wants to know what AI model to use, or wants to compare models by benchmark scores. Triggers on: \"best model for X\", \"what model should I use for\", \"top models for [task]\", \"which model runs on my laptop\u002Fmachine\u002Fdevice\", \"recommend a model for\", \"what LLM should I use for\", \"compare models for\", \"what's state of the art for\", or any question about choosing an AI model for a specific use case. Always use this skill when the user wants model recommendations or comparisons, even if they don't explicitly mention HuggingFace or benchmarks.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5846,5849,5850,5851],{"name":5847,"slug":5848,"type":14},"Analytics","analytics",{"name":9,"slug":13,"type":14},{"name":16,"slug":17,"type":14},{"name":5852,"slug":5853,"type":14},"Research","research","2026-04-24T05:09:45.870658"]