[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-huggingface-huggingface-vision-trainer":3,"mdc--cal010-key":38,"related-org-huggingface-huggingface-vision-trainer":4988,"related-repo-huggingface-huggingface-vision-trainer":5159},{"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-vision-trainer","train and fine-tune computer vision models","Trains and fine-tunes vision models for object detection (D-FINE, RT-DETR v2, DETR, YOLOS), image classification (timm models — MobileNetV3, MobileViT, ResNet, ViT\u002FDINOv3 — plus any Transformers classifier), and SAM\u002FSAM2 segmentation using Hugging Face Transformers on Hugging Face Jobs cloud GPUs. Covers COCO-format dataset preparation, Albumentations augmentation, mAP\u002FmAR evaluation, accuracy metrics, SAM segmentation with bbox\u002Fpoint prompts, DiceCE loss, hardware selection, cost estimation, Trackio monitoring, and Hub persistence. Use when users mention training object detection, image classification, SAM, SAM2, segmentation, image matting, DETR, D-FINE, RT-DETR, ViT, timm, MobileNet, ResNet, bounding box models, or fine-tuning vision models on Hugging Face Jobs.",{"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},"Deep Learning","deep-learning",{"name":19,"slug":20,"type":14},"Python","python",{"name":22,"slug":23,"type":14},"AI Infrastructure","ai-infrastructure",{"name":25,"slug":26,"type":14},"Computer Vision","computer-vision",10861,"https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fskills","2026-04-06T18:25:42.770515",null,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-vision-trainer","---\nname: huggingface-vision-trainer\ndescription: Trains and fine-tunes vision models for object detection (D-FINE, RT-DETR v2, DETR, YOLOS), image classification (timm models — MobileNetV3, MobileViT, ResNet, ViT\u002FDINOv3 — plus any Transformers classifier), and SAM\u002FSAM2 segmentation using Hugging Face Transformers on Hugging Face Jobs cloud GPUs. Covers COCO-format dataset preparation, Albumentations augmentation, mAP\u002FmAR evaluation, accuracy metrics, SAM segmentation with bbox\u002Fpoint prompts, DiceCE loss, hardware selection, cost estimation, Trackio monitoring, and Hub persistence. Use when users mention training object detection, image classification, SAM, SAM2, segmentation, image matting, DETR, D-FINE, RT-DETR, ViT, timm, MobileNet, ResNet, bounding box models, or fine-tuning vision models on Hugging Face Jobs.\n---\n\n# Vision Model Training on Hugging Face Jobs\n\nTrain object detection, image classification, and SAM\u002FSAM2 segmentation models on managed cloud GPUs. No local GPU setup required—results are automatically saved to the Hugging Face Hub.\n\n## When to Use This Skill\n\nUse this skill when users want to:\n- Fine-tune object detection models (D-FINE, RT-DETR v2, DETR, YOLOS) on cloud GPUs or local\n- Fine-tune image classification models (timm: MobileNetV3, MobileViT, ResNet, ViT\u002FDINOv3, or any Transformers classifier) on cloud GPUs or local\n- Fine-tune SAM or SAM2 models for segmentation \u002F image matting using bbox or point prompts\n- Train bounding-box detectors on custom datasets\n- Train image classifiers on custom datasets\n- Train segmentation models on custom mask datasets with prompts\n- Run vision training jobs on Hugging Face Jobs infrastructure\n- Ensure trained vision models are permanently saved to the Hub\n\n## Related Skills\n\n- **`hugging-face-jobs`** — General HF Jobs infrastructure: token authentication, hardware flavors, timeout management, cost estimation, secrets, environment variables, scheduled jobs, and result persistence. **Refer to the Jobs skill for any non-training-specific Jobs questions** (e.g., \"how do secrets work?\", \"what hardware is available?\", \"how do I pass tokens?\").\n- **`hugging-face-model-trainer`** — TRL-based language model training (SFT, DPO, GRPO). Use that skill for text\u002Flanguage model fine-tuning.\n\n## Local Script Execution\n\nHelper scripts use PEP 723 inline dependencies. Run them with `uv run`:\n```bash\nuv run scripts\u002Fdataset_inspector.py --dataset username\u002Fdataset-name --split train\nuv run scripts\u002Festimate_cost.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()` (tool) or `hf auth whoami` (terminal)\n- Token has **write** permissions\n- **MUST pass token in job secrets** — see directive #3 below for syntax (MCP tool vs Python API)\n\n### Dataset Requirements — Object Detection\n- Dataset must exist on Hub\n- Annotations must use the `objects` column with `bbox`, `category` (and optionally `area`) sub-fields\n- Bboxes can be in **xywh (COCO)** or **xyxy (Pascal VOC)** format — auto-detected and converted\n- Categories can be **integers or strings** — strings are auto-remapped to integer IDs\n- `image_id` column is **optional** — generated automatically if missing\n- **ALWAYS validate unknown datasets** before GPU training (see Dataset Validation section)\n\n### Dataset Requirements — Image Classification\n- Dataset must exist on Hub\n- Must have an **`image` column** (PIL images) and a **`label` column** (integer class IDs or strings)\n- The label column can be `ClassLabel` type (with names) or plain integers\u002Fstrings — strings are auto-remapped\n- Common column names auto-detected: `label`, `labels`, `class`, `fine_label`\n- **ALWAYS validate unknown datasets** before GPU training (see Dataset Validation section)\n\n### Dataset Requirements — SAM\u002FSAM2 Segmentation\n- Dataset must exist on Hub\n- Must have an **`image` column** (PIL images) and a **`mask` column** (binary ground-truth segmentation mask)\n- Must have a **prompt** — either:\n  - A **`prompt` column** with JSON containing `{\"bbox\": [x0,y0,x1,y1]}` or `{\"point\": [x,y]}`\n  - OR a dedicated **`bbox`** column with `[x0,y0,x1,y1]` values\n  - OR a dedicated **`point`** column with `[x,y]` or `[[x,y],...]` values\n- Bboxes should be in **xyxy** format (absolute pixel coordinates)\n- Example dataset: `merve\u002FMicroMat-mini` (image matting with bbox prompts)\n- **ALWAYS validate unknown datasets** before GPU training (see Dataset Validation section)\n\n### Critical Settings\n- **Timeout must exceed expected training time** — Default 30min is TOO SHORT. See directive #6 for recommended values.\n- **Hub push must be enabled** — `push_to_hub=True`, `hub_model_id=\"username\u002Fmodel-name\"`, token in `secrets`\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**ALWAYS validate for** unknown\u002Fcustom datasets or any dataset you haven't trained with before. **Skip for** `cppe-5` (the default in the training script).\n\n### Running the Inspector\n\n**Option 1: Via HF Jobs (recommended — avoids local SSL\u002Fdependency issues):**\n```python\nhf_jobs(\"uv\", {\n    \"script\": \"path\u002Fto\u002Fdataset_inspector.py\",\n    \"script_args\": [\"--dataset\", \"username\u002Fdataset-name\", \"--split\", \"train\"]\n})\n```\n\n**Option 2: Locally:**\n```bash\nuv run scripts\u002Fdataset_inspector.py --dataset username\u002Fdataset-name --split train\n```\n\n**Option 3: Via `HfApi().run_uv_job()` (if hf_jobs MCP unavailable):**\n```python\nfrom huggingface_hub import HfApi\napi = HfApi()\napi.run_uv_job(\n    script=\"scripts\u002Fdataset_inspector.py\",\n    script_args=[\"--dataset\", \"username\u002Fdataset-name\", \"--split\", \"train\"],\n    flavor=\"cpu-basic\",\n    timeout=300,\n)\n```\n\n### Reading Results\n\n- **`✓ READY`** — Dataset is compatible, use directly\n- **`✗ NEEDS FORMATTING`** — Needs preprocessing (mapping code provided in output)\n\n## Automatic Bbox Preprocessing\n\nThe object detection training script (`scripts\u002Fobject_detection_training.py`) automatically handles bbox format detection (xyxy→xywh conversion), bbox sanitization, `image_id` generation, string category→integer remapping, and dataset truncation. **No manual preprocessing needed** — just ensure the dataset has `objects.bbox` and `objects.category` columns.\n\n## Training workflow\n\nCopy this checklist and track progress:\n\n```\nTraining Progress:\n- [ ] Step 1: Verify prerequisites (account, token, dataset)\n- [ ] Step 2: Validate dataset format (run dataset_inspector.py)\n- [ ] Step 3: Ask user about dataset size and validation split\n- [ ] Step 4: Prepare training script (OD: scripts\u002Fobject_detection_training.py, IC: scripts\u002Fimage_classification_training.py, SAM: scripts\u002Fsam_segmentation_training.py)\n- [ ] Step 5: Save script locally, submit job, and report details\n```\n\n**Step 1: Verify prerequisites**\n\nFollow the Prerequisites Checklist above.\n\n**Step 2: Validate dataset**\n\nRun the dataset inspector BEFORE spending GPU time. See \"Dataset Validation\" section above.\n\n**Step 3: Ask user preferences**\n\nALWAYS use the AskUserQuestion tool with option-style format:\n\n```python\nAskUserQuestion({\n    \"questions\": [\n        {\n            \"question\": \"Do you want to run a quick test with a subset of the data first?\",\n            \"header\": \"Dataset Size\",\n            \"options\": [\n                {\"label\": \"Quick test run (10% of data)\", \"description\": \"Faster, cheaper (~30-60 min, ~$2-5) to validate setup\"},\n                {\"label\": \"Full dataset (Recommended)\", \"description\": \"Complete training for best model quality\"}\n            ],\n            \"multiSelect\": false\n        },\n        {\n            \"question\": \"Do you want to create a validation split from the training data?\",\n            \"header\": \"Split data\",\n            \"options\": [\n                {\"label\": \"Yes (Recommended)\", \"description\": \"Automatically split 15% of training data for validation\"},\n                {\"label\": \"No\", \"description\": \"Use existing validation split from dataset\"}\n            ],\n            \"multiSelect\": false\n        },\n        {\n            \"question\": \"Which GPU hardware do you want to use?\",\n            \"header\": \"Hardware Flavor\",\n            \"options\": [\n                {\"label\": \"t4-small ($0.40\u002Fhr)\", \"description\": \"1x T4, 16 GB VRAM — sufficient for all OD models under 100M params\"},\n                {\"label\": \"l4x1 ($0.80\u002Fhr)\", \"description\": \"1x L4, 24 GB VRAM — more headroom for large images or batch sizes\"},\n                {\"label\": \"a10g-large ($1.50\u002Fhr)\", \"description\": \"1x A10G, 24 GB VRAM — faster training, more CPU\u002FRAM\"},\n                {\"label\": \"a100-large ($2.50\u002Fhr)\", \"description\": \"1x A100, 80 GB VRAM — fastest, for very large datasets or image sizes\"}\n            ],\n            \"multiSelect\": false\n        }\n    ]\n})\n```\n\n**Step 4: Prepare training script**\n\nFor object detection, use [scripts\u002Fobject_detection_training.py](scripts\u002Fobject_detection_training.py) as the production-ready template. For image classification, use [scripts\u002Fimage_classification_training.py](scripts\u002Fimage_classification_training.py). For SAM\u002FSAM2 segmentation, use [scripts\u002Fsam_segmentation_training.py](scripts\u002Fsam_segmentation_training.py). All scripts use `HfArgumentParser` — all configuration is passed via CLI arguments in `script_args`, NOT by editing Python variables. For timm model details, see [references\u002Ftimm_trainer.md](references\u002Ftimm_trainer.md). For SAM2 training details, see [references\u002Ffinetune_sam2_trainer.md](references\u002Ffinetune_sam2_trainer.md).\n\n**Step 5: Save script, submit job, and report**\n\n1. **Save the script locally** to `submitted_jobs\u002F` in the workspace root (create if needed) with a descriptive name like `training_\u003Cdataset>_\u003CYYYYMMDD_HHMMSS>.py`. Tell the user the path.\n2. **Submit** using `hf_jobs` MCP tool (preferred) or `HfApi().run_uv_job()` — see directive #1 for both methods. Pass all config via `script_args`.\n3. **Report** the job ID (from `.id` attribute), monitoring URL, Trackio dashboard (`https:\u002F\u002Fhuggingface.co\u002Fspaces\u002F{username}\u002Ftrackio`), expected time, and estimated cost.\n4. **Wait for user** to request status checks — don't poll automatically. Training jobs run asynchronously and can take hours.\n\n## Critical directives\n\nThese rules prevent common failures. Follow them exactly.\n\n### 1. Job submission: `hf_jobs` MCP tool vs Python API\n\n**`hf_jobs()` is an MCP tool, NOT a Python function.** Do NOT try to import it from `huggingface_hub`. Call it as a tool:\n\n```\nhf_jobs(\"uv\", {\"script\": training_script_content, \"flavor\": \"a10g-large\", \"timeout\": \"4h\", \"secrets\": {\"HF_TOKEN\": \"$HF_TOKEN\"}})\n```\n\n**If `hf_jobs` MCP tool is unavailable**, use the Python API directly:\n\n```python\nfrom huggingface_hub import HfApi, get_token\napi = HfApi()\njob_info = api.run_uv_job(\n    script=\"path\u002Fto\u002Ftraining_script.py\",  # file PATH, NOT content\n    script_args=[\"--dataset_name\", \"cppe-5\", ...],\n    flavor=\"a10g-large\",\n    timeout=14400,  # seconds (4 hours)\n    env={\"PYTHONUNBUFFERED\": \"1\"},\n    secrets={\"HF_TOKEN\": get_token()},  # MUST use get_token(), NOT \"$HF_TOKEN\"\n)\nprint(f\"Job ID: {job_info.id}\")\n```\n\n**Critical differences between the two methods:**\n\n| | `hf_jobs` MCP tool | `HfApi().run_uv_job()` |\n|---|---|---|\n| `script` param | Python code string or URL (NOT local paths) | File path to `.py` file (NOT content) |\n| Token in secrets | `\"$HF_TOKEN\"` (auto-replaced) | `get_token()` (actual token value) |\n| Timeout format | String (`\"4h\"`) | Seconds (`14400`) |\n\n**Rules for both methods:**\n- The training script MUST include PEP 723 inline metadata with dependencies\n- Do NOT use `image` or `command` parameters (those belong to `run_job()`, not `run_uv_job()`)\n\n### 2. Authentication via job secrets + explicit hub_token injection\n\n**Job config** MUST include the token in secrets — syntax depends on submission method (see table above).\n\n**Training script requirement:** The Transformers `Trainer` calls `create_repo(token=self.args.hub_token)` during `__init__()` when `push_to_hub=True`. The training script MUST inject `HF_TOKEN` into `training_args.hub_token` AFTER parsing args but BEFORE creating the `Trainer`. The template `scripts\u002Fobject_detection_training.py` already includes this:\n\n```python\nhf_token = os.environ.get(\"HF_TOKEN\")\nif training_args.push_to_hub and not training_args.hub_token:\n    if hf_token:\n        training_args.hub_token = hf_token\n```\n\nIf you write a custom script, you MUST include this token injection before the `Trainer(...)` call.\n\n- Do NOT call `login()` in custom scripts unless replicating the full pattern from `scripts\u002Fobject_detection_training.py`\n- Do NOT rely on implicit token resolution (`hub_token=None`) — unreliable in Jobs\n- See the `hugging-face-jobs` skill → *Token Usage Guide* for full details\n\n### 3. JobInfo attribute\n\nAccess the job identifier using `.id` (NOT `.job_id` or `.name` — these don't exist):\n\n```python\njob_info = api.run_uv_job(...)  # or hf_jobs(\"uv\", {...})\njob_id = job_info.id  # Correct -- returns string like \"687fb701029421ae5549d998\"\n```\n\n### 4. Required training flags and HfArgumentParser boolean syntax\n\n`scripts\u002Fobject_detection_training.py` uses `HfArgumentParser` — all config is passed via `script_args`. Boolean arguments have two syntaxes:\n\n- **`bool` fields** (e.g., `push_to_hub`, `do_train`): Use as bare flags (`--push_to_hub`) or negate with `--no_` prefix (`--no_remove_unused_columns`)\n- **`Optional[bool]` fields** (e.g., `greater_is_better`): MUST pass explicit value (`--greater_is_better True`). Bare `--greater_is_better` causes `error: expected one argument`\n\nRequired flags for object detection:\n\n```\n--no_remove_unused_columns          # MUST: preserves image column for pixel_values\n--no_eval_do_concat_batches         # MUST: images have different numbers of target boxes\n--push_to_hub                       # MUST: environment is ephemeral\n--hub_model_id username\u002Fmodel-name\n--metric_for_best_model eval_map\n--greater_is_better True            # MUST pass \"True\" explicitly (Optional[bool])\n--do_train\n--do_eval\n```\n\nRequired flags for image classification:\n\n```\n--no_remove_unused_columns          # MUST: preserves image column for pixel_values\n--push_to_hub                       # MUST: environment is ephemeral\n--hub_model_id username\u002Fmodel-name\n--metric_for_best_model eval_accuracy\n--greater_is_better True            # MUST pass \"True\" explicitly (Optional[bool])\n--do_train\n--do_eval\n```\n\nRequired flags for SAM\u002FSAM2 segmentation:\n\n```\n--remove_unused_columns False       # MUST: preserves input_boxes\u002Finput_points\n--push_to_hub                       # MUST: environment is ephemeral\n--hub_model_id username\u002Fmodel-name\n--do_train\n--prompt_type bbox                  # or \"point\"\n--dataloader_pin_memory False       # MUST: avoids pin_memory issues with custom collator\n```\n\n### 5. Timeout management\n\nDefault 30 min is TOO SHORT for object detection. Set minimum 2-4 hours. Add 30% buffer for model loading, preprocessing, and Hub push.\n\n| Scenario | Timeout |\n|----------|---------|\n| Quick test (100-200 images, 5-10 epochs) | 1h |\n| Development (500-1K images, 15-20 epochs) | 2-3h |\n| Production (1K-5K images, 30 epochs) | 4-6h |\n| Large dataset (5K+ images) | 6-12h |\n\n### 6. Trackio monitoring\n\nTrackio is **always enabled** in the object detection training script — it calls `trackio.init()` and `trackio.finish()` automatically. No need to pass `--report_to trackio`. The project name is taken from `--output_dir` and the run name from `--run_name`. For image classification, pass `--report_to trackio` in `TrainingArguments`.\n\nDashboard at: `https:\u002F\u002Fhuggingface.co\u002Fspaces\u002F{username}\u002Ftrackio`\n\n## Model & hardware selection\n\n### Recommended object detection models\n\n| Model | Params | Use case |\n|-------|--------|----------|\n| `ustc-community\u002Fdfine-small-coco` | 10.4M | Best starting point — fast, cheap, SOTA quality |\n| `PekingU\u002Frtdetr_v2_r18vd` | 20.2M | Lightweight real-time detector |\n| `ustc-community\u002Fdfine-large-coco` | 31.4M | Higher accuracy, still efficient |\n| `PekingU\u002Frtdetr_v2_r50vd` | 43M | Strong real-time baseline |\n| `ustc-community\u002Fdfine-xlarge-obj365` | 63.5M | Best accuracy (pretrained on Objects365) |\n| `PekingU\u002Frtdetr_v2_r101vd` | 76M | Largest RT-DETR v2 variant |\n\nStart with `ustc-community\u002Fdfine-small-coco` for fast iteration. Move to D-FINE Large or RT-DETR v2 R50 for better accuracy.\n\n### Recommended image classification models\n\nAll `timm\u002F` models work out of the box via `AutoModelForImageClassification` (loaded as `TimmWrapperForImageClassification`). See [references\u002Ftimm_trainer.md](references\u002Ftimm_trainer.md) for details.\n\n| Model | Params | Use case |\n|-------|--------|----------|\n| `timm\u002Fmobilenetv3_small_100.lamb_in1k` | 2.5M | Ultra-lightweight — mobile\u002Fedge, fastest training |\n| `timm\u002Fmobilevit_s.cvnets_in1k` | 5.6M | Mobile transformer — good accuracy\u002Fspeed trade-off |\n| `timm\u002Fresnet50.a1_in1k` | 25.6M | Strong CNN baseline — reliable, well-studied |\n| `timm\u002Fvit_base_patch16_dinov3.lvd1689m` | 86.6M | Best accuracy — DINOv3 self-supervised ViT |\n\nStart with `timm\u002Fmobilenetv3_small_100.lamb_in1k` for fast iteration. Move to `timm\u002Fresnet50.a1_in1k` or `timm\u002Fvit_base_patch16_dinov3.lvd1689m` for better accuracy.\n\n### Recommended SAM\u002FSAM2 segmentation models\n\n| Model | Params | Use case |\n|-------|--------|----------|\n| `facebook\u002Fsam2.1-hiera-tiny` | 38.9M | Fastest SAM2 — good for quick experiments |\n| `facebook\u002Fsam2.1-hiera-small` | 46.0M | Best starting point — good quality\u002Fspeed balance |\n| `facebook\u002Fsam2.1-hiera-base-plus` | 80.8M | Higher capacity for complex segmentation |\n| `facebook\u002Fsam2.1-hiera-large` | 224.4M | Best SAM2 accuracy — requires more VRAM |\n| `facebook\u002Fsam-vit-base` | 93.7M | Original SAM — ViT-B backbone |\n| `facebook\u002Fsam-vit-large` | 312.3M | Original SAM — ViT-L backbone |\n| `facebook\u002Fsam-vit-huge` | 641.1M | Original SAM — ViT-H, best SAM v1 accuracy |\n\nStart with `facebook\u002Fsam2.1-hiera-small` for fast iteration. SAM2 models are generally more efficient than SAM v1 at similar quality. Only the mask decoder is trained by default (vision and prompt encoders are frozen).\n\n### Hardware recommendation\n\nAll recommended OD and IC models are under 100M params — **`t4-small` (16 GB VRAM, $0.40\u002Fhr) is sufficient for all of them.** Image classification models are generally smaller and faster than object detection models — `t4-small` handles even ViT-Base comfortably. For SAM2 models up to `hiera-base-plus`, `t4-small` is sufficient since only the mask decoder is trained. For `sam2.1-hiera-large` or SAM v1 models, use `l4x1` or `a10g-large`. Only upgrade if you hit OOM from large batch sizes — reduce batch size first before switching hardware. Common upgrade path: `t4-small` → `l4x1` ($0.80\u002Fhr, 24 GB) → `a10g-large` ($1.50\u002Fhr, 24 GB).\n\nFor full hardware flavor list: refer to the `hugging-face-jobs` skill. For cost estimation: run `scripts\u002Festimate_cost.py`.\n\n## Quick start — Object Detection\n\nThe `script_args` below are the same for both submission methods. See directive #1 for the critical differences between them.\n\n```python\nOD_SCRIPT_ARGS = [\n    \"--model_name_or_path\", \"ustc-community\u002Fdfine-small-coco\",\n    \"--dataset_name\", \"cppe-5\",\n    \"--image_square_size\", \"640\",\n    \"--output_dir\", \"dfine_finetuned\",\n    \"--num_train_epochs\", \"30\",\n    \"--per_device_train_batch_size\", \"8\",\n    \"--learning_rate\", \"5e-5\",\n    \"--eval_strategy\", \"epoch\",\n    \"--save_strategy\", \"epoch\",\n    \"--save_total_limit\", \"2\",\n    \"--load_best_model_at_end\",\n    \"--metric_for_best_model\", \"eval_map\",\n    \"--greater_is_better\", \"True\",\n    \"--no_remove_unused_columns\",\n    \"--no_eval_do_concat_batches\",\n    \"--push_to_hub\",\n    \"--hub_model_id\", \"username\u002Fmodel-name\",\n    \"--do_train\",\n    \"--do_eval\",\n]\n```\n\n```python\nfrom huggingface_hub import HfApi, get_token\napi = HfApi()\njob_info = api.run_uv_job(\n    script=\"scripts\u002Fobject_detection_training.py\",\n    script_args=OD_SCRIPT_ARGS,\n    flavor=\"t4-small\",\n    timeout=14400,\n    env={\"PYTHONUNBUFFERED\": \"1\"},\n    secrets={\"HF_TOKEN\": get_token()},\n)\nprint(f\"Job ID: {job_info.id}\")\n```\n\n### Key OD `script_args`\n\n- `--model_name_or_path` — recommended: `\"ustc-community\u002Fdfine-small-coco\"` (see model table above)\n- `--dataset_name` — the Hub dataset ID\n- `--image_square_size` — 480 (fast iteration) or 800 (better accuracy)\n- `--hub_model_id` — `\"username\u002Fmodel-name\"` for Hub persistence\n- `--num_train_epochs` — 30 typical for convergence\n- `--train_val_split` — fraction to split for validation (default 0.15), set if dataset lacks a validation split\n- `--max_train_samples` — truncate training set (useful for quick test runs, e.g. `\"785\"` for ~10% of a 7.8K dataset)\n- `--max_eval_samples` — truncate evaluation set\n\n## Quick start — Image Classification\n\n```python\nIC_SCRIPT_ARGS = [\n    \"--model_name_or_path\", \"timm\u002Fmobilenetv3_small_100.lamb_in1k\",\n    \"--dataset_name\", \"ethz\u002Ffood101\",\n    \"--output_dir\", \"food101_classifier\",\n    \"--num_train_epochs\", \"5\",\n    \"--per_device_train_batch_size\", \"32\",\n    \"--per_device_eval_batch_size\", \"32\",\n    \"--learning_rate\", \"5e-5\",\n    \"--eval_strategy\", \"epoch\",\n    \"--save_strategy\", \"epoch\",\n    \"--save_total_limit\", \"2\",\n    \"--load_best_model_at_end\",\n    \"--metric_for_best_model\", \"eval_accuracy\",\n    \"--greater_is_better\", \"True\",\n    \"--no_remove_unused_columns\",\n    \"--push_to_hub\",\n    \"--hub_model_id\", \"username\u002Ffood101-classifier\",\n    \"--do_train\",\n    \"--do_eval\",\n]\n```\n\n```python\nfrom huggingface_hub import HfApi, get_token\napi = HfApi()\njob_info = api.run_uv_job(\n    script=\"scripts\u002Fimage_classification_training.py\",\n    script_args=IC_SCRIPT_ARGS,\n    flavor=\"t4-small\",\n    timeout=7200,\n    env={\"PYTHONUNBUFFERED\": \"1\"},\n    secrets={\"HF_TOKEN\": get_token()},\n)\nprint(f\"Job ID: {job_info.id}\")\n```\n\n### Key IC `script_args`\n\n- `--model_name_or_path` — any `timm\u002F` model or Transformers classification model (see model table above)\n- `--dataset_name` — the Hub dataset ID\n- `--image_column_name` — column containing PIL images (default: `\"image\"`)\n- `--label_column_name` — column containing class labels (default: `\"label\"`)\n- `--hub_model_id` — `\"username\u002Fmodel-name\"` for Hub persistence\n- `--num_train_epochs` — 3-5 typical for classification (fewer than OD)\n- `--per_device_train_batch_size` — 16-64 (classification models use less memory than OD)\n- `--train_val_split` — fraction to split for validation (default 0.15), set if dataset lacks a validation split\n- `--max_train_samples` \u002F `--max_eval_samples` — truncate for quick tests\n\n## Quick start — SAM\u002FSAM2 Segmentation\n\n```python\nSAM_SCRIPT_ARGS = [\n    \"--model_name_or_path\", \"facebook\u002Fsam2.1-hiera-small\",\n    \"--dataset_name\", \"merve\u002FMicroMat-mini\",\n    \"--prompt_type\", \"bbox\",\n    \"--prompt_column_name\", \"prompt\",\n    \"--output_dir\", \"sam2-finetuned\",\n    \"--num_train_epochs\", \"30\",\n    \"--per_device_train_batch_size\", \"4\",\n    \"--learning_rate\", \"1e-5\",\n    \"--logging_steps\", \"1\",\n    \"--save_strategy\", \"epoch\",\n    \"--save_total_limit\", \"2\",\n    \"--remove_unused_columns\", \"False\",\n    \"--dataloader_pin_memory\", \"False\",\n    \"--push_to_hub\",\n    \"--hub_model_id\", \"username\u002Fsam2-finetuned\",\n    \"--do_train\",\n    \"--report_to\", \"trackio\",\n]\n```\n\n```python\nfrom huggingface_hub import HfApi, get_token\napi = HfApi()\njob_info = api.run_uv_job(\n    script=\"scripts\u002Fsam_segmentation_training.py\",\n    script_args=SAM_SCRIPT_ARGS,\n    flavor=\"t4-small\",\n    timeout=7200,\n    env={\"PYTHONUNBUFFERED\": \"1\"},\n    secrets={\"HF_TOKEN\": get_token()},\n)\nprint(f\"Job ID: {job_info.id}\")\n```\n\n### Key SAM `script_args`\n\n- `--model_name_or_path` — SAM or SAM2 model (see model table above); auto-detects SAM vs SAM2\n- `--dataset_name` — the Hub dataset ID (e.g., `\"merve\u002FMicroMat-mini\"`)\n- `--prompt_type` — `\"bbox\"` or `\"point\"` — type of prompt in the dataset\n- `--prompt_column_name` — column with JSON-encoded prompts (default: `\"prompt\"`)\n- `--bbox_column_name` — dedicated bbox column (alternative to JSON prompt column)\n- `--point_column_name` — dedicated point column (alternative to JSON prompt column)\n- `--mask_column_name` — column with ground-truth masks (default: `\"mask\"`)\n- `--hub_model_id` — `\"username\u002Fmodel-name\"` for Hub persistence\n- `--num_train_epochs` — 20-30 typical for SAM fine-tuning\n- `--per_device_train_batch_size` — 2-4 (SAM models use significant memory)\n- `--freeze_vision_encoder` \u002F `--freeze_prompt_encoder` — freeze encoder weights (default: both frozen, only mask decoder trains)\n- `--train_val_split` — fraction to split for validation (default 0.1)\n\n## Checking job status\n\n**MCP tool (if available):**\n```\nhf_jobs(\"ps\")                                   # List all jobs\nhf_jobs(\"logs\", {\"job_id\": \"your-job-id\"})      # View logs\nhf_jobs(\"inspect\", {\"job_id\": \"your-job-id\"})   # Job details\n```\n\n**Python API fallback:**\n```python\nfrom huggingface_hub import HfApi\napi = HfApi()\napi.list_jobs()                                  # List all jobs\napi.get_job_logs(job_id=\"your-job-id\")           # View logs\napi.get_job(job_id=\"your-job-id\")                # Job details\n```\n\n## Common failure modes\n\n### OOM (CUDA out of memory)\nReduce `per_device_train_batch_size` (try 4, then 2), reduce `IMAGE_SIZE`, or upgrade hardware.\n\n### Dataset format errors\nRun `scripts\u002Fdataset_inspector.py` first. The training script auto-detects xyxy vs xywh, converts string categories to integer IDs, and adds `image_id` if missing. Ensure `objects.bbox` contains 4-value coordinate lists in absolute pixels and `objects.category` contains either integer IDs or string labels.\n\n### Hub push failures (401)\nVerify: (1) job secrets include token (see directive #2), (2) script sets `training_args.hub_token` BEFORE creating the `Trainer`, (3) `push_to_hub=True` is set, (4) correct `hub_model_id`, (5) token has write permissions.\n\n### Job timeout\nIncrease timeout (see directive #5 table), reduce epochs\u002Fdataset, or use checkpoint strategy with `hub_strategy=\"every_save\"`.\n\n### KeyError: 'test' (missing test split)\nThe object detection training script handles this gracefully — it falls back to the `validation` split. Ensure you're using the latest `scripts\u002Fobject_detection_training.py`.\n\n### Single-class dataset: \"iteration over a 0-d tensor\"\n`torchmetrics.MeanAveragePrecision` returns scalar (0-d) tensors for per-class metrics when there's only one class. The template `scripts\u002Fobject_detection_training.py` handles this by calling `.unsqueeze(0)` on these tensors. Ensure you're using the latest template.\n\n### Poor detection performance (mAP \u003C 0.15)\nIncrease epochs (30-50), ensure 500+ images, check per-class mAP for imbalanced classes, try different learning rates (1e-5 to 1e-4), increase image size.\n\nFor comprehensive troubleshooting: see [references\u002Freliability_principles.md](references\u002Freliability_principles.md)\n\n## Reference files\n\n- [scripts\u002Fobject_detection_training.py](scripts\u002Fobject_detection_training.py) — Production-ready object detection training script\n- [scripts\u002Fimage_classification_training.py](scripts\u002Fimage_classification_training.py) — Production-ready image classification training script (supports timm models)\n- [scripts\u002Fsam_segmentation_training.py](scripts\u002Fsam_segmentation_training.py) — Production-ready SAM\u002FSAM2 segmentation training script (bbox & point prompts)\n- [scripts\u002Fdataset_inspector.py](scripts\u002Fdataset_inspector.py) — Validate dataset format for OD, classification, and SAM segmentation\n- [scripts\u002Festimate_cost.py](scripts\u002Festimate_cost.py) — Estimate training costs for any vision model (includes SAM\u002FSAM2)\n- [references\u002Fobject_detection_training_notebook.md](references\u002Fobject_detection_training_notebook.md) — Object detection training workflow, augmentation strategies, and training patterns\n- [references\u002Fimage_classification_training_notebook.md](references\u002Fimage_classification_training_notebook.md) — Image classification training workflow with ViT, preprocessing, and evaluation\n- [references\u002Ffinetune_sam2_trainer.md](references\u002Ffinetune_sam2_trainer.md) — SAM2 fine-tuning walkthrough with MicroMat dataset, DiceCE loss, and Trainer integration\n- [references\u002Ftimm_trainer.md](references\u002Ftimm_trainer.md) — Using timm models with HF Trainer (TimmWrapper, transforms, full example)\n- [references\u002Fhub_saving.md](references\u002Fhub_saving.md) — Detailed Hub persistence guide and verification checklist\n- [references\u002Freliability_principles.md](references\u002Freliability_principles.md) — Failure prevention principles from production experience\n\n## External links\n\n- [Transformers Object Detection Guide](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Ftasks\u002Fobject_detection)\n- [Transformers Image Classification Guide](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Ftasks\u002Fimage_classification)\n- [DETR Model Documentation](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fdetr)\n- [ViT Model Documentation](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fvit)\n- [HF Jobs Guide](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Fhuggingface_hub\u002Fguides\u002Fjobs) — Main Jobs documentation\n- [HF Jobs Configuration](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Fhub\u002Fen\u002Fjobs-configuration) — Hardware, secrets, timeouts, namespaces\n- [HF Jobs CLI Reference](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Fhuggingface_hub\u002Fguides\u002Fcli#hf-jobs) — Command line interface\n- [Object Detection Models](https:\u002F\u002Fhuggingface.co\u002Fmodels?pipeline_tag=object-detection)\n- [Image Classification Models](https:\u002F\u002Fhuggingface.co\u002Fmodels?pipeline_tag=image-classification)\n- [SAM2 Model Documentation](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fsam2)\n- [SAM Model Documentation](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fsam)\n- [Object Detection Datasets](https:\u002F\u002Fhuggingface.co\u002Fdatasets?task_categories=task_categories:object-detection)\n- [Image Classification Datasets](https:\u002F\u002Fhuggingface.co\u002Fdatasets?task_categories=task_categories:image-classification)\n",{"data":39,"body":40},{"name":4,"description":6},{"type":41,"children":42},"root",[43,52,58,65,70,115,121,161,167,180,256,262,267,274,353,359,462,468,557,563,723,729,773,779,787,812,818,826,868,876,914,930,1005,1011,1042,1048,1091,1097,1102,1112,1120,1125,1133,1138,1146,1151,1437,1445,1500,1508,1605,1611,1616,1629,1653,1662,1679,1772,1780,1914,1922,1964,1970,1980,2051,2090,2103,2157,2163,2190,2213,2219,2243,2344,2349,2358,2363,2372,2377,2386,2392,2397,2471,2477,2542,2552,2558,2564,2723,2735,2741,2776,2888,2912,2918,3096,3107,3113,3196,3215,3221,3233,3408,3497,3508,3622,3628,3784,3871,3882,4009,4015,4168,4254,4265,4441,4447,4455,4464,4472,4517,4523,4529,4550,4556,4590,4596,4630,4636,4648,4654,4673,4679,4705,4711,4716,4726,4732,4837,4843,4982],{"type":44,"tag":45,"props":46,"children":48},"element","h1",{"id":47},"vision-model-training-on-hugging-face-jobs",[49],{"type":50,"value":51},"text","Vision Model Training on Hugging Face Jobs",{"type":44,"tag":53,"props":54,"children":55},"p",{},[56],{"type":50,"value":57},"Train object detection, image classification, and SAM\u002FSAM2 segmentation models on managed cloud GPUs. No local GPU setup required—results are automatically saved to the Hugging Face Hub.",{"type":44,"tag":59,"props":60,"children":62},"h2",{"id":61},"when-to-use-this-skill",[63],{"type":50,"value":64},"When to Use This Skill",{"type":44,"tag":53,"props":66,"children":67},{},[68],{"type":50,"value":69},"Use this skill when users want to:",{"type":44,"tag":71,"props":72,"children":73},"ul",{},[74,80,85,90,95,100,105,110],{"type":44,"tag":75,"props":76,"children":77},"li",{},[78],{"type":50,"value":79},"Fine-tune object detection models (D-FINE, RT-DETR v2, DETR, YOLOS) on cloud GPUs or local",{"type":44,"tag":75,"props":81,"children":82},{},[83],{"type":50,"value":84},"Fine-tune image classification models (timm: MobileNetV3, MobileViT, ResNet, ViT\u002FDINOv3, or any Transformers classifier) on cloud GPUs or local",{"type":44,"tag":75,"props":86,"children":87},{},[88],{"type":50,"value":89},"Fine-tune SAM or SAM2 models for segmentation \u002F image matting using bbox or point prompts",{"type":44,"tag":75,"props":91,"children":92},{},[93],{"type":50,"value":94},"Train bounding-box detectors on custom datasets",{"type":44,"tag":75,"props":96,"children":97},{},[98],{"type":50,"value":99},"Train image classifiers on custom datasets",{"type":44,"tag":75,"props":101,"children":102},{},[103],{"type":50,"value":104},"Train segmentation models on custom mask datasets with prompts",{"type":44,"tag":75,"props":106,"children":107},{},[108],{"type":50,"value":109},"Run vision training jobs on Hugging Face Jobs infrastructure",{"type":44,"tag":75,"props":111,"children":112},{},[113],{"type":50,"value":114},"Ensure trained vision models are permanently saved to the Hub",{"type":44,"tag":59,"props":116,"children":118},{"id":117},"related-skills",[119],{"type":50,"value":120},"Related Skills",{"type":44,"tag":71,"props":122,"children":123},{},[124,147],{"type":44,"tag":75,"props":125,"children":126},{},[127,138,140,145],{"type":44,"tag":128,"props":129,"children":130},"strong",{},[131],{"type":44,"tag":132,"props":133,"children":135},"code",{"className":134},[],[136],{"type":50,"value":137},"hugging-face-jobs",{"type":50,"value":139}," — General HF Jobs infrastructure: token authentication, hardware flavors, timeout management, cost estimation, secrets, environment variables, scheduled jobs, and result persistence. ",{"type":44,"tag":128,"props":141,"children":142},{},[143],{"type":50,"value":144},"Refer to the Jobs skill for any non-training-specific Jobs questions",{"type":50,"value":146}," (e.g., \"how do secrets work?\", \"what hardware is available?\", \"how do I pass tokens?\").",{"type":44,"tag":75,"props":148,"children":149},{},[150,159],{"type":44,"tag":128,"props":151,"children":152},{},[153],{"type":44,"tag":132,"props":154,"children":156},{"className":155},[],[157],{"type":50,"value":158},"hugging-face-model-trainer",{"type":50,"value":160}," — TRL-based language model training (SFT, DPO, GRPO). Use that skill for text\u002Flanguage model fine-tuning.",{"type":44,"tag":59,"props":162,"children":164},{"id":163},"local-script-execution",[165],{"type":50,"value":166},"Local Script Execution",{"type":44,"tag":53,"props":168,"children":169},{},[170,172,178],{"type":50,"value":171},"Helper scripts use PEP 723 inline dependencies. Run them with ",{"type":44,"tag":132,"props":173,"children":175},{"className":174},[],[176],{"type":50,"value":177},"uv run",{"type":50,"value":179},":",{"type":44,"tag":181,"props":182,"children":187},"pre",{"className":183,"code":184,"language":185,"meta":186,"style":186},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","uv run scripts\u002Fdataset_inspector.py --dataset username\u002Fdataset-name --split train\nuv run scripts\u002Festimate_cost.py --help\n","bash","",[188],{"type":44,"tag":132,"props":189,"children":190},{"__ignoreMap":186},[191,234],{"type":44,"tag":192,"props":193,"children":196},"span",{"class":194,"line":195},"line",1,[197,203,209,214,219,224,229],{"type":44,"tag":192,"props":198,"children":200},{"style":199},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[201],{"type":50,"value":202},"uv",{"type":44,"tag":192,"props":204,"children":206},{"style":205},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[207],{"type":50,"value":208}," run",{"type":44,"tag":192,"props":210,"children":211},{"style":205},[212],{"type":50,"value":213}," scripts\u002Fdataset_inspector.py",{"type":44,"tag":192,"props":215,"children":216},{"style":205},[217],{"type":50,"value":218}," --dataset",{"type":44,"tag":192,"props":220,"children":221},{"style":205},[222],{"type":50,"value":223}," username\u002Fdataset-name",{"type":44,"tag":192,"props":225,"children":226},{"style":205},[227],{"type":50,"value":228}," --split",{"type":44,"tag":192,"props":230,"children":231},{"style":205},[232],{"type":50,"value":233}," train\n",{"type":44,"tag":192,"props":235,"children":237},{"class":194,"line":236},2,[238,242,246,251],{"type":44,"tag":192,"props":239,"children":240},{"style":199},[241],{"type":50,"value":202},{"type":44,"tag":192,"props":243,"children":244},{"style":205},[245],{"type":50,"value":208},{"type":44,"tag":192,"props":247,"children":248},{"style":205},[249],{"type":50,"value":250}," scripts\u002Festimate_cost.py",{"type":44,"tag":192,"props":252,"children":253},{"style":205},[254],{"type":50,"value":255}," --help\n",{"type":44,"tag":59,"props":257,"children":259},{"id":258},"prerequisites-checklist",[260],{"type":50,"value":261},"Prerequisites Checklist",{"type":44,"tag":53,"props":263,"children":264},{},[265],{"type":50,"value":266},"Before starting any training job, verify:",{"type":44,"tag":268,"props":269,"children":271},"h3",{"id":270},"account-authentication",[272],{"type":50,"value":273},"Account & Authentication",{"type":44,"tag":71,"props":275,"children":276},{},[277,310,331,343],{"type":44,"tag":75,"props":278,"children":279},{},[280,282,291,293,300,302,308],{"type":50,"value":281},"Hugging Face Account with ",{"type":44,"tag":283,"props":284,"children":288},"a",{"href":285,"rel":286},"https:\u002F\u002Fhf.co\u002Fpro",[287],"nofollow",[289],{"type":50,"value":290},"Pro",{"type":50,"value":292},", ",{"type":44,"tag":283,"props":294,"children":297},{"href":295,"rel":296},"https:\u002F\u002Fhf.co\u002Fenterprise",[287],[298],{"type":50,"value":299},"Team",{"type":50,"value":301},", or ",{"type":44,"tag":283,"props":303,"children":305},{"href":295,"rel":304},[287],[306],{"type":50,"value":307},"Enterprise",{"type":50,"value":309}," plan (Jobs require paid plan)",{"type":44,"tag":75,"props":311,"children":312},{},[313,315,321,323,329],{"type":50,"value":314},"Authenticated login: Check with ",{"type":44,"tag":132,"props":316,"children":318},{"className":317},[],[319],{"type":50,"value":320},"hf_whoami()",{"type":50,"value":322}," (tool) or ",{"type":44,"tag":132,"props":324,"children":326},{"className":325},[],[327],{"type":50,"value":328},"hf auth whoami",{"type":50,"value":330}," (terminal)",{"type":44,"tag":75,"props":332,"children":333},{},[334,336,341],{"type":50,"value":335},"Token has ",{"type":44,"tag":128,"props":337,"children":338},{},[339],{"type":50,"value":340},"write",{"type":50,"value":342}," permissions",{"type":44,"tag":75,"props":344,"children":345},{},[346,351],{"type":44,"tag":128,"props":347,"children":348},{},[349],{"type":50,"value":350},"MUST pass token in job secrets",{"type":50,"value":352}," — see directive #3 below for syntax (MCP tool vs Python API)",{"type":44,"tag":268,"props":354,"children":356},{"id":355},"dataset-requirements-object-detection",[357],{"type":50,"value":358},"Dataset Requirements — Object Detection",{"type":44,"tag":71,"props":360,"children":361},{},[362,367,403,422,434,452],{"type":44,"tag":75,"props":363,"children":364},{},[365],{"type":50,"value":366},"Dataset must exist on Hub",{"type":44,"tag":75,"props":368,"children":369},{},[370,372,378,380,386,387,393,395,401],{"type":50,"value":371},"Annotations must use the ",{"type":44,"tag":132,"props":373,"children":375},{"className":374},[],[376],{"type":50,"value":377},"objects",{"type":50,"value":379}," column with ",{"type":44,"tag":132,"props":381,"children":383},{"className":382},[],[384],{"type":50,"value":385},"bbox",{"type":50,"value":292},{"type":44,"tag":132,"props":388,"children":390},{"className":389},[],[391],{"type":50,"value":392},"category",{"type":50,"value":394}," (and optionally ",{"type":44,"tag":132,"props":396,"children":398},{"className":397},[],[399],{"type":50,"value":400},"area",{"type":50,"value":402},") sub-fields",{"type":44,"tag":75,"props":404,"children":405},{},[406,408,413,415,420],{"type":50,"value":407},"Bboxes can be in ",{"type":44,"tag":128,"props":409,"children":410},{},[411],{"type":50,"value":412},"xywh (COCO)",{"type":50,"value":414}," or ",{"type":44,"tag":128,"props":416,"children":417},{},[418],{"type":50,"value":419},"xyxy (Pascal VOC)",{"type":50,"value":421}," format — auto-detected and converted",{"type":44,"tag":75,"props":423,"children":424},{},[425,427,432],{"type":50,"value":426},"Categories can be ",{"type":44,"tag":128,"props":428,"children":429},{},[430],{"type":50,"value":431},"integers or strings",{"type":50,"value":433}," — strings are auto-remapped to integer IDs",{"type":44,"tag":75,"props":435,"children":436},{},[437,443,445,450],{"type":44,"tag":132,"props":438,"children":440},{"className":439},[],[441],{"type":50,"value":442},"image_id",{"type":50,"value":444}," column is ",{"type":44,"tag":128,"props":446,"children":447},{},[448],{"type":50,"value":449},"optional",{"type":50,"value":451}," — generated automatically if missing",{"type":44,"tag":75,"props":453,"children":454},{},[455,460],{"type":44,"tag":128,"props":456,"children":457},{},[458],{"type":50,"value":459},"ALWAYS validate unknown datasets",{"type":50,"value":461}," before GPU training (see Dataset Validation section)",{"type":44,"tag":268,"props":463,"children":465},{"id":464},"dataset-requirements-image-classification",[466],{"type":50,"value":467},"Dataset Requirements — Image Classification",{"type":44,"tag":71,"props":469,"children":470},{},[471,475,505,518,549],{"type":44,"tag":75,"props":472,"children":473},{},[474],{"type":50,"value":366},{"type":44,"tag":75,"props":476,"children":477},{},[478,480,491,493,503],{"type":50,"value":479},"Must have an ",{"type":44,"tag":128,"props":481,"children":482},{},[483,489],{"type":44,"tag":132,"props":484,"children":486},{"className":485},[],[487],{"type":50,"value":488},"image",{"type":50,"value":490}," column",{"type":50,"value":492}," (PIL images) and a ",{"type":44,"tag":128,"props":494,"children":495},{},[496,502],{"type":44,"tag":132,"props":497,"children":499},{"className":498},[],[500],{"type":50,"value":501},"label",{"type":50,"value":490},{"type":50,"value":504}," (integer class IDs or strings)",{"type":44,"tag":75,"props":506,"children":507},{},[508,510,516],{"type":50,"value":509},"The label column can be ",{"type":44,"tag":132,"props":511,"children":513},{"className":512},[],[514],{"type":50,"value":515},"ClassLabel",{"type":50,"value":517}," type (with names) or plain integers\u002Fstrings — strings are auto-remapped",{"type":44,"tag":75,"props":519,"children":520},{},[521,523,528,529,535,536,542,543],{"type":50,"value":522},"Common column names auto-detected: ",{"type":44,"tag":132,"props":524,"children":526},{"className":525},[],[527],{"type":50,"value":501},{"type":50,"value":292},{"type":44,"tag":132,"props":530,"children":532},{"className":531},[],[533],{"type":50,"value":534},"labels",{"type":50,"value":292},{"type":44,"tag":132,"props":537,"children":539},{"className":538},[],[540],{"type":50,"value":541},"class",{"type":50,"value":292},{"type":44,"tag":132,"props":544,"children":546},{"className":545},[],[547],{"type":50,"value":548},"fine_label",{"type":44,"tag":75,"props":550,"children":551},{},[552,556],{"type":44,"tag":128,"props":553,"children":554},{},[555],{"type":50,"value":459},{"type":50,"value":461},{"type":44,"tag":268,"props":558,"children":560},{"id":559},"dataset-requirements-samsam2-segmentation",[561],{"type":50,"value":562},"Dataset Requirements — SAM\u002FSAM2 Segmentation",{"type":44,"tag":71,"props":564,"children":565},{},[566,570,596,690,702,715],{"type":44,"tag":75,"props":567,"children":568},{},[569],{"type":50,"value":366},{"type":44,"tag":75,"props":571,"children":572},{},[573,574,583,584,594],{"type":50,"value":479},{"type":44,"tag":128,"props":575,"children":576},{},[577,582],{"type":44,"tag":132,"props":578,"children":580},{"className":579},[],[581],{"type":50,"value":488},{"type":50,"value":490},{"type":50,"value":492},{"type":44,"tag":128,"props":585,"children":586},{},[587,593],{"type":44,"tag":132,"props":588,"children":590},{"className":589},[],[591],{"type":50,"value":592},"mask",{"type":50,"value":490},{"type":50,"value":595}," (binary ground-truth segmentation mask)",{"type":44,"tag":75,"props":597,"children":598},{},[599,601,606,608],{"type":50,"value":600},"Must have a ",{"type":44,"tag":128,"props":602,"children":603},{},[604],{"type":50,"value":605},"prompt",{"type":50,"value":607}," — either:\n",{"type":44,"tag":71,"props":609,"children":610},{},[611,640,662],{"type":44,"tag":75,"props":612,"children":613},{},[614,616,625,627,633,634],{"type":50,"value":615},"A ",{"type":44,"tag":128,"props":617,"children":618},{},[619,624],{"type":44,"tag":132,"props":620,"children":622},{"className":621},[],[623],{"type":50,"value":605},{"type":50,"value":490},{"type":50,"value":626}," with JSON containing ",{"type":44,"tag":132,"props":628,"children":630},{"className":629},[],[631],{"type":50,"value":632},"{\"bbox\": [x0,y0,x1,y1]}",{"type":50,"value":414},{"type":44,"tag":132,"props":635,"children":637},{"className":636},[],[638],{"type":50,"value":639},"{\"point\": [x,y]}",{"type":44,"tag":75,"props":641,"children":642},{},[643,645,653,654,660],{"type":50,"value":644},"OR a dedicated ",{"type":44,"tag":128,"props":646,"children":647},{},[648],{"type":44,"tag":132,"props":649,"children":651},{"className":650},[],[652],{"type":50,"value":385},{"type":50,"value":379},{"type":44,"tag":132,"props":655,"children":657},{"className":656},[],[658],{"type":50,"value":659},"[x0,y0,x1,y1]",{"type":50,"value":661}," values",{"type":44,"tag":75,"props":663,"children":664},{},[665,666,675,676,682,683,689],{"type":50,"value":644},{"type":44,"tag":128,"props":667,"children":668},{},[669],{"type":44,"tag":132,"props":670,"children":672},{"className":671},[],[673],{"type":50,"value":674},"point",{"type":50,"value":379},{"type":44,"tag":132,"props":677,"children":679},{"className":678},[],[680],{"type":50,"value":681},"[x,y]",{"type":50,"value":414},{"type":44,"tag":132,"props":684,"children":686},{"className":685},[],[687],{"type":50,"value":688},"[[x,y],...]",{"type":50,"value":661},{"type":44,"tag":75,"props":691,"children":692},{},[693,695,700],{"type":50,"value":694},"Bboxes should be in ",{"type":44,"tag":128,"props":696,"children":697},{},[698],{"type":50,"value":699},"xyxy",{"type":50,"value":701}," format (absolute pixel coordinates)",{"type":44,"tag":75,"props":703,"children":704},{},[705,707,713],{"type":50,"value":706},"Example dataset: ",{"type":44,"tag":132,"props":708,"children":710},{"className":709},[],[711],{"type":50,"value":712},"merve\u002FMicroMat-mini",{"type":50,"value":714}," (image matting with bbox prompts)",{"type":44,"tag":75,"props":716,"children":717},{},[718,722],{"type":44,"tag":128,"props":719,"children":720},{},[721],{"type":50,"value":459},{"type":50,"value":461},{"type":44,"tag":268,"props":724,"children":726},{"id":725},"critical-settings",[727],{"type":50,"value":728},"Critical Settings",{"type":44,"tag":71,"props":730,"children":731},{},[732,742],{"type":44,"tag":75,"props":733,"children":734},{},[735,740],{"type":44,"tag":128,"props":736,"children":737},{},[738],{"type":50,"value":739},"Timeout must exceed expected training time",{"type":50,"value":741}," — Default 30min is TOO SHORT. See directive #6 for recommended values.",{"type":44,"tag":75,"props":743,"children":744},{},[745,750,752,758,759,765,767],{"type":44,"tag":128,"props":746,"children":747},{},[748],{"type":50,"value":749},"Hub push must be enabled",{"type":50,"value":751}," — ",{"type":44,"tag":132,"props":753,"children":755},{"className":754},[],[756],{"type":50,"value":757},"push_to_hub=True",{"type":50,"value":292},{"type":44,"tag":132,"props":760,"children":762},{"className":761},[],[763],{"type":50,"value":764},"hub_model_id=\"username\u002Fmodel-name\"",{"type":50,"value":766},", token in ",{"type":44,"tag":132,"props":768,"children":770},{"className":769},[],[771],{"type":50,"value":772},"secrets",{"type":44,"tag":59,"props":774,"children":776},{"id":775},"dataset-validation",[777],{"type":50,"value":778},"Dataset Validation",{"type":44,"tag":53,"props":780,"children":781},{},[782],{"type":44,"tag":128,"props":783,"children":784},{},[785],{"type":50,"value":786},"Validate dataset format BEFORE launching GPU training to prevent the #1 cause of training failures: format mismatches.",{"type":44,"tag":53,"props":788,"children":789},{},[790,795,797,802,804,810],{"type":44,"tag":128,"props":791,"children":792},{},[793],{"type":50,"value":794},"ALWAYS validate for",{"type":50,"value":796}," unknown\u002Fcustom datasets or any dataset you haven't trained with before. ",{"type":44,"tag":128,"props":798,"children":799},{},[800],{"type":50,"value":801},"Skip for",{"type":50,"value":803}," ",{"type":44,"tag":132,"props":805,"children":807},{"className":806},[],[808],{"type":50,"value":809},"cppe-5",{"type":50,"value":811}," (the default in the training script).",{"type":44,"tag":268,"props":813,"children":815},{"id":814},"running-the-inspector",[816],{"type":50,"value":817},"Running the Inspector",{"type":44,"tag":53,"props":819,"children":820},{},[821],{"type":44,"tag":128,"props":822,"children":823},{},[824],{"type":50,"value":825},"Option 1: Via HF Jobs (recommended — avoids local SSL\u002Fdependency issues):",{"type":44,"tag":181,"props":827,"children":830},{"className":828,"code":829,"language":20,"meta":186,"style":186},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","hf_jobs(\"uv\", {\n    \"script\": \"path\u002Fto\u002Fdataset_inspector.py\",\n    \"script_args\": [\"--dataset\", \"username\u002Fdataset-name\", \"--split\", \"train\"]\n})\n",[831],{"type":44,"tag":132,"props":832,"children":833},{"__ignoreMap":186},[834,842,850,859],{"type":44,"tag":192,"props":835,"children":836},{"class":194,"line":195},[837],{"type":44,"tag":192,"props":838,"children":839},{},[840],{"type":50,"value":841},"hf_jobs(\"uv\", {\n",{"type":44,"tag":192,"props":843,"children":844},{"class":194,"line":236},[845],{"type":44,"tag":192,"props":846,"children":847},{},[848],{"type":50,"value":849},"    \"script\": \"path\u002Fto\u002Fdataset_inspector.py\",\n",{"type":44,"tag":192,"props":851,"children":853},{"class":194,"line":852},3,[854],{"type":44,"tag":192,"props":855,"children":856},{},[857],{"type":50,"value":858},"    \"script_args\": [\"--dataset\", \"username\u002Fdataset-name\", \"--split\", \"train\"]\n",{"type":44,"tag":192,"props":860,"children":862},{"class":194,"line":861},4,[863],{"type":44,"tag":192,"props":864,"children":865},{},[866],{"type":50,"value":867},"})\n",{"type":44,"tag":53,"props":869,"children":870},{},[871],{"type":44,"tag":128,"props":872,"children":873},{},[874],{"type":50,"value":875},"Option 2: Locally:",{"type":44,"tag":181,"props":877,"children":879},{"className":183,"code":878,"language":185,"meta":186,"style":186},"uv run scripts\u002Fdataset_inspector.py --dataset username\u002Fdataset-name --split train\n",[880],{"type":44,"tag":132,"props":881,"children":882},{"__ignoreMap":186},[883],{"type":44,"tag":192,"props":884,"children":885},{"class":194,"line":195},[886,890,894,898,902,906,910],{"type":44,"tag":192,"props":887,"children":888},{"style":199},[889],{"type":50,"value":202},{"type":44,"tag":192,"props":891,"children":892},{"style":205},[893],{"type":50,"value":208},{"type":44,"tag":192,"props":895,"children":896},{"style":205},[897],{"type":50,"value":213},{"type":44,"tag":192,"props":899,"children":900},{"style":205},[901],{"type":50,"value":218},{"type":44,"tag":192,"props":903,"children":904},{"style":205},[905],{"type":50,"value":223},{"type":44,"tag":192,"props":907,"children":908},{"style":205},[909],{"type":50,"value":228},{"type":44,"tag":192,"props":911,"children":912},{"style":205},[913],{"type":50,"value":233},{"type":44,"tag":53,"props":915,"children":916},{},[917],{"type":44,"tag":128,"props":918,"children":919},{},[920,922,928],{"type":50,"value":921},"Option 3: Via ",{"type":44,"tag":132,"props":923,"children":925},{"className":924},[],[926],{"type":50,"value":927},"HfApi().run_uv_job()",{"type":50,"value":929}," (if hf_jobs MCP unavailable):",{"type":44,"tag":181,"props":931,"children":933},{"className":828,"code":932,"language":20,"meta":186,"style":186},"from huggingface_hub import HfApi\napi = HfApi()\napi.run_uv_job(\n    script=\"scripts\u002Fdataset_inspector.py\",\n    script_args=[\"--dataset\", \"username\u002Fdataset-name\", \"--split\", \"train\"],\n    flavor=\"cpu-basic\",\n    timeout=300,\n)\n",[934],{"type":44,"tag":132,"props":935,"children":936},{"__ignoreMap":186},[937,945,953,961,969,978,987,996],{"type":44,"tag":192,"props":938,"children":939},{"class":194,"line":195},[940],{"type":44,"tag":192,"props":941,"children":942},{},[943],{"type":50,"value":944},"from huggingface_hub import HfApi\n",{"type":44,"tag":192,"props":946,"children":947},{"class":194,"line":236},[948],{"type":44,"tag":192,"props":949,"children":950},{},[951],{"type":50,"value":952},"api = HfApi()\n",{"type":44,"tag":192,"props":954,"children":955},{"class":194,"line":852},[956],{"type":44,"tag":192,"props":957,"children":958},{},[959],{"type":50,"value":960},"api.run_uv_job(\n",{"type":44,"tag":192,"props":962,"children":963},{"class":194,"line":861},[964],{"type":44,"tag":192,"props":965,"children":966},{},[967],{"type":50,"value":968},"    script=\"scripts\u002Fdataset_inspector.py\",\n",{"type":44,"tag":192,"props":970,"children":972},{"class":194,"line":971},5,[973],{"type":44,"tag":192,"props":974,"children":975},{},[976],{"type":50,"value":977},"    script_args=[\"--dataset\", \"username\u002Fdataset-name\", \"--split\", \"train\"],\n",{"type":44,"tag":192,"props":979,"children":981},{"class":194,"line":980},6,[982],{"type":44,"tag":192,"props":983,"children":984},{},[985],{"type":50,"value":986},"    flavor=\"cpu-basic\",\n",{"type":44,"tag":192,"props":988,"children":990},{"class":194,"line":989},7,[991],{"type":44,"tag":192,"props":992,"children":993},{},[994],{"type":50,"value":995},"    timeout=300,\n",{"type":44,"tag":192,"props":997,"children":999},{"class":194,"line":998},8,[1000],{"type":44,"tag":192,"props":1001,"children":1002},{},[1003],{"type":50,"value":1004},")\n",{"type":44,"tag":268,"props":1006,"children":1008},{"id":1007},"reading-results",[1009],{"type":50,"value":1010},"Reading Results",{"type":44,"tag":71,"props":1012,"children":1013},{},[1014,1028],{"type":44,"tag":75,"props":1015,"children":1016},{},[1017,1026],{"type":44,"tag":128,"props":1018,"children":1019},{},[1020],{"type":44,"tag":132,"props":1021,"children":1023},{"className":1022},[],[1024],{"type":50,"value":1025},"✓ READY",{"type":50,"value":1027}," — Dataset is compatible, use directly",{"type":44,"tag":75,"props":1029,"children":1030},{},[1031,1040],{"type":44,"tag":128,"props":1032,"children":1033},{},[1034],{"type":44,"tag":132,"props":1035,"children":1037},{"className":1036},[],[1038],{"type":50,"value":1039},"✗ NEEDS FORMATTING",{"type":50,"value":1041}," — Needs preprocessing (mapping code provided in output)",{"type":44,"tag":59,"props":1043,"children":1045},{"id":1044},"automatic-bbox-preprocessing",[1046],{"type":50,"value":1047},"Automatic Bbox Preprocessing",{"type":44,"tag":53,"props":1049,"children":1050},{},[1051,1053,1059,1061,1066,1068,1073,1075,1081,1083,1089],{"type":50,"value":1052},"The object detection training script (",{"type":44,"tag":132,"props":1054,"children":1056},{"className":1055},[],[1057],{"type":50,"value":1058},"scripts\u002Fobject_detection_training.py",{"type":50,"value":1060},") automatically handles bbox format detection (xyxy→xywh conversion), bbox sanitization, ",{"type":44,"tag":132,"props":1062,"children":1064},{"className":1063},[],[1065],{"type":50,"value":442},{"type":50,"value":1067}," generation, string category→integer remapping, and dataset truncation. ",{"type":44,"tag":128,"props":1069,"children":1070},{},[1071],{"type":50,"value":1072},"No manual preprocessing needed",{"type":50,"value":1074}," — just ensure the dataset has ",{"type":44,"tag":132,"props":1076,"children":1078},{"className":1077},[],[1079],{"type":50,"value":1080},"objects.bbox",{"type":50,"value":1082}," and ",{"type":44,"tag":132,"props":1084,"children":1086},{"className":1085},[],[1087],{"type":50,"value":1088},"objects.category",{"type":50,"value":1090}," columns.",{"type":44,"tag":59,"props":1092,"children":1094},{"id":1093},"training-workflow",[1095],{"type":50,"value":1096},"Training workflow",{"type":44,"tag":53,"props":1098,"children":1099},{},[1100],{"type":50,"value":1101},"Copy this checklist and track progress:",{"type":44,"tag":181,"props":1103,"children":1107},{"className":1104,"code":1106,"language":50},[1105],"language-text","Training Progress:\n- [ ] Step 1: Verify prerequisites (account, token, dataset)\n- [ ] Step 2: Validate dataset format (run dataset_inspector.py)\n- [ ] Step 3: Ask user about dataset size and validation split\n- [ ] Step 4: Prepare training script (OD: scripts\u002Fobject_detection_training.py, IC: scripts\u002Fimage_classification_training.py, SAM: scripts\u002Fsam_segmentation_training.py)\n- [ ] Step 5: Save script locally, submit job, and report details\n",[1108],{"type":44,"tag":132,"props":1109,"children":1110},{"__ignoreMap":186},[1111],{"type":50,"value":1106},{"type":44,"tag":53,"props":1113,"children":1114},{},[1115],{"type":44,"tag":128,"props":1116,"children":1117},{},[1118],{"type":50,"value":1119},"Step 1: Verify prerequisites",{"type":44,"tag":53,"props":1121,"children":1122},{},[1123],{"type":50,"value":1124},"Follow the Prerequisites Checklist above.",{"type":44,"tag":53,"props":1126,"children":1127},{},[1128],{"type":44,"tag":128,"props":1129,"children":1130},{},[1131],{"type":50,"value":1132},"Step 2: Validate dataset",{"type":44,"tag":53,"props":1134,"children":1135},{},[1136],{"type":50,"value":1137},"Run the dataset inspector BEFORE spending GPU time. See \"Dataset Validation\" section above.",{"type":44,"tag":53,"props":1139,"children":1140},{},[1141],{"type":44,"tag":128,"props":1142,"children":1143},{},[1144],{"type":50,"value":1145},"Step 3: Ask user preferences",{"type":44,"tag":53,"props":1147,"children":1148},{},[1149],{"type":50,"value":1150},"ALWAYS use the AskUserQuestion tool with option-style format:",{"type":44,"tag":181,"props":1152,"children":1154},{"className":828,"code":1153,"language":20,"meta":186,"style":186},"AskUserQuestion({\n    \"questions\": [\n        {\n            \"question\": \"Do you want to run a quick test with a subset of the data first?\",\n            \"header\": \"Dataset Size\",\n            \"options\": [\n                {\"label\": \"Quick test run (10% of data)\", \"description\": \"Faster, cheaper (~30-60 min, ~$2-5) to validate setup\"},\n                {\"label\": \"Full dataset (Recommended)\", \"description\": \"Complete training for best model quality\"}\n            ],\n            \"multiSelect\": false\n        },\n        {\n            \"question\": \"Do you want to create a validation split from the training data?\",\n            \"header\": \"Split data\",\n            \"options\": [\n                {\"label\": \"Yes (Recommended)\", \"description\": \"Automatically split 15% of training data for validation\"},\n                {\"label\": \"No\", \"description\": \"Use existing validation split from dataset\"}\n            ],\n            \"multiSelect\": false\n        },\n        {\n            \"question\": \"Which GPU hardware do you want to use?\",\n            \"header\": \"Hardware Flavor\",\n            \"options\": [\n                {\"label\": \"t4-small ($0.40\u002Fhr)\", \"description\": \"1x T4, 16 GB VRAM — sufficient for all OD models under 100M params\"},\n                {\"label\": \"l4x1 ($0.80\u002Fhr)\", \"description\": \"1x L4, 24 GB VRAM — more headroom for large images or batch sizes\"},\n                {\"label\": \"a10g-large ($1.50\u002Fhr)\", \"description\": \"1x A10G, 24 GB VRAM — faster training, more CPU\u002FRAM\"},\n                {\"label\": \"a100-large ($2.50\u002Fhr)\", \"description\": \"1x A100, 80 GB VRAM — fastest, for very large datasets or image sizes\"}\n            ],\n            \"multiSelect\": false\n        }\n    ]\n})\n",[1155],{"type":44,"tag":132,"props":1156,"children":1157},{"__ignoreMap":186},[1158,1166,1174,1182,1190,1198,1206,1214,1222,1231,1240,1249,1257,1266,1275,1283,1292,1301,1309,1317,1325,1333,1342,1351,1359,1368,1377,1386,1395,1403,1411,1420,1429],{"type":44,"tag":192,"props":1159,"children":1160},{"class":194,"line":195},[1161],{"type":44,"tag":192,"props":1162,"children":1163},{},[1164],{"type":50,"value":1165},"AskUserQuestion({\n",{"type":44,"tag":192,"props":1167,"children":1168},{"class":194,"line":236},[1169],{"type":44,"tag":192,"props":1170,"children":1171},{},[1172],{"type":50,"value":1173},"    \"questions\": [\n",{"type":44,"tag":192,"props":1175,"children":1176},{"class":194,"line":852},[1177],{"type":44,"tag":192,"props":1178,"children":1179},{},[1180],{"type":50,"value":1181},"        {\n",{"type":44,"tag":192,"props":1183,"children":1184},{"class":194,"line":861},[1185],{"type":44,"tag":192,"props":1186,"children":1187},{},[1188],{"type":50,"value":1189},"            \"question\": \"Do you want to run a quick test with a subset of the data first?\",\n",{"type":44,"tag":192,"props":1191,"children":1192},{"class":194,"line":971},[1193],{"type":44,"tag":192,"props":1194,"children":1195},{},[1196],{"type":50,"value":1197},"            \"header\": \"Dataset Size\",\n",{"type":44,"tag":192,"props":1199,"children":1200},{"class":194,"line":980},[1201],{"type":44,"tag":192,"props":1202,"children":1203},{},[1204],{"type":50,"value":1205},"            \"options\": [\n",{"type":44,"tag":192,"props":1207,"children":1208},{"class":194,"line":989},[1209],{"type":44,"tag":192,"props":1210,"children":1211},{},[1212],{"type":50,"value":1213},"                {\"label\": \"Quick test run (10% of data)\", \"description\": \"Faster, cheaper (~30-60 min, ~$2-5) to validate setup\"},\n",{"type":44,"tag":192,"props":1215,"children":1216},{"class":194,"line":998},[1217],{"type":44,"tag":192,"props":1218,"children":1219},{},[1220],{"type":50,"value":1221},"                {\"label\": \"Full dataset (Recommended)\", \"description\": \"Complete training for best model quality\"}\n",{"type":44,"tag":192,"props":1223,"children":1225},{"class":194,"line":1224},9,[1226],{"type":44,"tag":192,"props":1227,"children":1228},{},[1229],{"type":50,"value":1230},"            ],\n",{"type":44,"tag":192,"props":1232,"children":1234},{"class":194,"line":1233},10,[1235],{"type":44,"tag":192,"props":1236,"children":1237},{},[1238],{"type":50,"value":1239},"            \"multiSelect\": false\n",{"type":44,"tag":192,"props":1241,"children":1243},{"class":194,"line":1242},11,[1244],{"type":44,"tag":192,"props":1245,"children":1246},{},[1247],{"type":50,"value":1248},"        },\n",{"type":44,"tag":192,"props":1250,"children":1252},{"class":194,"line":1251},12,[1253],{"type":44,"tag":192,"props":1254,"children":1255},{},[1256],{"type":50,"value":1181},{"type":44,"tag":192,"props":1258,"children":1260},{"class":194,"line":1259},13,[1261],{"type":44,"tag":192,"props":1262,"children":1263},{},[1264],{"type":50,"value":1265},"            \"question\": \"Do you want to create a validation split from the training data?\",\n",{"type":44,"tag":192,"props":1267,"children":1269},{"class":194,"line":1268},14,[1270],{"type":44,"tag":192,"props":1271,"children":1272},{},[1273],{"type":50,"value":1274},"            \"header\": \"Split data\",\n",{"type":44,"tag":192,"props":1276,"children":1278},{"class":194,"line":1277},15,[1279],{"type":44,"tag":192,"props":1280,"children":1281},{},[1282],{"type":50,"value":1205},{"type":44,"tag":192,"props":1284,"children":1286},{"class":194,"line":1285},16,[1287],{"type":44,"tag":192,"props":1288,"children":1289},{},[1290],{"type":50,"value":1291},"                {\"label\": \"Yes (Recommended)\", \"description\": \"Automatically split 15% of training data for validation\"},\n",{"type":44,"tag":192,"props":1293,"children":1295},{"class":194,"line":1294},17,[1296],{"type":44,"tag":192,"props":1297,"children":1298},{},[1299],{"type":50,"value":1300},"                {\"label\": \"No\", \"description\": \"Use existing validation split from dataset\"}\n",{"type":44,"tag":192,"props":1302,"children":1304},{"class":194,"line":1303},18,[1305],{"type":44,"tag":192,"props":1306,"children":1307},{},[1308],{"type":50,"value":1230},{"type":44,"tag":192,"props":1310,"children":1312},{"class":194,"line":1311},19,[1313],{"type":44,"tag":192,"props":1314,"children":1315},{},[1316],{"type":50,"value":1239},{"type":44,"tag":192,"props":1318,"children":1320},{"class":194,"line":1319},20,[1321],{"type":44,"tag":192,"props":1322,"children":1323},{},[1324],{"type":50,"value":1248},{"type":44,"tag":192,"props":1326,"children":1328},{"class":194,"line":1327},21,[1329],{"type":44,"tag":192,"props":1330,"children":1331},{},[1332],{"type":50,"value":1181},{"type":44,"tag":192,"props":1334,"children":1336},{"class":194,"line":1335},22,[1337],{"type":44,"tag":192,"props":1338,"children":1339},{},[1340],{"type":50,"value":1341},"            \"question\": \"Which GPU hardware do you want to use?\",\n",{"type":44,"tag":192,"props":1343,"children":1345},{"class":194,"line":1344},23,[1346],{"type":44,"tag":192,"props":1347,"children":1348},{},[1349],{"type":50,"value":1350},"            \"header\": \"Hardware Flavor\",\n",{"type":44,"tag":192,"props":1352,"children":1354},{"class":194,"line":1353},24,[1355],{"type":44,"tag":192,"props":1356,"children":1357},{},[1358],{"type":50,"value":1205},{"type":44,"tag":192,"props":1360,"children":1362},{"class":194,"line":1361},25,[1363],{"type":44,"tag":192,"props":1364,"children":1365},{},[1366],{"type":50,"value":1367},"                {\"label\": \"t4-small ($0.40\u002Fhr)\", \"description\": \"1x T4, 16 GB VRAM — sufficient for all OD models under 100M params\"},\n",{"type":44,"tag":192,"props":1369,"children":1371},{"class":194,"line":1370},26,[1372],{"type":44,"tag":192,"props":1373,"children":1374},{},[1375],{"type":50,"value":1376},"                {\"label\": \"l4x1 ($0.80\u002Fhr)\", \"description\": \"1x L4, 24 GB VRAM — more headroom for large images or batch sizes\"},\n",{"type":44,"tag":192,"props":1378,"children":1380},{"class":194,"line":1379},27,[1381],{"type":44,"tag":192,"props":1382,"children":1383},{},[1384],{"type":50,"value":1385},"                {\"label\": \"a10g-large ($1.50\u002Fhr)\", \"description\": \"1x A10G, 24 GB VRAM — faster training, more CPU\u002FRAM\"},\n",{"type":44,"tag":192,"props":1387,"children":1389},{"class":194,"line":1388},28,[1390],{"type":44,"tag":192,"props":1391,"children":1392},{},[1393],{"type":50,"value":1394},"                {\"label\": \"a100-large ($2.50\u002Fhr)\", \"description\": \"1x A100, 80 GB VRAM — fastest, for very large datasets or image sizes\"}\n",{"type":44,"tag":192,"props":1396,"children":1398},{"class":194,"line":1397},29,[1399],{"type":44,"tag":192,"props":1400,"children":1401},{},[1402],{"type":50,"value":1230},{"type":44,"tag":192,"props":1404,"children":1406},{"class":194,"line":1405},30,[1407],{"type":44,"tag":192,"props":1408,"children":1409},{},[1410],{"type":50,"value":1239},{"type":44,"tag":192,"props":1412,"children":1414},{"class":194,"line":1413},31,[1415],{"type":44,"tag":192,"props":1416,"children":1417},{},[1418],{"type":50,"value":1419},"        }\n",{"type":44,"tag":192,"props":1421,"children":1423},{"class":194,"line":1422},32,[1424],{"type":44,"tag":192,"props":1425,"children":1426},{},[1427],{"type":50,"value":1428},"    ]\n",{"type":44,"tag":192,"props":1430,"children":1432},{"class":194,"line":1431},33,[1433],{"type":44,"tag":192,"props":1434,"children":1435},{},[1436],{"type":50,"value":867},{"type":44,"tag":53,"props":1438,"children":1439},{},[1440],{"type":44,"tag":128,"props":1441,"children":1442},{},[1443],{"type":50,"value":1444},"Step 4: Prepare training script",{"type":44,"tag":53,"props":1446,"children":1447},{},[1448,1450,1454,1456,1461,1463,1468,1470,1476,1478,1484,1486,1491,1493,1498],{"type":50,"value":1449},"For object detection, use ",{"type":44,"tag":283,"props":1451,"children":1452},{"href":1058},[1453],{"type":50,"value":1058},{"type":50,"value":1455}," as the production-ready template. For image classification, use ",{"type":44,"tag":283,"props":1457,"children":1459},{"href":1458},"scripts\u002Fimage_classification_training.py",[1460],{"type":50,"value":1458},{"type":50,"value":1462},". For SAM\u002FSAM2 segmentation, use ",{"type":44,"tag":283,"props":1464,"children":1466},{"href":1465},"scripts\u002Fsam_segmentation_training.py",[1467],{"type":50,"value":1465},{"type":50,"value":1469},". All scripts use ",{"type":44,"tag":132,"props":1471,"children":1473},{"className":1472},[],[1474],{"type":50,"value":1475},"HfArgumentParser",{"type":50,"value":1477}," — all configuration is passed via CLI arguments in ",{"type":44,"tag":132,"props":1479,"children":1481},{"className":1480},[],[1482],{"type":50,"value":1483},"script_args",{"type":50,"value":1485},", NOT by editing Python variables. For timm model details, see ",{"type":44,"tag":283,"props":1487,"children":1489},{"href":1488},"references\u002Ftimm_trainer.md",[1490],{"type":50,"value":1488},{"type":50,"value":1492},". For SAM2 training details, see ",{"type":44,"tag":283,"props":1494,"children":1496},{"href":1495},"references\u002Ffinetune_sam2_trainer.md",[1497],{"type":50,"value":1495},{"type":50,"value":1499},".",{"type":44,"tag":53,"props":1501,"children":1502},{},[1503],{"type":44,"tag":128,"props":1504,"children":1505},{},[1506],{"type":50,"value":1507},"Step 5: Save script, submit job, and report",{"type":44,"tag":1509,"props":1510,"children":1511},"ol",{},[1512,1538,1569,1595],{"type":44,"tag":75,"props":1513,"children":1514},{},[1515,1520,1522,1528,1530,1536],{"type":44,"tag":128,"props":1516,"children":1517},{},[1518],{"type":50,"value":1519},"Save the script locally",{"type":50,"value":1521}," to ",{"type":44,"tag":132,"props":1523,"children":1525},{"className":1524},[],[1526],{"type":50,"value":1527},"submitted_jobs\u002F",{"type":50,"value":1529}," in the workspace root (create if needed) with a descriptive name like ",{"type":44,"tag":132,"props":1531,"children":1533},{"className":1532},[],[1534],{"type":50,"value":1535},"training_\u003Cdataset>_\u003CYYYYMMDD_HHMMSS>.py",{"type":50,"value":1537},". Tell the user the path.",{"type":44,"tag":75,"props":1539,"children":1540},{},[1541,1546,1548,1554,1556,1561,1563,1568],{"type":44,"tag":128,"props":1542,"children":1543},{},[1544],{"type":50,"value":1545},"Submit",{"type":50,"value":1547}," using ",{"type":44,"tag":132,"props":1549,"children":1551},{"className":1550},[],[1552],{"type":50,"value":1553},"hf_jobs",{"type":50,"value":1555}," MCP tool (preferred) or ",{"type":44,"tag":132,"props":1557,"children":1559},{"className":1558},[],[1560],{"type":50,"value":927},{"type":50,"value":1562}," — see directive #1 for both methods. Pass all config via ",{"type":44,"tag":132,"props":1564,"children":1566},{"className":1565},[],[1567],{"type":50,"value":1483},{"type":50,"value":1499},{"type":44,"tag":75,"props":1570,"children":1571},{},[1572,1577,1579,1585,1587,1593],{"type":44,"tag":128,"props":1573,"children":1574},{},[1575],{"type":50,"value":1576},"Report",{"type":50,"value":1578}," the job ID (from ",{"type":44,"tag":132,"props":1580,"children":1582},{"className":1581},[],[1583],{"type":50,"value":1584},".id",{"type":50,"value":1586}," attribute), monitoring URL, Trackio dashboard (",{"type":44,"tag":132,"props":1588,"children":1590},{"className":1589},[],[1591],{"type":50,"value":1592},"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002F{username}\u002Ftrackio",{"type":50,"value":1594},"), expected time, and estimated cost.",{"type":44,"tag":75,"props":1596,"children":1597},{},[1598,1603],{"type":44,"tag":128,"props":1599,"children":1600},{},[1601],{"type":50,"value":1602},"Wait for user",{"type":50,"value":1604}," to request status checks — don't poll automatically. Training jobs run asynchronously and can take hours.",{"type":44,"tag":59,"props":1606,"children":1608},{"id":1607},"critical-directives",[1609],{"type":50,"value":1610},"Critical directives",{"type":44,"tag":53,"props":1612,"children":1613},{},[1614],{"type":50,"value":1615},"These rules prevent common failures. Follow them exactly.",{"type":44,"tag":268,"props":1617,"children":1619},{"id":1618},"_1-job-submission-hf_jobs-mcp-tool-vs-python-api",[1620,1622,1627],{"type":50,"value":1621},"1. Job submission: ",{"type":44,"tag":132,"props":1623,"children":1625},{"className":1624},[],[1626],{"type":50,"value":1553},{"type":50,"value":1628}," MCP tool vs Python API",{"type":44,"tag":53,"props":1630,"children":1631},{},[1632,1643,1645,1651],{"type":44,"tag":128,"props":1633,"children":1634},{},[1635,1641],{"type":44,"tag":132,"props":1636,"children":1638},{"className":1637},[],[1639],{"type":50,"value":1640},"hf_jobs()",{"type":50,"value":1642}," is an MCP tool, NOT a Python function.",{"type":50,"value":1644}," Do NOT try to import it from ",{"type":44,"tag":132,"props":1646,"children":1648},{"className":1647},[],[1649],{"type":50,"value":1650},"huggingface_hub",{"type":50,"value":1652},". Call it as a tool:",{"type":44,"tag":181,"props":1654,"children":1657},{"className":1655,"code":1656,"language":50},[1105],"hf_jobs(\"uv\", {\"script\": training_script_content, \"flavor\": \"a10g-large\", \"timeout\": \"4h\", \"secrets\": {\"HF_TOKEN\": \"$HF_TOKEN\"}})\n",[1658],{"type":44,"tag":132,"props":1659,"children":1660},{"__ignoreMap":186},[1661],{"type":50,"value":1656},{"type":44,"tag":53,"props":1663,"children":1664},{},[1665,1677],{"type":44,"tag":128,"props":1666,"children":1667},{},[1668,1670,1675],{"type":50,"value":1669},"If ",{"type":44,"tag":132,"props":1671,"children":1673},{"className":1672},[],[1674],{"type":50,"value":1553},{"type":50,"value":1676}," MCP tool is unavailable",{"type":50,"value":1678},", use the Python API directly:",{"type":44,"tag":181,"props":1680,"children":1682},{"className":828,"code":1681,"language":20,"meta":186,"style":186},"from huggingface_hub import HfApi, get_token\napi = HfApi()\njob_info = api.run_uv_job(\n    script=\"path\u002Fto\u002Ftraining_script.py\",  # file PATH, NOT content\n    script_args=[\"--dataset_name\", \"cppe-5\", ...],\n    flavor=\"a10g-large\",\n    timeout=14400,  # seconds (4 hours)\n    env={\"PYTHONUNBUFFERED\": \"1\"},\n    secrets={\"HF_TOKEN\": get_token()},  # MUST use get_token(), NOT \"$HF_TOKEN\"\n)\nprint(f\"Job ID: {job_info.id}\")\n",[1683],{"type":44,"tag":132,"props":1684,"children":1685},{"__ignoreMap":186},[1686,1694,1701,1709,1717,1725,1733,1741,1749,1757,1764],{"type":44,"tag":192,"props":1687,"children":1688},{"class":194,"line":195},[1689],{"type":44,"tag":192,"props":1690,"children":1691},{},[1692],{"type":50,"value":1693},"from huggingface_hub import HfApi, get_token\n",{"type":44,"tag":192,"props":1695,"children":1696},{"class":194,"line":236},[1697],{"type":44,"tag":192,"props":1698,"children":1699},{},[1700],{"type":50,"value":952},{"type":44,"tag":192,"props":1702,"children":1703},{"class":194,"line":852},[1704],{"type":44,"tag":192,"props":1705,"children":1706},{},[1707],{"type":50,"value":1708},"job_info = api.run_uv_job(\n",{"type":44,"tag":192,"props":1710,"children":1711},{"class":194,"line":861},[1712],{"type":44,"tag":192,"props":1713,"children":1714},{},[1715],{"type":50,"value":1716},"    script=\"path\u002Fto\u002Ftraining_script.py\",  # file PATH, NOT content\n",{"type":44,"tag":192,"props":1718,"children":1719},{"class":194,"line":971},[1720],{"type":44,"tag":192,"props":1721,"children":1722},{},[1723],{"type":50,"value":1724},"    script_args=[\"--dataset_name\", \"cppe-5\", ...],\n",{"type":44,"tag":192,"props":1726,"children":1727},{"class":194,"line":980},[1728],{"type":44,"tag":192,"props":1729,"children":1730},{},[1731],{"type":50,"value":1732},"    flavor=\"a10g-large\",\n",{"type":44,"tag":192,"props":1734,"children":1735},{"class":194,"line":989},[1736],{"type":44,"tag":192,"props":1737,"children":1738},{},[1739],{"type":50,"value":1740},"    timeout=14400,  # seconds (4 hours)\n",{"type":44,"tag":192,"props":1742,"children":1743},{"class":194,"line":998},[1744],{"type":44,"tag":192,"props":1745,"children":1746},{},[1747],{"type":50,"value":1748},"    env={\"PYTHONUNBUFFERED\": \"1\"},\n",{"type":44,"tag":192,"props":1750,"children":1751},{"class":194,"line":1224},[1752],{"type":44,"tag":192,"props":1753,"children":1754},{},[1755],{"type":50,"value":1756},"    secrets={\"HF_TOKEN\": get_token()},  # MUST use get_token(), NOT \"$HF_TOKEN\"\n",{"type":44,"tag":192,"props":1758,"children":1759},{"class":194,"line":1233},[1760],{"type":44,"tag":192,"props":1761,"children":1762},{},[1763],{"type":50,"value":1004},{"type":44,"tag":192,"props":1765,"children":1766},{"class":194,"line":1242},[1767],{"type":44,"tag":192,"props":1768,"children":1769},{},[1770],{"type":50,"value":1771},"print(f\"Job ID: {job_info.id}\")\n",{"type":44,"tag":53,"props":1773,"children":1774},{},[1775],{"type":44,"tag":128,"props":1776,"children":1777},{},[1778],{"type":50,"value":1779},"Critical differences between the two methods:",{"type":44,"tag":1781,"props":1782,"children":1783},"table",{},[1784,1814],{"type":44,"tag":1785,"props":1786,"children":1787},"thead",{},[1788],{"type":44,"tag":1789,"props":1790,"children":1791},"tr",{},[1792,1796,1806],{"type":44,"tag":1793,"props":1794,"children":1795},"th",{},[],{"type":44,"tag":1793,"props":1797,"children":1798},{},[1799,1804],{"type":44,"tag":132,"props":1800,"children":1802},{"className":1801},[],[1803],{"type":50,"value":1553},{"type":50,"value":1805}," MCP tool",{"type":44,"tag":1793,"props":1807,"children":1808},{},[1809],{"type":44,"tag":132,"props":1810,"children":1812},{"className":1811},[],[1813],{"type":50,"value":927},{"type":44,"tag":1815,"props":1816,"children":1817},"tbody",{},[1818,1851,1881],{"type":44,"tag":1789,"props":1819,"children":1820},{},[1821,1833,1838],{"type":44,"tag":1822,"props":1823,"children":1824},"td",{},[1825,1831],{"type":44,"tag":132,"props":1826,"children":1828},{"className":1827},[],[1829],{"type":50,"value":1830},"script",{"type":50,"value":1832}," param",{"type":44,"tag":1822,"props":1834,"children":1835},{},[1836],{"type":50,"value":1837},"Python code string or URL (NOT local paths)",{"type":44,"tag":1822,"props":1839,"children":1840},{},[1841,1843,1849],{"type":50,"value":1842},"File path to ",{"type":44,"tag":132,"props":1844,"children":1846},{"className":1845},[],[1847],{"type":50,"value":1848},".py",{"type":50,"value":1850}," file (NOT content)",{"type":44,"tag":1789,"props":1852,"children":1853},{},[1854,1859,1870],{"type":44,"tag":1822,"props":1855,"children":1856},{},[1857],{"type":50,"value":1858},"Token in secrets",{"type":44,"tag":1822,"props":1860,"children":1861},{},[1862,1868],{"type":44,"tag":132,"props":1863,"children":1865},{"className":1864},[],[1866],{"type":50,"value":1867},"\"$HF_TOKEN\"",{"type":50,"value":1869}," (auto-replaced)",{"type":44,"tag":1822,"props":1871,"children":1872},{},[1873,1879],{"type":44,"tag":132,"props":1874,"children":1876},{"className":1875},[],[1877],{"type":50,"value":1878},"get_token()",{"type":50,"value":1880}," (actual token value)",{"type":44,"tag":1789,"props":1882,"children":1883},{},[1884,1889,1902],{"type":44,"tag":1822,"props":1885,"children":1886},{},[1887],{"type":50,"value":1888},"Timeout format",{"type":44,"tag":1822,"props":1890,"children":1891},{},[1892,1894,1900],{"type":50,"value":1893},"String (",{"type":44,"tag":132,"props":1895,"children":1897},{"className":1896},[],[1898],{"type":50,"value":1899},"\"4h\"",{"type":50,"value":1901},")",{"type":44,"tag":1822,"props":1903,"children":1904},{},[1905,1907,1913],{"type":50,"value":1906},"Seconds (",{"type":44,"tag":132,"props":1908,"children":1910},{"className":1909},[],[1911],{"type":50,"value":1912},"14400",{"type":50,"value":1901},{"type":44,"tag":53,"props":1915,"children":1916},{},[1917],{"type":44,"tag":128,"props":1918,"children":1919},{},[1920],{"type":50,"value":1921},"Rules for both methods:",{"type":44,"tag":71,"props":1923,"children":1924},{},[1925,1930],{"type":44,"tag":75,"props":1926,"children":1927},{},[1928],{"type":50,"value":1929},"The training script MUST include PEP 723 inline metadata with dependencies",{"type":44,"tag":75,"props":1931,"children":1932},{},[1933,1935,1940,1941,1947,1949,1955,1957,1963],{"type":50,"value":1934},"Do NOT use ",{"type":44,"tag":132,"props":1936,"children":1938},{"className":1937},[],[1939],{"type":50,"value":488},{"type":50,"value":414},{"type":44,"tag":132,"props":1942,"children":1944},{"className":1943},[],[1945],{"type":50,"value":1946},"command",{"type":50,"value":1948}," parameters (those belong to ",{"type":44,"tag":132,"props":1950,"children":1952},{"className":1951},[],[1953],{"type":50,"value":1954},"run_job()",{"type":50,"value":1956},", not ",{"type":44,"tag":132,"props":1958,"children":1960},{"className":1959},[],[1961],{"type":50,"value":1962},"run_uv_job()",{"type":50,"value":1901},{"type":44,"tag":268,"props":1965,"children":1967},{"id":1966},"_2-authentication-via-job-secrets-explicit-hub_token-injection",[1968],{"type":50,"value":1969},"2. Authentication via job secrets + explicit hub_token injection",{"type":44,"tag":53,"props":1971,"children":1972},{},[1973,1978],{"type":44,"tag":128,"props":1974,"children":1975},{},[1976],{"type":50,"value":1977},"Job config",{"type":50,"value":1979}," MUST include the token in secrets — syntax depends on submission method (see table above).",{"type":44,"tag":53,"props":1981,"children":1982},{},[1983,1988,1990,1996,1998,2004,2006,2012,2014,2019,2021,2027,2029,2035,2037,2042,2044,2049],{"type":44,"tag":128,"props":1984,"children":1985},{},[1986],{"type":50,"value":1987},"Training script requirement:",{"type":50,"value":1989}," The Transformers ",{"type":44,"tag":132,"props":1991,"children":1993},{"className":1992},[],[1994],{"type":50,"value":1995},"Trainer",{"type":50,"value":1997}," calls ",{"type":44,"tag":132,"props":1999,"children":2001},{"className":2000},[],[2002],{"type":50,"value":2003},"create_repo(token=self.args.hub_token)",{"type":50,"value":2005}," during ",{"type":44,"tag":132,"props":2007,"children":2009},{"className":2008},[],[2010],{"type":50,"value":2011},"__init__()",{"type":50,"value":2013}," when ",{"type":44,"tag":132,"props":2015,"children":2017},{"className":2016},[],[2018],{"type":50,"value":757},{"type":50,"value":2020},". The training script MUST inject ",{"type":44,"tag":132,"props":2022,"children":2024},{"className":2023},[],[2025],{"type":50,"value":2026},"HF_TOKEN",{"type":50,"value":2028}," into ",{"type":44,"tag":132,"props":2030,"children":2032},{"className":2031},[],[2033],{"type":50,"value":2034},"training_args.hub_token",{"type":50,"value":2036}," AFTER parsing args but BEFORE creating the ",{"type":44,"tag":132,"props":2038,"children":2040},{"className":2039},[],[2041],{"type":50,"value":1995},{"type":50,"value":2043},". The template ",{"type":44,"tag":132,"props":2045,"children":2047},{"className":2046},[],[2048],{"type":50,"value":1058},{"type":50,"value":2050}," already includes this:",{"type":44,"tag":181,"props":2052,"children":2054},{"className":828,"code":2053,"language":20,"meta":186,"style":186},"hf_token = os.environ.get(\"HF_TOKEN\")\nif training_args.push_to_hub and not training_args.hub_token:\n    if hf_token:\n        training_args.hub_token = hf_token\n",[2055],{"type":44,"tag":132,"props":2056,"children":2057},{"__ignoreMap":186},[2058,2066,2074,2082],{"type":44,"tag":192,"props":2059,"children":2060},{"class":194,"line":195},[2061],{"type":44,"tag":192,"props":2062,"children":2063},{},[2064],{"type":50,"value":2065},"hf_token = os.environ.get(\"HF_TOKEN\")\n",{"type":44,"tag":192,"props":2067,"children":2068},{"class":194,"line":236},[2069],{"type":44,"tag":192,"props":2070,"children":2071},{},[2072],{"type":50,"value":2073},"if training_args.push_to_hub and not training_args.hub_token:\n",{"type":44,"tag":192,"props":2075,"children":2076},{"class":194,"line":852},[2077],{"type":44,"tag":192,"props":2078,"children":2079},{},[2080],{"type":50,"value":2081},"    if hf_token:\n",{"type":44,"tag":192,"props":2083,"children":2084},{"class":194,"line":861},[2085],{"type":44,"tag":192,"props":2086,"children":2087},{},[2088],{"type":50,"value":2089},"        training_args.hub_token = hf_token\n",{"type":44,"tag":53,"props":2091,"children":2092},{},[2093,2095,2101],{"type":50,"value":2094},"If you write a custom script, you MUST include this token injection before the ",{"type":44,"tag":132,"props":2096,"children":2098},{"className":2097},[],[2099],{"type":50,"value":2100},"Trainer(...)",{"type":50,"value":2102}," call.",{"type":44,"tag":71,"props":2104,"children":2105},{},[2106,2124,2137],{"type":44,"tag":75,"props":2107,"children":2108},{},[2109,2111,2117,2119],{"type":50,"value":2110},"Do NOT call ",{"type":44,"tag":132,"props":2112,"children":2114},{"className":2113},[],[2115],{"type":50,"value":2116},"login()",{"type":50,"value":2118}," in custom scripts unless replicating the full pattern from ",{"type":44,"tag":132,"props":2120,"children":2122},{"className":2121},[],[2123],{"type":50,"value":1058},{"type":44,"tag":75,"props":2125,"children":2126},{},[2127,2129,2135],{"type":50,"value":2128},"Do NOT rely on implicit token resolution (",{"type":44,"tag":132,"props":2130,"children":2132},{"className":2131},[],[2133],{"type":50,"value":2134},"hub_token=None",{"type":50,"value":2136},") — unreliable in Jobs",{"type":44,"tag":75,"props":2138,"children":2139},{},[2140,2142,2147,2149,2155],{"type":50,"value":2141},"See the ",{"type":44,"tag":132,"props":2143,"children":2145},{"className":2144},[],[2146],{"type":50,"value":137},{"type":50,"value":2148}," skill → ",{"type":44,"tag":2150,"props":2151,"children":2152},"em",{},[2153],{"type":50,"value":2154},"Token Usage Guide",{"type":50,"value":2156}," for full details",{"type":44,"tag":268,"props":2158,"children":2160},{"id":2159},"_3-jobinfo-attribute",[2161],{"type":50,"value":2162},"3. JobInfo attribute",{"type":44,"tag":53,"props":2164,"children":2165},{},[2166,2168,2173,2175,2181,2182,2188],{"type":50,"value":2167},"Access the job identifier using ",{"type":44,"tag":132,"props":2169,"children":2171},{"className":2170},[],[2172],{"type":50,"value":1584},{"type":50,"value":2174}," (NOT ",{"type":44,"tag":132,"props":2176,"children":2178},{"className":2177},[],[2179],{"type":50,"value":2180},".job_id",{"type":50,"value":414},{"type":44,"tag":132,"props":2183,"children":2185},{"className":2184},[],[2186],{"type":50,"value":2187},".name",{"type":50,"value":2189}," — these don't exist):",{"type":44,"tag":181,"props":2191,"children":2193},{"className":828,"code":2192,"language":20,"meta":186,"style":186},"job_info = api.run_uv_job(...)  # or hf_jobs(\"uv\", {...})\njob_id = job_info.id  # Correct -- returns string like \"687fb701029421ae5549d998\"\n",[2194],{"type":44,"tag":132,"props":2195,"children":2196},{"__ignoreMap":186},[2197,2205],{"type":44,"tag":192,"props":2198,"children":2199},{"class":194,"line":195},[2200],{"type":44,"tag":192,"props":2201,"children":2202},{},[2203],{"type":50,"value":2204},"job_info = api.run_uv_job(...)  # or hf_jobs(\"uv\", {...})\n",{"type":44,"tag":192,"props":2206,"children":2207},{"class":194,"line":236},[2208],{"type":44,"tag":192,"props":2209,"children":2210},{},[2211],{"type":50,"value":2212},"job_id = job_info.id  # Correct -- returns string like \"687fb701029421ae5549d998\"\n",{"type":44,"tag":268,"props":2214,"children":2216},{"id":2215},"_4-required-training-flags-and-hfargumentparser-boolean-syntax",[2217],{"type":50,"value":2218},"4. Required training flags and HfArgumentParser boolean syntax",{"type":44,"tag":53,"props":2220,"children":2221},{},[2222,2227,2229,2234,2236,2241],{"type":44,"tag":132,"props":2223,"children":2225},{"className":2224},[],[2226],{"type":50,"value":1058},{"type":50,"value":2228}," uses ",{"type":44,"tag":132,"props":2230,"children":2232},{"className":2231},[],[2233],{"type":50,"value":1475},{"type":50,"value":2235}," — all config is passed via ",{"type":44,"tag":132,"props":2237,"children":2239},{"className":2238},[],[2240],{"type":50,"value":1483},{"type":50,"value":2242},". Boolean arguments have two syntaxes:",{"type":44,"tag":71,"props":2244,"children":2245},{},[2246,2300],{"type":44,"tag":75,"props":2247,"children":2248},{},[2249,2260,2262,2268,2269,2275,2277,2283,2285,2291,2293,2299],{"type":44,"tag":128,"props":2250,"children":2251},{},[2252,2258],{"type":44,"tag":132,"props":2253,"children":2255},{"className":2254},[],[2256],{"type":50,"value":2257},"bool",{"type":50,"value":2259}," fields",{"type":50,"value":2261}," (e.g., ",{"type":44,"tag":132,"props":2263,"children":2265},{"className":2264},[],[2266],{"type":50,"value":2267},"push_to_hub",{"type":50,"value":292},{"type":44,"tag":132,"props":2270,"children":2272},{"className":2271},[],[2273],{"type":50,"value":2274},"do_train",{"type":50,"value":2276},"): Use as bare flags (",{"type":44,"tag":132,"props":2278,"children":2280},{"className":2279},[],[2281],{"type":50,"value":2282},"--push_to_hub",{"type":50,"value":2284},") or negate with ",{"type":44,"tag":132,"props":2286,"children":2288},{"className":2287},[],[2289],{"type":50,"value":2290},"--no_",{"type":50,"value":2292}," prefix (",{"type":44,"tag":132,"props":2294,"children":2296},{"className":2295},[],[2297],{"type":50,"value":2298},"--no_remove_unused_columns",{"type":50,"value":1901},{"type":44,"tag":75,"props":2301,"children":2302},{},[2303,2313,2314,2320,2322,2328,2330,2336,2338],{"type":44,"tag":128,"props":2304,"children":2305},{},[2306,2312],{"type":44,"tag":132,"props":2307,"children":2309},{"className":2308},[],[2310],{"type":50,"value":2311},"Optional[bool]",{"type":50,"value":2259},{"type":50,"value":2261},{"type":44,"tag":132,"props":2315,"children":2317},{"className":2316},[],[2318],{"type":50,"value":2319},"greater_is_better",{"type":50,"value":2321},"): MUST pass explicit value (",{"type":44,"tag":132,"props":2323,"children":2325},{"className":2324},[],[2326],{"type":50,"value":2327},"--greater_is_better True",{"type":50,"value":2329},"). Bare ",{"type":44,"tag":132,"props":2331,"children":2333},{"className":2332},[],[2334],{"type":50,"value":2335},"--greater_is_better",{"type":50,"value":2337}," causes ",{"type":44,"tag":132,"props":2339,"children":2341},{"className":2340},[],[2342],{"type":50,"value":2343},"error: expected one argument",{"type":44,"tag":53,"props":2345,"children":2346},{},[2347],{"type":50,"value":2348},"Required flags for object detection:",{"type":44,"tag":181,"props":2350,"children":2353},{"className":2351,"code":2352,"language":50},[1105],"--no_remove_unused_columns          # MUST: preserves image column for pixel_values\n--no_eval_do_concat_batches         # MUST: images have different numbers of target boxes\n--push_to_hub                       # MUST: environment is ephemeral\n--hub_model_id username\u002Fmodel-name\n--metric_for_best_model eval_map\n--greater_is_better True            # MUST pass \"True\" explicitly (Optional[bool])\n--do_train\n--do_eval\n",[2354],{"type":44,"tag":132,"props":2355,"children":2356},{"__ignoreMap":186},[2357],{"type":50,"value":2352},{"type":44,"tag":53,"props":2359,"children":2360},{},[2361],{"type":50,"value":2362},"Required flags for image classification:",{"type":44,"tag":181,"props":2364,"children":2367},{"className":2365,"code":2366,"language":50},[1105],"--no_remove_unused_columns          # MUST: preserves image column for pixel_values\n--push_to_hub                       # MUST: environment is ephemeral\n--hub_model_id username\u002Fmodel-name\n--metric_for_best_model eval_accuracy\n--greater_is_better True            # MUST pass \"True\" explicitly (Optional[bool])\n--do_train\n--do_eval\n",[2368],{"type":44,"tag":132,"props":2369,"children":2370},{"__ignoreMap":186},[2371],{"type":50,"value":2366},{"type":44,"tag":53,"props":2373,"children":2374},{},[2375],{"type":50,"value":2376},"Required flags for SAM\u002FSAM2 segmentation:",{"type":44,"tag":181,"props":2378,"children":2381},{"className":2379,"code":2380,"language":50},[1105],"--remove_unused_columns False       # MUST: preserves input_boxes\u002Finput_points\n--push_to_hub                       # MUST: environment is ephemeral\n--hub_model_id username\u002Fmodel-name\n--do_train\n--prompt_type bbox                  # or \"point\"\n--dataloader_pin_memory False       # MUST: avoids pin_memory issues with custom collator\n",[2382],{"type":44,"tag":132,"props":2383,"children":2384},{"__ignoreMap":186},[2385],{"type":50,"value":2380},{"type":44,"tag":268,"props":2387,"children":2389},{"id":2388},"_5-timeout-management",[2390],{"type":50,"value":2391},"5. Timeout management",{"type":44,"tag":53,"props":2393,"children":2394},{},[2395],{"type":50,"value":2396},"Default 30 min is TOO SHORT for object detection. Set minimum 2-4 hours. Add 30% buffer for model loading, preprocessing, and Hub push.",{"type":44,"tag":1781,"props":2398,"children":2399},{},[2400,2416],{"type":44,"tag":1785,"props":2401,"children":2402},{},[2403],{"type":44,"tag":1789,"props":2404,"children":2405},{},[2406,2411],{"type":44,"tag":1793,"props":2407,"children":2408},{},[2409],{"type":50,"value":2410},"Scenario",{"type":44,"tag":1793,"props":2412,"children":2413},{},[2414],{"type":50,"value":2415},"Timeout",{"type":44,"tag":1815,"props":2417,"children":2418},{},[2419,2432,2445,2458],{"type":44,"tag":1789,"props":2420,"children":2421},{},[2422,2427],{"type":44,"tag":1822,"props":2423,"children":2424},{},[2425],{"type":50,"value":2426},"Quick test (100-200 images, 5-10 epochs)",{"type":44,"tag":1822,"props":2428,"children":2429},{},[2430],{"type":50,"value":2431},"1h",{"type":44,"tag":1789,"props":2433,"children":2434},{},[2435,2440],{"type":44,"tag":1822,"props":2436,"children":2437},{},[2438],{"type":50,"value":2439},"Development (500-1K images, 15-20 epochs)",{"type":44,"tag":1822,"props":2441,"children":2442},{},[2443],{"type":50,"value":2444},"2-3h",{"type":44,"tag":1789,"props":2446,"children":2447},{},[2448,2453],{"type":44,"tag":1822,"props":2449,"children":2450},{},[2451],{"type":50,"value":2452},"Production (1K-5K images, 30 epochs)",{"type":44,"tag":1822,"props":2454,"children":2455},{},[2456],{"type":50,"value":2457},"4-6h",{"type":44,"tag":1789,"props":2459,"children":2460},{},[2461,2466],{"type":44,"tag":1822,"props":2462,"children":2463},{},[2464],{"type":50,"value":2465},"Large dataset (5K+ images)",{"type":44,"tag":1822,"props":2467,"children":2468},{},[2469],{"type":50,"value":2470},"6-12h",{"type":44,"tag":268,"props":2472,"children":2474},{"id":2473},"_6-trackio-monitoring",[2475],{"type":50,"value":2476},"6. Trackio monitoring",{"type":44,"tag":53,"props":2478,"children":2479},{},[2480,2482,2487,2489,2495,2496,2502,2504,2510,2512,2518,2520,2526,2528,2533,2535,2541],{"type":50,"value":2481},"Trackio is ",{"type":44,"tag":128,"props":2483,"children":2484},{},[2485],{"type":50,"value":2486},"always enabled",{"type":50,"value":2488}," in the object detection training script — it calls ",{"type":44,"tag":132,"props":2490,"children":2492},{"className":2491},[],[2493],{"type":50,"value":2494},"trackio.init()",{"type":50,"value":1082},{"type":44,"tag":132,"props":2497,"children":2499},{"className":2498},[],[2500],{"type":50,"value":2501},"trackio.finish()",{"type":50,"value":2503}," automatically. No need to pass ",{"type":44,"tag":132,"props":2505,"children":2507},{"className":2506},[],[2508],{"type":50,"value":2509},"--report_to trackio",{"type":50,"value":2511},". The project name is taken from ",{"type":44,"tag":132,"props":2513,"children":2515},{"className":2514},[],[2516],{"type":50,"value":2517},"--output_dir",{"type":50,"value":2519}," and the run name from ",{"type":44,"tag":132,"props":2521,"children":2523},{"className":2522},[],[2524],{"type":50,"value":2525},"--run_name",{"type":50,"value":2527},". For image classification, pass ",{"type":44,"tag":132,"props":2529,"children":2531},{"className":2530},[],[2532],{"type":50,"value":2509},{"type":50,"value":2534}," in ",{"type":44,"tag":132,"props":2536,"children":2538},{"className":2537},[],[2539],{"type":50,"value":2540},"TrainingArguments",{"type":50,"value":1499},{"type":44,"tag":53,"props":2543,"children":2544},{},[2545,2547],{"type":50,"value":2546},"Dashboard at: ",{"type":44,"tag":132,"props":2548,"children":2550},{"className":2549},[],[2551],{"type":50,"value":1592},{"type":44,"tag":59,"props":2553,"children":2555},{"id":2554},"model-hardware-selection",[2556],{"type":50,"value":2557},"Model & hardware selection",{"type":44,"tag":268,"props":2559,"children":2561},{"id":2560},"recommended-object-detection-models",[2562],{"type":50,"value":2563},"Recommended object detection models",{"type":44,"tag":1781,"props":2565,"children":2566},{},[2567,2588],{"type":44,"tag":1785,"props":2568,"children":2569},{},[2570],{"type":44,"tag":1789,"props":2571,"children":2572},{},[2573,2578,2583],{"type":44,"tag":1793,"props":2574,"children":2575},{},[2576],{"type":50,"value":2577},"Model",{"type":44,"tag":1793,"props":2579,"children":2580},{},[2581],{"type":50,"value":2582},"Params",{"type":44,"tag":1793,"props":2584,"children":2585},{},[2586],{"type":50,"value":2587},"Use case",{"type":44,"tag":1815,"props":2589,"children":2590},{},[2591,2613,2635,2657,2679,2701],{"type":44,"tag":1789,"props":2592,"children":2593},{},[2594,2603,2608],{"type":44,"tag":1822,"props":2595,"children":2596},{},[2597],{"type":44,"tag":132,"props":2598,"children":2600},{"className":2599},[],[2601],{"type":50,"value":2602},"ustc-community\u002Fdfine-small-coco",{"type":44,"tag":1822,"props":2604,"children":2605},{},[2606],{"type":50,"value":2607},"10.4M",{"type":44,"tag":1822,"props":2609,"children":2610},{},[2611],{"type":50,"value":2612},"Best starting point — fast, cheap, SOTA quality",{"type":44,"tag":1789,"props":2614,"children":2615},{},[2616,2625,2630],{"type":44,"tag":1822,"props":2617,"children":2618},{},[2619],{"type":44,"tag":132,"props":2620,"children":2622},{"className":2621},[],[2623],{"type":50,"value":2624},"PekingU\u002Frtdetr_v2_r18vd",{"type":44,"tag":1822,"props":2626,"children":2627},{},[2628],{"type":50,"value":2629},"20.2M",{"type":44,"tag":1822,"props":2631,"children":2632},{},[2633],{"type":50,"value":2634},"Lightweight real-time detector",{"type":44,"tag":1789,"props":2636,"children":2637},{},[2638,2647,2652],{"type":44,"tag":1822,"props":2639,"children":2640},{},[2641],{"type":44,"tag":132,"props":2642,"children":2644},{"className":2643},[],[2645],{"type":50,"value":2646},"ustc-community\u002Fdfine-large-coco",{"type":44,"tag":1822,"props":2648,"children":2649},{},[2650],{"type":50,"value":2651},"31.4M",{"type":44,"tag":1822,"props":2653,"children":2654},{},[2655],{"type":50,"value":2656},"Higher accuracy, still efficient",{"type":44,"tag":1789,"props":2658,"children":2659},{},[2660,2669,2674],{"type":44,"tag":1822,"props":2661,"children":2662},{},[2663],{"type":44,"tag":132,"props":2664,"children":2666},{"className":2665},[],[2667],{"type":50,"value":2668},"PekingU\u002Frtdetr_v2_r50vd",{"type":44,"tag":1822,"props":2670,"children":2671},{},[2672],{"type":50,"value":2673},"43M",{"type":44,"tag":1822,"props":2675,"children":2676},{},[2677],{"type":50,"value":2678},"Strong real-time baseline",{"type":44,"tag":1789,"props":2680,"children":2681},{},[2682,2691,2696],{"type":44,"tag":1822,"props":2683,"children":2684},{},[2685],{"type":44,"tag":132,"props":2686,"children":2688},{"className":2687},[],[2689],{"type":50,"value":2690},"ustc-community\u002Fdfine-xlarge-obj365",{"type":44,"tag":1822,"props":2692,"children":2693},{},[2694],{"type":50,"value":2695},"63.5M",{"type":44,"tag":1822,"props":2697,"children":2698},{},[2699],{"type":50,"value":2700},"Best accuracy (pretrained on Objects365)",{"type":44,"tag":1789,"props":2702,"children":2703},{},[2704,2713,2718],{"type":44,"tag":1822,"props":2705,"children":2706},{},[2707],{"type":44,"tag":132,"props":2708,"children":2710},{"className":2709},[],[2711],{"type":50,"value":2712},"PekingU\u002Frtdetr_v2_r101vd",{"type":44,"tag":1822,"props":2714,"children":2715},{},[2716],{"type":50,"value":2717},"76M",{"type":44,"tag":1822,"props":2719,"children":2720},{},[2721],{"type":50,"value":2722},"Largest RT-DETR v2 variant",{"type":44,"tag":53,"props":2724,"children":2725},{},[2726,2728,2733],{"type":50,"value":2727},"Start with ",{"type":44,"tag":132,"props":2729,"children":2731},{"className":2730},[],[2732],{"type":50,"value":2602},{"type":50,"value":2734}," for fast iteration. Move to D-FINE Large or RT-DETR v2 R50 for better accuracy.",{"type":44,"tag":268,"props":2736,"children":2738},{"id":2737},"recommended-image-classification-models",[2739],{"type":50,"value":2740},"Recommended image classification models",{"type":44,"tag":53,"props":2742,"children":2743},{},[2744,2746,2752,2754,2760,2762,2768,2770,2774],{"type":50,"value":2745},"All ",{"type":44,"tag":132,"props":2747,"children":2749},{"className":2748},[],[2750],{"type":50,"value":2751},"timm\u002F",{"type":50,"value":2753}," models work out of the box via ",{"type":44,"tag":132,"props":2755,"children":2757},{"className":2756},[],[2758],{"type":50,"value":2759},"AutoModelForImageClassification",{"type":50,"value":2761}," (loaded as ",{"type":44,"tag":132,"props":2763,"children":2765},{"className":2764},[],[2766],{"type":50,"value":2767},"TimmWrapperForImageClassification",{"type":50,"value":2769},"). See ",{"type":44,"tag":283,"props":2771,"children":2772},{"href":1488},[2773],{"type":50,"value":1488},{"type":50,"value":2775}," for details.",{"type":44,"tag":1781,"props":2777,"children":2778},{},[2779,2797],{"type":44,"tag":1785,"props":2780,"children":2781},{},[2782],{"type":44,"tag":1789,"props":2783,"children":2784},{},[2785,2789,2793],{"type":44,"tag":1793,"props":2786,"children":2787},{},[2788],{"type":50,"value":2577},{"type":44,"tag":1793,"props":2790,"children":2791},{},[2792],{"type":50,"value":2582},{"type":44,"tag":1793,"props":2794,"children":2795},{},[2796],{"type":50,"value":2587},{"type":44,"tag":1815,"props":2798,"children":2799},{},[2800,2822,2844,2866],{"type":44,"tag":1789,"props":2801,"children":2802},{},[2803,2812,2817],{"type":44,"tag":1822,"props":2804,"children":2805},{},[2806],{"type":44,"tag":132,"props":2807,"children":2809},{"className":2808},[],[2810],{"type":50,"value":2811},"timm\u002Fmobilenetv3_small_100.lamb_in1k",{"type":44,"tag":1822,"props":2813,"children":2814},{},[2815],{"type":50,"value":2816},"2.5M",{"type":44,"tag":1822,"props":2818,"children":2819},{},[2820],{"type":50,"value":2821},"Ultra-lightweight — mobile\u002Fedge, fastest training",{"type":44,"tag":1789,"props":2823,"children":2824},{},[2825,2834,2839],{"type":44,"tag":1822,"props":2826,"children":2827},{},[2828],{"type":44,"tag":132,"props":2829,"children":2831},{"className":2830},[],[2832],{"type":50,"value":2833},"timm\u002Fmobilevit_s.cvnets_in1k",{"type":44,"tag":1822,"props":2835,"children":2836},{},[2837],{"type":50,"value":2838},"5.6M",{"type":44,"tag":1822,"props":2840,"children":2841},{},[2842],{"type":50,"value":2843},"Mobile transformer — good accuracy\u002Fspeed trade-off",{"type":44,"tag":1789,"props":2845,"children":2846},{},[2847,2856,2861],{"type":44,"tag":1822,"props":2848,"children":2849},{},[2850],{"type":44,"tag":132,"props":2851,"children":2853},{"className":2852},[],[2854],{"type":50,"value":2855},"timm\u002Fresnet50.a1_in1k",{"type":44,"tag":1822,"props":2857,"children":2858},{},[2859],{"type":50,"value":2860},"25.6M",{"type":44,"tag":1822,"props":2862,"children":2863},{},[2864],{"type":50,"value":2865},"Strong CNN baseline — reliable, well-studied",{"type":44,"tag":1789,"props":2867,"children":2868},{},[2869,2878,2883],{"type":44,"tag":1822,"props":2870,"children":2871},{},[2872],{"type":44,"tag":132,"props":2873,"children":2875},{"className":2874},[],[2876],{"type":50,"value":2877},"timm\u002Fvit_base_patch16_dinov3.lvd1689m",{"type":44,"tag":1822,"props":2879,"children":2880},{},[2881],{"type":50,"value":2882},"86.6M",{"type":44,"tag":1822,"props":2884,"children":2885},{},[2886],{"type":50,"value":2887},"Best accuracy — DINOv3 self-supervised ViT",{"type":44,"tag":53,"props":2889,"children":2890},{},[2891,2892,2897,2899,2904,2905,2910],{"type":50,"value":2727},{"type":44,"tag":132,"props":2893,"children":2895},{"className":2894},[],[2896],{"type":50,"value":2811},{"type":50,"value":2898}," for fast iteration. Move to ",{"type":44,"tag":132,"props":2900,"children":2902},{"className":2901},[],[2903],{"type":50,"value":2855},{"type":50,"value":414},{"type":44,"tag":132,"props":2906,"children":2908},{"className":2907},[],[2909],{"type":50,"value":2877},{"type":50,"value":2911}," for better accuracy.",{"type":44,"tag":268,"props":2913,"children":2915},{"id":2914},"recommended-samsam2-segmentation-models",[2916],{"type":50,"value":2917},"Recommended SAM\u002FSAM2 segmentation models",{"type":44,"tag":1781,"props":2919,"children":2920},{},[2921,2939],{"type":44,"tag":1785,"props":2922,"children":2923},{},[2924],{"type":44,"tag":1789,"props":2925,"children":2926},{},[2927,2931,2935],{"type":44,"tag":1793,"props":2928,"children":2929},{},[2930],{"type":50,"value":2577},{"type":44,"tag":1793,"props":2932,"children":2933},{},[2934],{"type":50,"value":2582},{"type":44,"tag":1793,"props":2936,"children":2937},{},[2938],{"type":50,"value":2587},{"type":44,"tag":1815,"props":2940,"children":2941},{},[2942,2964,2986,3008,3030,3052,3074],{"type":44,"tag":1789,"props":2943,"children":2944},{},[2945,2954,2959],{"type":44,"tag":1822,"props":2946,"children":2947},{},[2948],{"type":44,"tag":132,"props":2949,"children":2951},{"className":2950},[],[2952],{"type":50,"value":2953},"facebook\u002Fsam2.1-hiera-tiny",{"type":44,"tag":1822,"props":2955,"children":2956},{},[2957],{"type":50,"value":2958},"38.9M",{"type":44,"tag":1822,"props":2960,"children":2961},{},[2962],{"type":50,"value":2963},"Fastest SAM2 — good for quick experiments",{"type":44,"tag":1789,"props":2965,"children":2966},{},[2967,2976,2981],{"type":44,"tag":1822,"props":2968,"children":2969},{},[2970],{"type":44,"tag":132,"props":2971,"children":2973},{"className":2972},[],[2974],{"type":50,"value":2975},"facebook\u002Fsam2.1-hiera-small",{"type":44,"tag":1822,"props":2977,"children":2978},{},[2979],{"type":50,"value":2980},"46.0M",{"type":44,"tag":1822,"props":2982,"children":2983},{},[2984],{"type":50,"value":2985},"Best starting point — good quality\u002Fspeed balance",{"type":44,"tag":1789,"props":2987,"children":2988},{},[2989,2998,3003],{"type":44,"tag":1822,"props":2990,"children":2991},{},[2992],{"type":44,"tag":132,"props":2993,"children":2995},{"className":2994},[],[2996],{"type":50,"value":2997},"facebook\u002Fsam2.1-hiera-base-plus",{"type":44,"tag":1822,"props":2999,"children":3000},{},[3001],{"type":50,"value":3002},"80.8M",{"type":44,"tag":1822,"props":3004,"children":3005},{},[3006],{"type":50,"value":3007},"Higher capacity for complex segmentation",{"type":44,"tag":1789,"props":3009,"children":3010},{},[3011,3020,3025],{"type":44,"tag":1822,"props":3012,"children":3013},{},[3014],{"type":44,"tag":132,"props":3015,"children":3017},{"className":3016},[],[3018],{"type":50,"value":3019},"facebook\u002Fsam2.1-hiera-large",{"type":44,"tag":1822,"props":3021,"children":3022},{},[3023],{"type":50,"value":3024},"224.4M",{"type":44,"tag":1822,"props":3026,"children":3027},{},[3028],{"type":50,"value":3029},"Best SAM2 accuracy — requires more VRAM",{"type":44,"tag":1789,"props":3031,"children":3032},{},[3033,3042,3047],{"type":44,"tag":1822,"props":3034,"children":3035},{},[3036],{"type":44,"tag":132,"props":3037,"children":3039},{"className":3038},[],[3040],{"type":50,"value":3041},"facebook\u002Fsam-vit-base",{"type":44,"tag":1822,"props":3043,"children":3044},{},[3045],{"type":50,"value":3046},"93.7M",{"type":44,"tag":1822,"props":3048,"children":3049},{},[3050],{"type":50,"value":3051},"Original SAM — ViT-B backbone",{"type":44,"tag":1789,"props":3053,"children":3054},{},[3055,3064,3069],{"type":44,"tag":1822,"props":3056,"children":3057},{},[3058],{"type":44,"tag":132,"props":3059,"children":3061},{"className":3060},[],[3062],{"type":50,"value":3063},"facebook\u002Fsam-vit-large",{"type":44,"tag":1822,"props":3065,"children":3066},{},[3067],{"type":50,"value":3068},"312.3M",{"type":44,"tag":1822,"props":3070,"children":3071},{},[3072],{"type":50,"value":3073},"Original SAM — ViT-L backbone",{"type":44,"tag":1789,"props":3075,"children":3076},{},[3077,3086,3091],{"type":44,"tag":1822,"props":3078,"children":3079},{},[3080],{"type":44,"tag":132,"props":3081,"children":3083},{"className":3082},[],[3084],{"type":50,"value":3085},"facebook\u002Fsam-vit-huge",{"type":44,"tag":1822,"props":3087,"children":3088},{},[3089],{"type":50,"value":3090},"641.1M",{"type":44,"tag":1822,"props":3092,"children":3093},{},[3094],{"type":50,"value":3095},"Original SAM — ViT-H, best SAM v1 accuracy",{"type":44,"tag":53,"props":3097,"children":3098},{},[3099,3100,3105],{"type":50,"value":2727},{"type":44,"tag":132,"props":3101,"children":3103},{"className":3102},[],[3104],{"type":50,"value":2975},{"type":50,"value":3106}," for fast iteration. SAM2 models are generally more efficient than SAM v1 at similar quality. Only the mask decoder is trained by default (vision and prompt encoders are frozen).",{"type":44,"tag":268,"props":3108,"children":3110},{"id":3109},"hardware-recommendation",[3111],{"type":50,"value":3112},"Hardware recommendation",{"type":44,"tag":53,"props":3114,"children":3115},{},[3116,3118,3129,3131,3136,3138,3144,3145,3150,3152,3158,3160,3166,3167,3173,3175,3180,3182,3187,3189,3194],{"type":50,"value":3117},"All recommended OD and IC models are under 100M params — ",{"type":44,"tag":128,"props":3119,"children":3120},{},[3121,3127],{"type":44,"tag":132,"props":3122,"children":3124},{"className":3123},[],[3125],{"type":50,"value":3126},"t4-small",{"type":50,"value":3128}," (16 GB VRAM, $0.40\u002Fhr) is sufficient for all of them.",{"type":50,"value":3130}," Image classification models are generally smaller and faster than object detection models — ",{"type":44,"tag":132,"props":3132,"children":3134},{"className":3133},[],[3135],{"type":50,"value":3126},{"type":50,"value":3137}," handles even ViT-Base comfortably. For SAM2 models up to ",{"type":44,"tag":132,"props":3139,"children":3141},{"className":3140},[],[3142],{"type":50,"value":3143},"hiera-base-plus",{"type":50,"value":292},{"type":44,"tag":132,"props":3146,"children":3148},{"className":3147},[],[3149],{"type":50,"value":3126},{"type":50,"value":3151}," is sufficient since only the mask decoder is trained. For ",{"type":44,"tag":132,"props":3153,"children":3155},{"className":3154},[],[3156],{"type":50,"value":3157},"sam2.1-hiera-large",{"type":50,"value":3159}," or SAM v1 models, use ",{"type":44,"tag":132,"props":3161,"children":3163},{"className":3162},[],[3164],{"type":50,"value":3165},"l4x1",{"type":50,"value":414},{"type":44,"tag":132,"props":3168,"children":3170},{"className":3169},[],[3171],{"type":50,"value":3172},"a10g-large",{"type":50,"value":3174},". Only upgrade if you hit OOM from large batch sizes — reduce batch size first before switching hardware. Common upgrade path: ",{"type":44,"tag":132,"props":3176,"children":3178},{"className":3177},[],[3179],{"type":50,"value":3126},{"type":50,"value":3181}," → ",{"type":44,"tag":132,"props":3183,"children":3185},{"className":3184},[],[3186],{"type":50,"value":3165},{"type":50,"value":3188}," ($0.80\u002Fhr, 24 GB) → ",{"type":44,"tag":132,"props":3190,"children":3192},{"className":3191},[],[3193],{"type":50,"value":3172},{"type":50,"value":3195}," ($1.50\u002Fhr, 24 GB).",{"type":44,"tag":53,"props":3197,"children":3198},{},[3199,3201,3206,3208,3214],{"type":50,"value":3200},"For full hardware flavor list: refer to the ",{"type":44,"tag":132,"props":3202,"children":3204},{"className":3203},[],[3205],{"type":50,"value":137},{"type":50,"value":3207}," skill. For cost estimation: run ",{"type":44,"tag":132,"props":3209,"children":3211},{"className":3210},[],[3212],{"type":50,"value":3213},"scripts\u002Festimate_cost.py",{"type":50,"value":1499},{"type":44,"tag":59,"props":3216,"children":3218},{"id":3217},"quick-start-object-detection",[3219],{"type":50,"value":3220},"Quick start — Object Detection",{"type":44,"tag":53,"props":3222,"children":3223},{},[3224,3226,3231],{"type":50,"value":3225},"The ",{"type":44,"tag":132,"props":3227,"children":3229},{"className":3228},[],[3230],{"type":50,"value":1483},{"type":50,"value":3232}," below are the same for both submission methods. See directive #1 for the critical differences between them.",{"type":44,"tag":181,"props":3234,"children":3236},{"className":828,"code":3235,"language":20,"meta":186,"style":186},"OD_SCRIPT_ARGS = [\n    \"--model_name_or_path\", \"ustc-community\u002Fdfine-small-coco\",\n    \"--dataset_name\", \"cppe-5\",\n    \"--image_square_size\", \"640\",\n    \"--output_dir\", \"dfine_finetuned\",\n    \"--num_train_epochs\", \"30\",\n    \"--per_device_train_batch_size\", \"8\",\n    \"--learning_rate\", \"5e-5\",\n    \"--eval_strategy\", \"epoch\",\n    \"--save_strategy\", \"epoch\",\n    \"--save_total_limit\", \"2\",\n    \"--load_best_model_at_end\",\n    \"--metric_for_best_model\", \"eval_map\",\n    \"--greater_is_better\", \"True\",\n    \"--no_remove_unused_columns\",\n    \"--no_eval_do_concat_batches\",\n    \"--push_to_hub\",\n    \"--hub_model_id\", \"username\u002Fmodel-name\",\n    \"--do_train\",\n    \"--do_eval\",\n]\n",[3237],{"type":44,"tag":132,"props":3238,"children":3239},{"__ignoreMap":186},[3240,3248,3256,3264,3272,3280,3288,3296,3304,3312,3320,3328,3336,3344,3352,3360,3368,3376,3384,3392,3400],{"type":44,"tag":192,"props":3241,"children":3242},{"class":194,"line":195},[3243],{"type":44,"tag":192,"props":3244,"children":3245},{},[3246],{"type":50,"value":3247},"OD_SCRIPT_ARGS = [\n",{"type":44,"tag":192,"props":3249,"children":3250},{"class":194,"line":236},[3251],{"type":44,"tag":192,"props":3252,"children":3253},{},[3254],{"type":50,"value":3255},"    \"--model_name_or_path\", \"ustc-community\u002Fdfine-small-coco\",\n",{"type":44,"tag":192,"props":3257,"children":3258},{"class":194,"line":852},[3259],{"type":44,"tag":192,"props":3260,"children":3261},{},[3262],{"type":50,"value":3263},"    \"--dataset_name\", \"cppe-5\",\n",{"type":44,"tag":192,"props":3265,"children":3266},{"class":194,"line":861},[3267],{"type":44,"tag":192,"props":3268,"children":3269},{},[3270],{"type":50,"value":3271},"    \"--image_square_size\", \"640\",\n",{"type":44,"tag":192,"props":3273,"children":3274},{"class":194,"line":971},[3275],{"type":44,"tag":192,"props":3276,"children":3277},{},[3278],{"type":50,"value":3279},"    \"--output_dir\", \"dfine_finetuned\",\n",{"type":44,"tag":192,"props":3281,"children":3282},{"class":194,"line":980},[3283],{"type":44,"tag":192,"props":3284,"children":3285},{},[3286],{"type":50,"value":3287},"    \"--num_train_epochs\", \"30\",\n",{"type":44,"tag":192,"props":3289,"children":3290},{"class":194,"line":989},[3291],{"type":44,"tag":192,"props":3292,"children":3293},{},[3294],{"type":50,"value":3295},"    \"--per_device_train_batch_size\", \"8\",\n",{"type":44,"tag":192,"props":3297,"children":3298},{"class":194,"line":998},[3299],{"type":44,"tag":192,"props":3300,"children":3301},{},[3302],{"type":50,"value":3303},"    \"--learning_rate\", \"5e-5\",\n",{"type":44,"tag":192,"props":3305,"children":3306},{"class":194,"line":1224},[3307],{"type":44,"tag":192,"props":3308,"children":3309},{},[3310],{"type":50,"value":3311},"    \"--eval_strategy\", \"epoch\",\n",{"type":44,"tag":192,"props":3313,"children":3314},{"class":194,"line":1233},[3315],{"type":44,"tag":192,"props":3316,"children":3317},{},[3318],{"type":50,"value":3319},"    \"--save_strategy\", \"epoch\",\n",{"type":44,"tag":192,"props":3321,"children":3322},{"class":194,"line":1242},[3323],{"type":44,"tag":192,"props":3324,"children":3325},{},[3326],{"type":50,"value":3327},"    \"--save_total_limit\", \"2\",\n",{"type":44,"tag":192,"props":3329,"children":3330},{"class":194,"line":1251},[3331],{"type":44,"tag":192,"props":3332,"children":3333},{},[3334],{"type":50,"value":3335},"    \"--load_best_model_at_end\",\n",{"type":44,"tag":192,"props":3337,"children":3338},{"class":194,"line":1259},[3339],{"type":44,"tag":192,"props":3340,"children":3341},{},[3342],{"type":50,"value":3343},"    \"--metric_for_best_model\", \"eval_map\",\n",{"type":44,"tag":192,"props":3345,"children":3346},{"class":194,"line":1268},[3347],{"type":44,"tag":192,"props":3348,"children":3349},{},[3350],{"type":50,"value":3351},"    \"--greater_is_better\", \"True\",\n",{"type":44,"tag":192,"props":3353,"children":3354},{"class":194,"line":1277},[3355],{"type":44,"tag":192,"props":3356,"children":3357},{},[3358],{"type":50,"value":3359},"    \"--no_remove_unused_columns\",\n",{"type":44,"tag":192,"props":3361,"children":3362},{"class":194,"line":1285},[3363],{"type":44,"tag":192,"props":3364,"children":3365},{},[3366],{"type":50,"value":3367},"    \"--no_eval_do_concat_batches\",\n",{"type":44,"tag":192,"props":3369,"children":3370},{"class":194,"line":1294},[3371],{"type":44,"tag":192,"props":3372,"children":3373},{},[3374],{"type":50,"value":3375},"    \"--push_to_hub\",\n",{"type":44,"tag":192,"props":3377,"children":3378},{"class":194,"line":1303},[3379],{"type":44,"tag":192,"props":3380,"children":3381},{},[3382],{"type":50,"value":3383},"    \"--hub_model_id\", \"username\u002Fmodel-name\",\n",{"type":44,"tag":192,"props":3385,"children":3386},{"class":194,"line":1311},[3387],{"type":44,"tag":192,"props":3388,"children":3389},{},[3390],{"type":50,"value":3391},"    \"--do_train\",\n",{"type":44,"tag":192,"props":3393,"children":3394},{"class":194,"line":1319},[3395],{"type":44,"tag":192,"props":3396,"children":3397},{},[3398],{"type":50,"value":3399},"    \"--do_eval\",\n",{"type":44,"tag":192,"props":3401,"children":3402},{"class":194,"line":1327},[3403],{"type":44,"tag":192,"props":3404,"children":3405},{},[3406],{"type":50,"value":3407},"]\n",{"type":44,"tag":181,"props":3409,"children":3411},{"className":828,"code":3410,"language":20,"meta":186,"style":186},"from huggingface_hub import HfApi, get_token\napi = HfApi()\njob_info = api.run_uv_job(\n    script=\"scripts\u002Fobject_detection_training.py\",\n    script_args=OD_SCRIPT_ARGS,\n    flavor=\"t4-small\",\n    timeout=14400,\n    env={\"PYTHONUNBUFFERED\": \"1\"},\n    secrets={\"HF_TOKEN\": get_token()},\n)\nprint(f\"Job ID: {job_info.id}\")\n",[3412],{"type":44,"tag":132,"props":3413,"children":3414},{"__ignoreMap":186},[3415,3422,3429,3436,3444,3452,3460,3468,3475,3483,3490],{"type":44,"tag":192,"props":3416,"children":3417},{"class":194,"line":195},[3418],{"type":44,"tag":192,"props":3419,"children":3420},{},[3421],{"type":50,"value":1693},{"type":44,"tag":192,"props":3423,"children":3424},{"class":194,"line":236},[3425],{"type":44,"tag":192,"props":3426,"children":3427},{},[3428],{"type":50,"value":952},{"type":44,"tag":192,"props":3430,"children":3431},{"class":194,"line":852},[3432],{"type":44,"tag":192,"props":3433,"children":3434},{},[3435],{"type":50,"value":1708},{"type":44,"tag":192,"props":3437,"children":3438},{"class":194,"line":861},[3439],{"type":44,"tag":192,"props":3440,"children":3441},{},[3442],{"type":50,"value":3443},"    script=\"scripts\u002Fobject_detection_training.py\",\n",{"type":44,"tag":192,"props":3445,"children":3446},{"class":194,"line":971},[3447],{"type":44,"tag":192,"props":3448,"children":3449},{},[3450],{"type":50,"value":3451},"    script_args=OD_SCRIPT_ARGS,\n",{"type":44,"tag":192,"props":3453,"children":3454},{"class":194,"line":980},[3455],{"type":44,"tag":192,"props":3456,"children":3457},{},[3458],{"type":50,"value":3459},"    flavor=\"t4-small\",\n",{"type":44,"tag":192,"props":3461,"children":3462},{"class":194,"line":989},[3463],{"type":44,"tag":192,"props":3464,"children":3465},{},[3466],{"type":50,"value":3467},"    timeout=14400,\n",{"type":44,"tag":192,"props":3469,"children":3470},{"class":194,"line":998},[3471],{"type":44,"tag":192,"props":3472,"children":3473},{},[3474],{"type":50,"value":1748},{"type":44,"tag":192,"props":3476,"children":3477},{"class":194,"line":1224},[3478],{"type":44,"tag":192,"props":3479,"children":3480},{},[3481],{"type":50,"value":3482},"    secrets={\"HF_TOKEN\": get_token()},\n",{"type":44,"tag":192,"props":3484,"children":3485},{"class":194,"line":1233},[3486],{"type":44,"tag":192,"props":3487,"children":3488},{},[3489],{"type":50,"value":1004},{"type":44,"tag":192,"props":3491,"children":3492},{"class":194,"line":1242},[3493],{"type":44,"tag":192,"props":3494,"children":3495},{},[3496],{"type":50,"value":1771},{"type":44,"tag":268,"props":3498,"children":3500},{"id":3499},"key-od-script_args",[3501,3503],{"type":50,"value":3502},"Key OD ",{"type":44,"tag":132,"props":3504,"children":3506},{"className":3505},[],[3507],{"type":50,"value":1483},{"type":44,"tag":71,"props":3509,"children":3510},{},[3511,3530,3541,3552,3570,3581,3592,3611],{"type":44,"tag":75,"props":3512,"children":3513},{},[3514,3520,3522,3528],{"type":44,"tag":132,"props":3515,"children":3517},{"className":3516},[],[3518],{"type":50,"value":3519},"--model_name_or_path",{"type":50,"value":3521}," — recommended: ",{"type":44,"tag":132,"props":3523,"children":3525},{"className":3524},[],[3526],{"type":50,"value":3527},"\"ustc-community\u002Fdfine-small-coco\"",{"type":50,"value":3529}," (see model table above)",{"type":44,"tag":75,"props":3531,"children":3532},{},[3533,3539],{"type":44,"tag":132,"props":3534,"children":3536},{"className":3535},[],[3537],{"type":50,"value":3538},"--dataset_name",{"type":50,"value":3540}," — the Hub dataset ID",{"type":44,"tag":75,"props":3542,"children":3543},{},[3544,3550],{"type":44,"tag":132,"props":3545,"children":3547},{"className":3546},[],[3548],{"type":50,"value":3549},"--image_square_size",{"type":50,"value":3551}," — 480 (fast iteration) or 800 (better accuracy)",{"type":44,"tag":75,"props":3553,"children":3554},{},[3555,3561,3562,3568],{"type":44,"tag":132,"props":3556,"children":3558},{"className":3557},[],[3559],{"type":50,"value":3560},"--hub_model_id",{"type":50,"value":751},{"type":44,"tag":132,"props":3563,"children":3565},{"className":3564},[],[3566],{"type":50,"value":3567},"\"username\u002Fmodel-name\"",{"type":50,"value":3569}," for Hub persistence",{"type":44,"tag":75,"props":3571,"children":3572},{},[3573,3579],{"type":44,"tag":132,"props":3574,"children":3576},{"className":3575},[],[3577],{"type":50,"value":3578},"--num_train_epochs",{"type":50,"value":3580}," — 30 typical for convergence",{"type":44,"tag":75,"props":3582,"children":3583},{},[3584,3590],{"type":44,"tag":132,"props":3585,"children":3587},{"className":3586},[],[3588],{"type":50,"value":3589},"--train_val_split",{"type":50,"value":3591}," — fraction to split for validation (default 0.15), set if dataset lacks a validation split",{"type":44,"tag":75,"props":3593,"children":3594},{},[3595,3601,3603,3609],{"type":44,"tag":132,"props":3596,"children":3598},{"className":3597},[],[3599],{"type":50,"value":3600},"--max_train_samples",{"type":50,"value":3602}," — truncate training set (useful for quick test runs, e.g. ",{"type":44,"tag":132,"props":3604,"children":3606},{"className":3605},[],[3607],{"type":50,"value":3608},"\"785\"",{"type":50,"value":3610}," for ~10% of a 7.8K dataset)",{"type":44,"tag":75,"props":3612,"children":3613},{},[3614,3620],{"type":44,"tag":132,"props":3615,"children":3617},{"className":3616},[],[3618],{"type":50,"value":3619},"--max_eval_samples",{"type":50,"value":3621}," — truncate evaluation set",{"type":44,"tag":59,"props":3623,"children":3625},{"id":3624},"quick-start-image-classification",[3626],{"type":50,"value":3627},"Quick start — Image Classification",{"type":44,"tag":181,"props":3629,"children":3631},{"className":828,"code":3630,"language":20,"meta":186,"style":186},"IC_SCRIPT_ARGS = [\n    \"--model_name_or_path\", \"timm\u002Fmobilenetv3_small_100.lamb_in1k\",\n    \"--dataset_name\", \"ethz\u002Ffood101\",\n    \"--output_dir\", \"food101_classifier\",\n    \"--num_train_epochs\", \"5\",\n    \"--per_device_train_batch_size\", \"32\",\n    \"--per_device_eval_batch_size\", \"32\",\n    \"--learning_rate\", \"5e-5\",\n    \"--eval_strategy\", \"epoch\",\n    \"--save_strategy\", \"epoch\",\n    \"--save_total_limit\", \"2\",\n    \"--load_best_model_at_end\",\n    \"--metric_for_best_model\", \"eval_accuracy\",\n    \"--greater_is_better\", \"True\",\n    \"--no_remove_unused_columns\",\n    \"--push_to_hub\",\n    \"--hub_model_id\", \"username\u002Ffood101-classifier\",\n    \"--do_train\",\n    \"--do_eval\",\n]\n",[3632],{"type":44,"tag":132,"props":3633,"children":3634},{"__ignoreMap":186},[3635,3643,3651,3659,3667,3675,3683,3691,3698,3705,3712,3719,3726,3734,3741,3748,3755,3763,3770,3777],{"type":44,"tag":192,"props":3636,"children":3637},{"class":194,"line":195},[3638],{"type":44,"tag":192,"props":3639,"children":3640},{},[3641],{"type":50,"value":3642},"IC_SCRIPT_ARGS = [\n",{"type":44,"tag":192,"props":3644,"children":3645},{"class":194,"line":236},[3646],{"type":44,"tag":192,"props":3647,"children":3648},{},[3649],{"type":50,"value":3650},"    \"--model_name_or_path\", \"timm\u002Fmobilenetv3_small_100.lamb_in1k\",\n",{"type":44,"tag":192,"props":3652,"children":3653},{"class":194,"line":852},[3654],{"type":44,"tag":192,"props":3655,"children":3656},{},[3657],{"type":50,"value":3658},"    \"--dataset_name\", \"ethz\u002Ffood101\",\n",{"type":44,"tag":192,"props":3660,"children":3661},{"class":194,"line":861},[3662],{"type":44,"tag":192,"props":3663,"children":3664},{},[3665],{"type":50,"value":3666},"    \"--output_dir\", \"food101_classifier\",\n",{"type":44,"tag":192,"props":3668,"children":3669},{"class":194,"line":971},[3670],{"type":44,"tag":192,"props":3671,"children":3672},{},[3673],{"type":50,"value":3674},"    \"--num_train_epochs\", \"5\",\n",{"type":44,"tag":192,"props":3676,"children":3677},{"class":194,"line":980},[3678],{"type":44,"tag":192,"props":3679,"children":3680},{},[3681],{"type":50,"value":3682},"    \"--per_device_train_batch_size\", \"32\",\n",{"type":44,"tag":192,"props":3684,"children":3685},{"class":194,"line":989},[3686],{"type":44,"tag":192,"props":3687,"children":3688},{},[3689],{"type":50,"value":3690},"    \"--per_device_eval_batch_size\", \"32\",\n",{"type":44,"tag":192,"props":3692,"children":3693},{"class":194,"line":998},[3694],{"type":44,"tag":192,"props":3695,"children":3696},{},[3697],{"type":50,"value":3303},{"type":44,"tag":192,"props":3699,"children":3700},{"class":194,"line":1224},[3701],{"type":44,"tag":192,"props":3702,"children":3703},{},[3704],{"type":50,"value":3311},{"type":44,"tag":192,"props":3706,"children":3707},{"class":194,"line":1233},[3708],{"type":44,"tag":192,"props":3709,"children":3710},{},[3711],{"type":50,"value":3319},{"type":44,"tag":192,"props":3713,"children":3714},{"class":194,"line":1242},[3715],{"type":44,"tag":192,"props":3716,"children":3717},{},[3718],{"type":50,"value":3327},{"type":44,"tag":192,"props":3720,"children":3721},{"class":194,"line":1251},[3722],{"type":44,"tag":192,"props":3723,"children":3724},{},[3725],{"type":50,"value":3335},{"type":44,"tag":192,"props":3727,"children":3728},{"class":194,"line":1259},[3729],{"type":44,"tag":192,"props":3730,"children":3731},{},[3732],{"type":50,"value":3733},"    \"--metric_for_best_model\", \"eval_accuracy\",\n",{"type":44,"tag":192,"props":3735,"children":3736},{"class":194,"line":1268},[3737],{"type":44,"tag":192,"props":3738,"children":3739},{},[3740],{"type":50,"value":3351},{"type":44,"tag":192,"props":3742,"children":3743},{"class":194,"line":1277},[3744],{"type":44,"tag":192,"props":3745,"children":3746},{},[3747],{"type":50,"value":3359},{"type":44,"tag":192,"props":3749,"children":3750},{"class":194,"line":1285},[3751],{"type":44,"tag":192,"props":3752,"children":3753},{},[3754],{"type":50,"value":3375},{"type":44,"tag":192,"props":3756,"children":3757},{"class":194,"line":1294},[3758],{"type":44,"tag":192,"props":3759,"children":3760},{},[3761],{"type":50,"value":3762},"    \"--hub_model_id\", \"username\u002Ffood101-classifier\",\n",{"type":44,"tag":192,"props":3764,"children":3765},{"class":194,"line":1303},[3766],{"type":44,"tag":192,"props":3767,"children":3768},{},[3769],{"type":50,"value":3391},{"type":44,"tag":192,"props":3771,"children":3772},{"class":194,"line":1311},[3773],{"type":44,"tag":192,"props":3774,"children":3775},{},[3776],{"type":50,"value":3399},{"type":44,"tag":192,"props":3778,"children":3779},{"class":194,"line":1319},[3780],{"type":44,"tag":192,"props":3781,"children":3782},{},[3783],{"type":50,"value":3407},{"type":44,"tag":181,"props":3785,"children":3787},{"className":828,"code":3786,"language":20,"meta":186,"style":186},"from huggingface_hub import HfApi, get_token\napi = HfApi()\njob_info = api.run_uv_job(\n    script=\"scripts\u002Fimage_classification_training.py\",\n    script_args=IC_SCRIPT_ARGS,\n    flavor=\"t4-small\",\n    timeout=7200,\n    env={\"PYTHONUNBUFFERED\": \"1\"},\n    secrets={\"HF_TOKEN\": get_token()},\n)\nprint(f\"Job ID: {job_info.id}\")\n",[3788],{"type":44,"tag":132,"props":3789,"children":3790},{"__ignoreMap":186},[3791,3798,3805,3812,3820,3828,3835,3843,3850,3857,3864],{"type":44,"tag":192,"props":3792,"children":3793},{"class":194,"line":195},[3794],{"type":44,"tag":192,"props":3795,"children":3796},{},[3797],{"type":50,"value":1693},{"type":44,"tag":192,"props":3799,"children":3800},{"class":194,"line":236},[3801],{"type":44,"tag":192,"props":3802,"children":3803},{},[3804],{"type":50,"value":952},{"type":44,"tag":192,"props":3806,"children":3807},{"class":194,"line":852},[3808],{"type":44,"tag":192,"props":3809,"children":3810},{},[3811],{"type":50,"value":1708},{"type":44,"tag":192,"props":3813,"children":3814},{"class":194,"line":861},[3815],{"type":44,"tag":192,"props":3816,"children":3817},{},[3818],{"type":50,"value":3819},"    script=\"scripts\u002Fimage_classification_training.py\",\n",{"type":44,"tag":192,"props":3821,"children":3822},{"class":194,"line":971},[3823],{"type":44,"tag":192,"props":3824,"children":3825},{},[3826],{"type":50,"value":3827},"    script_args=IC_SCRIPT_ARGS,\n",{"type":44,"tag":192,"props":3829,"children":3830},{"class":194,"line":980},[3831],{"type":44,"tag":192,"props":3832,"children":3833},{},[3834],{"type":50,"value":3459},{"type":44,"tag":192,"props":3836,"children":3837},{"class":194,"line":989},[3838],{"type":44,"tag":192,"props":3839,"children":3840},{},[3841],{"type":50,"value":3842},"    timeout=7200,\n",{"type":44,"tag":192,"props":3844,"children":3845},{"class":194,"line":998},[3846],{"type":44,"tag":192,"props":3847,"children":3848},{},[3849],{"type":50,"value":1748},{"type":44,"tag":192,"props":3851,"children":3852},{"class":194,"line":1224},[3853],{"type":44,"tag":192,"props":3854,"children":3855},{},[3856],{"type":50,"value":3482},{"type":44,"tag":192,"props":3858,"children":3859},{"class":194,"line":1233},[3860],{"type":44,"tag":192,"props":3861,"children":3862},{},[3863],{"type":50,"value":1004},{"type":44,"tag":192,"props":3865,"children":3866},{"class":194,"line":1242},[3867],{"type":44,"tag":192,"props":3868,"children":3869},{},[3870],{"type":50,"value":1771},{"type":44,"tag":268,"props":3872,"children":3874},{"id":3873},"key-ic-script_args",[3875,3877],{"type":50,"value":3876},"Key IC ",{"type":44,"tag":132,"props":3878,"children":3880},{"className":3879},[],[3881],{"type":50,"value":1483},{"type":44,"tag":71,"props":3883,"children":3884},{},[3885,3902,3911,3929,3947,3962,3972,3983,3992],{"type":44,"tag":75,"props":3886,"children":3887},{},[3888,3893,3895,3900],{"type":44,"tag":132,"props":3889,"children":3891},{"className":3890},[],[3892],{"type":50,"value":3519},{"type":50,"value":3894}," — any ",{"type":44,"tag":132,"props":3896,"children":3898},{"className":3897},[],[3899],{"type":50,"value":2751},{"type":50,"value":3901}," model or Transformers classification model (see model table above)",{"type":44,"tag":75,"props":3903,"children":3904},{},[3905,3910],{"type":44,"tag":132,"props":3906,"children":3908},{"className":3907},[],[3909],{"type":50,"value":3538},{"type":50,"value":3540},{"type":44,"tag":75,"props":3912,"children":3913},{},[3914,3920,3922,3928],{"type":44,"tag":132,"props":3915,"children":3917},{"className":3916},[],[3918],{"type":50,"value":3919},"--image_column_name",{"type":50,"value":3921}," — column containing PIL images (default: ",{"type":44,"tag":132,"props":3923,"children":3925},{"className":3924},[],[3926],{"type":50,"value":3927},"\"image\"",{"type":50,"value":1901},{"type":44,"tag":75,"props":3930,"children":3931},{},[3932,3938,3940,3946],{"type":44,"tag":132,"props":3933,"children":3935},{"className":3934},[],[3936],{"type":50,"value":3937},"--label_column_name",{"type":50,"value":3939}," — column containing class labels (default: ",{"type":44,"tag":132,"props":3941,"children":3943},{"className":3942},[],[3944],{"type":50,"value":3945},"\"label\"",{"type":50,"value":1901},{"type":44,"tag":75,"props":3948,"children":3949},{},[3950,3955,3956,3961],{"type":44,"tag":132,"props":3951,"children":3953},{"className":3952},[],[3954],{"type":50,"value":3560},{"type":50,"value":751},{"type":44,"tag":132,"props":3957,"children":3959},{"className":3958},[],[3960],{"type":50,"value":3567},{"type":50,"value":3569},{"type":44,"tag":75,"props":3963,"children":3964},{},[3965,3970],{"type":44,"tag":132,"props":3966,"children":3968},{"className":3967},[],[3969],{"type":50,"value":3578},{"type":50,"value":3971}," — 3-5 typical for classification (fewer than OD)",{"type":44,"tag":75,"props":3973,"children":3974},{},[3975,3981],{"type":44,"tag":132,"props":3976,"children":3978},{"className":3977},[],[3979],{"type":50,"value":3980},"--per_device_train_batch_size",{"type":50,"value":3982}," — 16-64 (classification models use less memory than OD)",{"type":44,"tag":75,"props":3984,"children":3985},{},[3986,3991],{"type":44,"tag":132,"props":3987,"children":3989},{"className":3988},[],[3990],{"type":50,"value":3589},{"type":50,"value":3591},{"type":44,"tag":75,"props":3993,"children":3994},{},[3995,4000,4002,4007],{"type":44,"tag":132,"props":3996,"children":3998},{"className":3997},[],[3999],{"type":50,"value":3600},{"type":50,"value":4001}," \u002F ",{"type":44,"tag":132,"props":4003,"children":4005},{"className":4004},[],[4006],{"type":50,"value":3619},{"type":50,"value":4008}," — truncate for quick tests",{"type":44,"tag":59,"props":4010,"children":4012},{"id":4011},"quick-start-samsam2-segmentation",[4013],{"type":50,"value":4014},"Quick start — SAM\u002FSAM2 Segmentation",{"type":44,"tag":181,"props":4016,"children":4018},{"className":828,"code":4017,"language":20,"meta":186,"style":186},"SAM_SCRIPT_ARGS = [\n    \"--model_name_or_path\", \"facebook\u002Fsam2.1-hiera-small\",\n    \"--dataset_name\", \"merve\u002FMicroMat-mini\",\n    \"--prompt_type\", \"bbox\",\n    \"--prompt_column_name\", \"prompt\",\n    \"--output_dir\", \"sam2-finetuned\",\n    \"--num_train_epochs\", \"30\",\n    \"--per_device_train_batch_size\", \"4\",\n    \"--learning_rate\", \"1e-5\",\n    \"--logging_steps\", \"1\",\n    \"--save_strategy\", \"epoch\",\n    \"--save_total_limit\", \"2\",\n    \"--remove_unused_columns\", \"False\",\n    \"--dataloader_pin_memory\", \"False\",\n    \"--push_to_hub\",\n    \"--hub_model_id\", \"username\u002Fsam2-finetuned\",\n    \"--do_train\",\n    \"--report_to\", \"trackio\",\n]\n",[4019],{"type":44,"tag":132,"props":4020,"children":4021},{"__ignoreMap":186},[4022,4030,4038,4046,4054,4062,4070,4077,4085,4093,4101,4108,4115,4123,4131,4138,4146,4153,4161],{"type":44,"tag":192,"props":4023,"children":4024},{"class":194,"line":195},[4025],{"type":44,"tag":192,"props":4026,"children":4027},{},[4028],{"type":50,"value":4029},"SAM_SCRIPT_ARGS = [\n",{"type":44,"tag":192,"props":4031,"children":4032},{"class":194,"line":236},[4033],{"type":44,"tag":192,"props":4034,"children":4035},{},[4036],{"type":50,"value":4037},"    \"--model_name_or_path\", \"facebook\u002Fsam2.1-hiera-small\",\n",{"type":44,"tag":192,"props":4039,"children":4040},{"class":194,"line":852},[4041],{"type":44,"tag":192,"props":4042,"children":4043},{},[4044],{"type":50,"value":4045},"    \"--dataset_name\", \"merve\u002FMicroMat-mini\",\n",{"type":44,"tag":192,"props":4047,"children":4048},{"class":194,"line":861},[4049],{"type":44,"tag":192,"props":4050,"children":4051},{},[4052],{"type":50,"value":4053},"    \"--prompt_type\", \"bbox\",\n",{"type":44,"tag":192,"props":4055,"children":4056},{"class":194,"line":971},[4057],{"type":44,"tag":192,"props":4058,"children":4059},{},[4060],{"type":50,"value":4061},"    \"--prompt_column_name\", \"prompt\",\n",{"type":44,"tag":192,"props":4063,"children":4064},{"class":194,"line":980},[4065],{"type":44,"tag":192,"props":4066,"children":4067},{},[4068],{"type":50,"value":4069},"    \"--output_dir\", \"sam2-finetuned\",\n",{"type":44,"tag":192,"props":4071,"children":4072},{"class":194,"line":989},[4073],{"type":44,"tag":192,"props":4074,"children":4075},{},[4076],{"type":50,"value":3287},{"type":44,"tag":192,"props":4078,"children":4079},{"class":194,"line":998},[4080],{"type":44,"tag":192,"props":4081,"children":4082},{},[4083],{"type":50,"value":4084},"    \"--per_device_train_batch_size\", \"4\",\n",{"type":44,"tag":192,"props":4086,"children":4087},{"class":194,"line":1224},[4088],{"type":44,"tag":192,"props":4089,"children":4090},{},[4091],{"type":50,"value":4092},"    \"--learning_rate\", \"1e-5\",\n",{"type":44,"tag":192,"props":4094,"children":4095},{"class":194,"line":1233},[4096],{"type":44,"tag":192,"props":4097,"children":4098},{},[4099],{"type":50,"value":4100},"    \"--logging_steps\", \"1\",\n",{"type":44,"tag":192,"props":4102,"children":4103},{"class":194,"line":1242},[4104],{"type":44,"tag":192,"props":4105,"children":4106},{},[4107],{"type":50,"value":3319},{"type":44,"tag":192,"props":4109,"children":4110},{"class":194,"line":1251},[4111],{"type":44,"tag":192,"props":4112,"children":4113},{},[4114],{"type":50,"value":3327},{"type":44,"tag":192,"props":4116,"children":4117},{"class":194,"line":1259},[4118],{"type":44,"tag":192,"props":4119,"children":4120},{},[4121],{"type":50,"value":4122},"    \"--remove_unused_columns\", \"False\",\n",{"type":44,"tag":192,"props":4124,"children":4125},{"class":194,"line":1268},[4126],{"type":44,"tag":192,"props":4127,"children":4128},{},[4129],{"type":50,"value":4130},"    \"--dataloader_pin_memory\", \"False\",\n",{"type":44,"tag":192,"props":4132,"children":4133},{"class":194,"line":1277},[4134],{"type":44,"tag":192,"props":4135,"children":4136},{},[4137],{"type":50,"value":3375},{"type":44,"tag":192,"props":4139,"children":4140},{"class":194,"line":1285},[4141],{"type":44,"tag":192,"props":4142,"children":4143},{},[4144],{"type":50,"value":4145},"    \"--hub_model_id\", \"username\u002Fsam2-finetuned\",\n",{"type":44,"tag":192,"props":4147,"children":4148},{"class":194,"line":1294},[4149],{"type":44,"tag":192,"props":4150,"children":4151},{},[4152],{"type":50,"value":3391},{"type":44,"tag":192,"props":4154,"children":4155},{"class":194,"line":1303},[4156],{"type":44,"tag":192,"props":4157,"children":4158},{},[4159],{"type":50,"value":4160},"    \"--report_to\", \"trackio\",\n",{"type":44,"tag":192,"props":4162,"children":4163},{"class":194,"line":1311},[4164],{"type":44,"tag":192,"props":4165,"children":4166},{},[4167],{"type":50,"value":3407},{"type":44,"tag":181,"props":4169,"children":4171},{"className":828,"code":4170,"language":20,"meta":186,"style":186},"from huggingface_hub import HfApi, get_token\napi = HfApi()\njob_info = api.run_uv_job(\n    script=\"scripts\u002Fsam_segmentation_training.py\",\n    script_args=SAM_SCRIPT_ARGS,\n    flavor=\"t4-small\",\n    timeout=7200,\n    env={\"PYTHONUNBUFFERED\": \"1\"},\n    secrets={\"HF_TOKEN\": get_token()},\n)\nprint(f\"Job ID: {job_info.id}\")\n",[4172],{"type":44,"tag":132,"props":4173,"children":4174},{"__ignoreMap":186},[4175,4182,4189,4196,4204,4212,4219,4226,4233,4240,4247],{"type":44,"tag":192,"props":4176,"children":4177},{"class":194,"line":195},[4178],{"type":44,"tag":192,"props":4179,"children":4180},{},[4181],{"type":50,"value":1693},{"type":44,"tag":192,"props":4183,"children":4184},{"class":194,"line":236},[4185],{"type":44,"tag":192,"props":4186,"children":4187},{},[4188],{"type":50,"value":952},{"type":44,"tag":192,"props":4190,"children":4191},{"class":194,"line":852},[4192],{"type":44,"tag":192,"props":4193,"children":4194},{},[4195],{"type":50,"value":1708},{"type":44,"tag":192,"props":4197,"children":4198},{"class":194,"line":861},[4199],{"type":44,"tag":192,"props":4200,"children":4201},{},[4202],{"type":50,"value":4203},"    script=\"scripts\u002Fsam_segmentation_training.py\",\n",{"type":44,"tag":192,"props":4205,"children":4206},{"class":194,"line":971},[4207],{"type":44,"tag":192,"props":4208,"children":4209},{},[4210],{"type":50,"value":4211},"    script_args=SAM_SCRIPT_ARGS,\n",{"type":44,"tag":192,"props":4213,"children":4214},{"class":194,"line":980},[4215],{"type":44,"tag":192,"props":4216,"children":4217},{},[4218],{"type":50,"value":3459},{"type":44,"tag":192,"props":4220,"children":4221},{"class":194,"line":989},[4222],{"type":44,"tag":192,"props":4223,"children":4224},{},[4225],{"type":50,"value":3842},{"type":44,"tag":192,"props":4227,"children":4228},{"class":194,"line":998},[4229],{"type":44,"tag":192,"props":4230,"children":4231},{},[4232],{"type":50,"value":1748},{"type":44,"tag":192,"props":4234,"children":4235},{"class":194,"line":1224},[4236],{"type":44,"tag":192,"props":4237,"children":4238},{},[4239],{"type":50,"value":3482},{"type":44,"tag":192,"props":4241,"children":4242},{"class":194,"line":1233},[4243],{"type":44,"tag":192,"props":4244,"children":4245},{},[4246],{"type":50,"value":1004},{"type":44,"tag":192,"props":4248,"children":4249},{"class":194,"line":1242},[4250],{"type":44,"tag":192,"props":4251,"children":4252},{},[4253],{"type":50,"value":1771},{"type":44,"tag":268,"props":4255,"children":4257},{"id":4256},"key-sam-script_args",[4258,4260],{"type":50,"value":4259},"Key SAM ",{"type":44,"tag":132,"props":4261,"children":4263},{"className":4262},[],[4264],{"type":50,"value":1483},{"type":44,"tag":71,"props":4266,"children":4267},{},[4268,4278,4295,4320,4338,4349,4360,4378,4393,4403,4413,4431],{"type":44,"tag":75,"props":4269,"children":4270},{},[4271,4276],{"type":44,"tag":132,"props":4272,"children":4274},{"className":4273},[],[4275],{"type":50,"value":3519},{"type":50,"value":4277}," — SAM or SAM2 model (see model table above); auto-detects SAM vs SAM2",{"type":44,"tag":75,"props":4279,"children":4280},{},[4281,4286,4288,4294],{"type":44,"tag":132,"props":4282,"children":4284},{"className":4283},[],[4285],{"type":50,"value":3538},{"type":50,"value":4287}," — the Hub dataset ID (e.g., ",{"type":44,"tag":132,"props":4289,"children":4291},{"className":4290},[],[4292],{"type":50,"value":4293},"\"merve\u002FMicroMat-mini\"",{"type":50,"value":1901},{"type":44,"tag":75,"props":4296,"children":4297},{},[4298,4304,4305,4311,4312,4318],{"type":44,"tag":132,"props":4299,"children":4301},{"className":4300},[],[4302],{"type":50,"value":4303},"--prompt_type",{"type":50,"value":751},{"type":44,"tag":132,"props":4306,"children":4308},{"className":4307},[],[4309],{"type":50,"value":4310},"\"bbox\"",{"type":50,"value":414},{"type":44,"tag":132,"props":4313,"children":4315},{"className":4314},[],[4316],{"type":50,"value":4317},"\"point\"",{"type":50,"value":4319}," — type of prompt in the dataset",{"type":44,"tag":75,"props":4321,"children":4322},{},[4323,4329,4331,4337],{"type":44,"tag":132,"props":4324,"children":4326},{"className":4325},[],[4327],{"type":50,"value":4328},"--prompt_column_name",{"type":50,"value":4330}," — column with JSON-encoded prompts (default: ",{"type":44,"tag":132,"props":4332,"children":4334},{"className":4333},[],[4335],{"type":50,"value":4336},"\"prompt\"",{"type":50,"value":1901},{"type":44,"tag":75,"props":4339,"children":4340},{},[4341,4347],{"type":44,"tag":132,"props":4342,"children":4344},{"className":4343},[],[4345],{"type":50,"value":4346},"--bbox_column_name",{"type":50,"value":4348}," — dedicated bbox column (alternative to JSON prompt column)",{"type":44,"tag":75,"props":4350,"children":4351},{},[4352,4358],{"type":44,"tag":132,"props":4353,"children":4355},{"className":4354},[],[4356],{"type":50,"value":4357},"--point_column_name",{"type":50,"value":4359}," — dedicated point column (alternative to JSON prompt column)",{"type":44,"tag":75,"props":4361,"children":4362},{},[4363,4369,4371,4377],{"type":44,"tag":132,"props":4364,"children":4366},{"className":4365},[],[4367],{"type":50,"value":4368},"--mask_column_name",{"type":50,"value":4370}," — column with ground-truth masks (default: ",{"type":44,"tag":132,"props":4372,"children":4374},{"className":4373},[],[4375],{"type":50,"value":4376},"\"mask\"",{"type":50,"value":1901},{"type":44,"tag":75,"props":4379,"children":4380},{},[4381,4386,4387,4392],{"type":44,"tag":132,"props":4382,"children":4384},{"className":4383},[],[4385],{"type":50,"value":3560},{"type":50,"value":751},{"type":44,"tag":132,"props":4388,"children":4390},{"className":4389},[],[4391],{"type":50,"value":3567},{"type":50,"value":3569},{"type":44,"tag":75,"props":4394,"children":4395},{},[4396,4401],{"type":44,"tag":132,"props":4397,"children":4399},{"className":4398},[],[4400],{"type":50,"value":3578},{"type":50,"value":4402}," — 20-30 typical for SAM fine-tuning",{"type":44,"tag":75,"props":4404,"children":4405},{},[4406,4411],{"type":44,"tag":132,"props":4407,"children":4409},{"className":4408},[],[4410],{"type":50,"value":3980},{"type":50,"value":4412}," — 2-4 (SAM models use significant memory)",{"type":44,"tag":75,"props":4414,"children":4415},{},[4416,4422,4423,4429],{"type":44,"tag":132,"props":4417,"children":4419},{"className":4418},[],[4420],{"type":50,"value":4421},"--freeze_vision_encoder",{"type":50,"value":4001},{"type":44,"tag":132,"props":4424,"children":4426},{"className":4425},[],[4427],{"type":50,"value":4428},"--freeze_prompt_encoder",{"type":50,"value":4430}," — freeze encoder weights (default: both frozen, only mask decoder trains)",{"type":44,"tag":75,"props":4432,"children":4433},{},[4434,4439],{"type":44,"tag":132,"props":4435,"children":4437},{"className":4436},[],[4438],{"type":50,"value":3589},{"type":50,"value":4440}," — fraction to split for validation (default 0.1)",{"type":44,"tag":59,"props":4442,"children":4444},{"id":4443},"checking-job-status",[4445],{"type":50,"value":4446},"Checking job status",{"type":44,"tag":53,"props":4448,"children":4449},{},[4450],{"type":44,"tag":128,"props":4451,"children":4452},{},[4453],{"type":50,"value":4454},"MCP tool (if available):",{"type":44,"tag":181,"props":4456,"children":4459},{"className":4457,"code":4458,"language":50},[1105],"hf_jobs(\"ps\")                                   # List all jobs\nhf_jobs(\"logs\", {\"job_id\": \"your-job-id\"})      # View logs\nhf_jobs(\"inspect\", {\"job_id\": \"your-job-id\"})   # Job details\n",[4460],{"type":44,"tag":132,"props":4461,"children":4462},{"__ignoreMap":186},[4463],{"type":50,"value":4458},{"type":44,"tag":53,"props":4465,"children":4466},{},[4467],{"type":44,"tag":128,"props":4468,"children":4469},{},[4470],{"type":50,"value":4471},"Python API fallback:",{"type":44,"tag":181,"props":4473,"children":4475},{"className":828,"code":4474,"language":20,"meta":186,"style":186},"from huggingface_hub import HfApi\napi = HfApi()\napi.list_jobs()                                  # List all jobs\napi.get_job_logs(job_id=\"your-job-id\")           # View logs\napi.get_job(job_id=\"your-job-id\")                # Job details\n",[4476],{"type":44,"tag":132,"props":4477,"children":4478},{"__ignoreMap":186},[4479,4486,4493,4501,4509],{"type":44,"tag":192,"props":4480,"children":4481},{"class":194,"line":195},[4482],{"type":44,"tag":192,"props":4483,"children":4484},{},[4485],{"type":50,"value":944},{"type":44,"tag":192,"props":4487,"children":4488},{"class":194,"line":236},[4489],{"type":44,"tag":192,"props":4490,"children":4491},{},[4492],{"type":50,"value":952},{"type":44,"tag":192,"props":4494,"children":4495},{"class":194,"line":852},[4496],{"type":44,"tag":192,"props":4497,"children":4498},{},[4499],{"type":50,"value":4500},"api.list_jobs()                                  # List all jobs\n",{"type":44,"tag":192,"props":4502,"children":4503},{"class":194,"line":861},[4504],{"type":44,"tag":192,"props":4505,"children":4506},{},[4507],{"type":50,"value":4508},"api.get_job_logs(job_id=\"your-job-id\")           # View logs\n",{"type":44,"tag":192,"props":4510,"children":4511},{"class":194,"line":971},[4512],{"type":44,"tag":192,"props":4513,"children":4514},{},[4515],{"type":50,"value":4516},"api.get_job(job_id=\"your-job-id\")                # Job details\n",{"type":44,"tag":59,"props":4518,"children":4520},{"id":4519},"common-failure-modes",[4521],{"type":50,"value":4522},"Common failure modes",{"type":44,"tag":268,"props":4524,"children":4526},{"id":4525},"oom-cuda-out-of-memory",[4527],{"type":50,"value":4528},"OOM (CUDA out of memory)",{"type":44,"tag":53,"props":4530,"children":4531},{},[4532,4534,4540,4542,4548],{"type":50,"value":4533},"Reduce ",{"type":44,"tag":132,"props":4535,"children":4537},{"className":4536},[],[4538],{"type":50,"value":4539},"per_device_train_batch_size",{"type":50,"value":4541}," (try 4, then 2), reduce ",{"type":44,"tag":132,"props":4543,"children":4545},{"className":4544},[],[4546],{"type":50,"value":4547},"IMAGE_SIZE",{"type":50,"value":4549},", or upgrade hardware.",{"type":44,"tag":268,"props":4551,"children":4553},{"id":4552},"dataset-format-errors",[4554],{"type":50,"value":4555},"Dataset format errors",{"type":44,"tag":53,"props":4557,"children":4558},{},[4559,4561,4567,4569,4574,4576,4581,4583,4588],{"type":50,"value":4560},"Run ",{"type":44,"tag":132,"props":4562,"children":4564},{"className":4563},[],[4565],{"type":50,"value":4566},"scripts\u002Fdataset_inspector.py",{"type":50,"value":4568}," first. The training script auto-detects xyxy vs xywh, converts string categories to integer IDs, and adds ",{"type":44,"tag":132,"props":4570,"children":4572},{"className":4571},[],[4573],{"type":50,"value":442},{"type":50,"value":4575}," if missing. Ensure ",{"type":44,"tag":132,"props":4577,"children":4579},{"className":4578},[],[4580],{"type":50,"value":1080},{"type":50,"value":4582}," contains 4-value coordinate lists in absolute pixels and ",{"type":44,"tag":132,"props":4584,"children":4586},{"className":4585},[],[4587],{"type":50,"value":1088},{"type":50,"value":4589}," contains either integer IDs or string labels.",{"type":44,"tag":268,"props":4591,"children":4593},{"id":4592},"hub-push-failures-401",[4594],{"type":50,"value":4595},"Hub push failures (401)",{"type":44,"tag":53,"props":4597,"children":4598},{},[4599,4601,4606,4608,4613,4615,4620,4622,4628],{"type":50,"value":4600},"Verify: (1) job secrets include token (see directive #2), (2) script sets ",{"type":44,"tag":132,"props":4602,"children":4604},{"className":4603},[],[4605],{"type":50,"value":2034},{"type":50,"value":4607}," BEFORE creating the ",{"type":44,"tag":132,"props":4609,"children":4611},{"className":4610},[],[4612],{"type":50,"value":1995},{"type":50,"value":4614},", (3) ",{"type":44,"tag":132,"props":4616,"children":4618},{"className":4617},[],[4619],{"type":50,"value":757},{"type":50,"value":4621}," is set, (4) correct ",{"type":44,"tag":132,"props":4623,"children":4625},{"className":4624},[],[4626],{"type":50,"value":4627},"hub_model_id",{"type":50,"value":4629},", (5) token has write permissions.",{"type":44,"tag":268,"props":4631,"children":4633},{"id":4632},"job-timeout",[4634],{"type":50,"value":4635},"Job timeout",{"type":44,"tag":53,"props":4637,"children":4638},{},[4639,4641,4647],{"type":50,"value":4640},"Increase timeout (see directive #5 table), reduce epochs\u002Fdataset, or use checkpoint strategy with ",{"type":44,"tag":132,"props":4642,"children":4644},{"className":4643},[],[4645],{"type":50,"value":4646},"hub_strategy=\"every_save\"",{"type":50,"value":1499},{"type":44,"tag":268,"props":4649,"children":4651},{"id":4650},"keyerror-test-missing-test-split",[4652],{"type":50,"value":4653},"KeyError: 'test' (missing test split)",{"type":44,"tag":53,"props":4655,"children":4656},{},[4657,4659,4665,4667,4672],{"type":50,"value":4658},"The object detection training script handles this gracefully — it falls back to the ",{"type":44,"tag":132,"props":4660,"children":4662},{"className":4661},[],[4663],{"type":50,"value":4664},"validation",{"type":50,"value":4666}," split. Ensure you're using the latest ",{"type":44,"tag":132,"props":4668,"children":4670},{"className":4669},[],[4671],{"type":50,"value":1058},{"type":50,"value":1499},{"type":44,"tag":268,"props":4674,"children":4676},{"id":4675},"single-class-dataset-iteration-over-a-0-d-tensor",[4677],{"type":50,"value":4678},"Single-class dataset: \"iteration over a 0-d tensor\"",{"type":44,"tag":53,"props":4680,"children":4681},{},[4682,4688,4690,4695,4697,4703],{"type":44,"tag":132,"props":4683,"children":4685},{"className":4684},[],[4686],{"type":50,"value":4687},"torchmetrics.MeanAveragePrecision",{"type":50,"value":4689}," returns scalar (0-d) tensors for per-class metrics when there's only one class. The template ",{"type":44,"tag":132,"props":4691,"children":4693},{"className":4692},[],[4694],{"type":50,"value":1058},{"type":50,"value":4696}," handles this by calling ",{"type":44,"tag":132,"props":4698,"children":4700},{"className":4699},[],[4701],{"type":50,"value":4702},".unsqueeze(0)",{"type":50,"value":4704}," on these tensors. Ensure you're using the latest template.",{"type":44,"tag":268,"props":4706,"children":4708},{"id":4707},"poor-detection-performance-map-015",[4709],{"type":50,"value":4710},"Poor detection performance (mAP \u003C 0.15)",{"type":44,"tag":53,"props":4712,"children":4713},{},[4714],{"type":50,"value":4715},"Increase epochs (30-50), ensure 500+ images, check per-class mAP for imbalanced classes, try different learning rates (1e-5 to 1e-4), increase image size.",{"type":44,"tag":53,"props":4717,"children":4718},{},[4719,4721],{"type":50,"value":4720},"For comprehensive troubleshooting: see ",{"type":44,"tag":283,"props":4722,"children":4724},{"href":4723},"references\u002Freliability_principles.md",[4725],{"type":50,"value":4723},{"type":44,"tag":59,"props":4727,"children":4729},{"id":4728},"reference-files",[4730],{"type":50,"value":4731},"Reference files",{"type":44,"tag":71,"props":4733,"children":4734},{},[4735,4744,4753,4762,4771,4780,4790,4800,4809,4818,4828],{"type":44,"tag":75,"props":4736,"children":4737},{},[4738,4742],{"type":44,"tag":283,"props":4739,"children":4740},{"href":1058},[4741],{"type":50,"value":1058},{"type":50,"value":4743}," — Production-ready object detection training script",{"type":44,"tag":75,"props":4745,"children":4746},{},[4747,4751],{"type":44,"tag":283,"props":4748,"children":4749},{"href":1458},[4750],{"type":50,"value":1458},{"type":50,"value":4752}," — Production-ready image classification training script (supports timm models)",{"type":44,"tag":75,"props":4754,"children":4755},{},[4756,4760],{"type":44,"tag":283,"props":4757,"children":4758},{"href":1465},[4759],{"type":50,"value":1465},{"type":50,"value":4761}," — Production-ready SAM\u002FSAM2 segmentation training script (bbox & point prompts)",{"type":44,"tag":75,"props":4763,"children":4764},{},[4765,4769],{"type":44,"tag":283,"props":4766,"children":4767},{"href":4566},[4768],{"type":50,"value":4566},{"type":50,"value":4770}," — Validate dataset format for OD, classification, and SAM segmentation",{"type":44,"tag":75,"props":4772,"children":4773},{},[4774,4778],{"type":44,"tag":283,"props":4775,"children":4776},{"href":3213},[4777],{"type":50,"value":3213},{"type":50,"value":4779}," — Estimate training costs for any vision model (includes SAM\u002FSAM2)",{"type":44,"tag":75,"props":4781,"children":4782},{},[4783,4788],{"type":44,"tag":283,"props":4784,"children":4786},{"href":4785},"references\u002Fobject_detection_training_notebook.md",[4787],{"type":50,"value":4785},{"type":50,"value":4789}," — Object detection training workflow, augmentation strategies, and training patterns",{"type":44,"tag":75,"props":4791,"children":4792},{},[4793,4798],{"type":44,"tag":283,"props":4794,"children":4796},{"href":4795},"references\u002Fimage_classification_training_notebook.md",[4797],{"type":50,"value":4795},{"type":50,"value":4799}," — Image classification training workflow with ViT, preprocessing, and evaluation",{"type":44,"tag":75,"props":4801,"children":4802},{},[4803,4807],{"type":44,"tag":283,"props":4804,"children":4805},{"href":1495},[4806],{"type":50,"value":1495},{"type":50,"value":4808}," — SAM2 fine-tuning walkthrough with MicroMat dataset, DiceCE loss, and Trainer integration",{"type":44,"tag":75,"props":4810,"children":4811},{},[4812,4816],{"type":44,"tag":283,"props":4813,"children":4814},{"href":1488},[4815],{"type":50,"value":1488},{"type":50,"value":4817}," — Using timm models with HF Trainer (TimmWrapper, transforms, full example)",{"type":44,"tag":75,"props":4819,"children":4820},{},[4821,4826],{"type":44,"tag":283,"props":4822,"children":4824},{"href":4823},"references\u002Fhub_saving.md",[4825],{"type":50,"value":4823},{"type":50,"value":4827}," — Detailed Hub persistence guide and verification checklist",{"type":44,"tag":75,"props":4829,"children":4830},{},[4831,4835],{"type":44,"tag":283,"props":4832,"children":4833},{"href":4723},[4834],{"type":50,"value":4723},{"type":50,"value":4836}," — Failure prevention principles from production experience",{"type":44,"tag":59,"props":4838,"children":4840},{"id":4839},"external-links",[4841],{"type":50,"value":4842},"External links",{"type":44,"tag":71,"props":4844,"children":4845},{},[4846,4856,4866,4876,4886,4898,4910,4922,4932,4942,4952,4962,4972],{"type":44,"tag":75,"props":4847,"children":4848},{},[4849],{"type":44,"tag":283,"props":4850,"children":4853},{"href":4851,"rel":4852},"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Ftasks\u002Fobject_detection",[287],[4854],{"type":50,"value":4855},"Transformers Object Detection Guide",{"type":44,"tag":75,"props":4857,"children":4858},{},[4859],{"type":44,"tag":283,"props":4860,"children":4863},{"href":4861,"rel":4862},"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Ftasks\u002Fimage_classification",[287],[4864],{"type":50,"value":4865},"Transformers Image Classification Guide",{"type":44,"tag":75,"props":4867,"children":4868},{},[4869],{"type":44,"tag":283,"props":4870,"children":4873},{"href":4871,"rel":4872},"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fdetr",[287],[4874],{"type":50,"value":4875},"DETR Model Documentation",{"type":44,"tag":75,"props":4877,"children":4878},{},[4879],{"type":44,"tag":283,"props":4880,"children":4883},{"href":4881,"rel":4882},"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fvit",[287],[4884],{"type":50,"value":4885},"ViT Model Documentation",{"type":44,"tag":75,"props":4887,"children":4888},{},[4889,4896],{"type":44,"tag":283,"props":4890,"children":4893},{"href":4891,"rel":4892},"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Fhuggingface_hub\u002Fguides\u002Fjobs",[287],[4894],{"type":50,"value":4895},"HF Jobs Guide",{"type":50,"value":4897}," — Main Jobs documentation",{"type":44,"tag":75,"props":4899,"children":4900},{},[4901,4908],{"type":44,"tag":283,"props":4902,"children":4905},{"href":4903,"rel":4904},"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Fhub\u002Fen\u002Fjobs-configuration",[287],[4906],{"type":50,"value":4907},"HF Jobs Configuration",{"type":50,"value":4909}," — Hardware, secrets, timeouts, namespaces",{"type":44,"tag":75,"props":4911,"children":4912},{},[4913,4920],{"type":44,"tag":283,"props":4914,"children":4917},{"href":4915,"rel":4916},"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Fhuggingface_hub\u002Fguides\u002Fcli#hf-jobs",[287],[4918],{"type":50,"value":4919},"HF Jobs CLI Reference",{"type":50,"value":4921}," — Command line interface",{"type":44,"tag":75,"props":4923,"children":4924},{},[4925],{"type":44,"tag":283,"props":4926,"children":4929},{"href":4927,"rel":4928},"https:\u002F\u002Fhuggingface.co\u002Fmodels?pipeline_tag=object-detection",[287],[4930],{"type":50,"value":4931},"Object Detection Models",{"type":44,"tag":75,"props":4933,"children":4934},{},[4935],{"type":44,"tag":283,"props":4936,"children":4939},{"href":4937,"rel":4938},"https:\u002F\u002Fhuggingface.co\u002Fmodels?pipeline_tag=image-classification",[287],[4940],{"type":50,"value":4941},"Image Classification Models",{"type":44,"tag":75,"props":4943,"children":4944},{},[4945],{"type":44,"tag":283,"props":4946,"children":4949},{"href":4947,"rel":4948},"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fsam2",[287],[4950],{"type":50,"value":4951},"SAM2 Model Documentation",{"type":44,"tag":75,"props":4953,"children":4954},{},[4955],{"type":44,"tag":283,"props":4956,"children":4959},{"href":4957,"rel":4958},"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fsam",[287],[4960],{"type":50,"value":4961},"SAM Model Documentation",{"type":44,"tag":75,"props":4963,"children":4964},{},[4965],{"type":44,"tag":283,"props":4966,"children":4969},{"href":4967,"rel":4968},"https:\u002F\u002Fhuggingface.co\u002Fdatasets?task_categories=task_categories:object-detection",[287],[4970],{"type":50,"value":4971},"Object Detection Datasets",{"type":44,"tag":75,"props":4973,"children":4974},{},[4975],{"type":44,"tag":283,"props":4976,"children":4979},{"href":4977,"rel":4978},"https:\u002F\u002Fhuggingface.co\u002Fdatasets?task_categories=task_categories:image-classification",[287],[4980],{"type":50,"value":4981},"Image Classification Datasets",{"type":44,"tag":4983,"props":4984,"children":4985},"style",{},[4986],{"type":50,"value":4987},"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":4989,"total":5158},[4990,5008,5022,5037,5051,5064,5077,5092,5106,5116,5129,5143],{"slug":4991,"name":4991,"fn":4992,"description":4993,"org":4994,"tags":4995,"stars":5005,"repoUrl":5006,"updatedAt":5007},"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},[4996,4997,4998,5001,5002],{"name":16,"slug":17,"type":14},{"name":9,"slug":13,"type":14},{"name":4999,"slug":5000,"type":14},"LLM","llm",{"name":19,"slug":20,"type":14},{"name":5003,"slug":5004,"type":14},"Search","search",18914,"https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fsentence-transformers","2026-05-08T05:09:16.820066",{"slug":5009,"name":5009,"fn":5010,"description":5011,"org":5012,"tags":5013,"stars":5019,"repoUrl":5020,"updatedAt":5021},"trl-training","train and fine-tune LLMs with TRL","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},[5014,5015,5016,5017,5018],{"name":22,"slug":23,"type":14},{"name":16,"slug":17,"type":14},{"name":9,"slug":13,"type":14},{"name":4999,"slug":5000,"type":14},{"name":19,"slug":20,"type":14},18850,"https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftrl","2026-04-06T18:25:32.746828",{"slug":5023,"name":5023,"fn":5024,"description":5025,"org":5026,"tags":5027,"stars":27,"repoUrl":28,"updatedAt":5036},"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},[5028,5031,5034,5035],{"name":5029,"slug":5030,"type":14},"CLI","cli",{"name":5032,"slug":5033,"type":14},"Datasets","datasets",{"name":9,"slug":13,"type":14},{"name":4999,"slug":5000,"type":14},"2026-04-06T18:25:34.020855",{"slug":5038,"name":5038,"fn":5039,"description":5040,"org":5041,"tags":5042,"stars":27,"repoUrl":28,"updatedAt":5050},"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},[5043,5046,5047],{"name":5044,"slug":5045,"type":14},"AWS","aws",{"name":5029,"slug":5030,"type":14},{"name":5048,"slug":5049,"type":14},"Configuration","configuration","2026-07-08T05:55:33.716099",{"slug":5052,"name":5052,"fn":5053,"description":5054,"org":5055,"tags":5056,"stars":27,"repoUrl":28,"updatedAt":5063},"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},[5057,5058,5059,5062],{"name":22,"slug":23,"type":14},{"name":5044,"slug":5045,"type":14},{"name":5060,"slug":5061,"type":14},"Engineering","engineering",{"name":19,"slug":20,"type":14},"2026-07-08T05:55:32.505017",{"slug":5065,"name":5065,"fn":5066,"description":5067,"org":5068,"tags":5069,"stars":27,"repoUrl":28,"updatedAt":5076},"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},[5070,5071,5072,5075],{"name":22,"slug":23,"type":14},{"name":5044,"slug":5045,"type":14},{"name":5073,"slug":5074,"type":14},"Deployment","deployment",{"name":9,"slug":13,"type":14},"2026-07-08T05:55:37.387689",{"slug":5078,"name":5078,"fn":5079,"description":5080,"org":5081,"tags":5082,"stars":27,"repoUrl":28,"updatedAt":5091},"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},[5083,5084,5085,5088],{"name":22,"slug":23,"type":14},{"name":5044,"slug":5045,"type":14},{"name":5086,"slug":5087,"type":14},"Permissions","permissions",{"name":5089,"slug":5090,"type":14},"Security","security","2026-07-08T05:55:34.948771",{"slug":5093,"name":5093,"fn":5094,"description":5095,"org":5096,"tags":5097,"stars":27,"repoUrl":28,"updatedAt":5105},"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},[5098,5099,5100,5101,5102],{"name":22,"slug":23,"type":14},{"name":5044,"slug":5045,"type":14},{"name":5073,"slug":5074,"type":14},{"name":9,"slug":13,"type":14},{"name":5103,"slug":5104,"type":14},"Monitoring","monitoring","2026-07-08T05:55:38.664702",{"slug":5107,"name":5107,"fn":5108,"description":5109,"org":5110,"tags":5111,"stars":27,"repoUrl":28,"updatedAt":5115},"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},[5112,5113,5114],{"name":22,"slug":23,"type":14},{"name":5044,"slug":5045,"type":14},{"name":5073,"slug":5074,"type":14},"2026-07-08T05:55:36.173465",{"slug":5117,"name":5117,"fn":5118,"description":5119,"org":5120,"tags":5121,"stars":27,"repoUrl":28,"updatedAt":5128},"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},[5122,5123,5124,5125],{"name":5032,"slug":5033,"type":14},{"name":9,"slug":13,"type":14},{"name":4999,"slug":5000,"type":14},{"name":5126,"slug":5127,"type":14},"MCP","mcp","2026-04-06T18:25:50.364185",{"slug":5130,"name":5130,"fn":5131,"description":5132,"org":5133,"tags":5134,"stars":27,"repoUrl":28,"updatedAt":5142},"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},[5135,5136,5137,5138,5139],{"name":22,"slug":23,"type":14},{"name":5029,"slug":5030,"type":14},{"name":9,"slug":13,"type":14},{"name":4999,"slug":5000,"type":14},{"name":5140,"slug":5141,"type":14},"Performance","performance","2026-06-13T07:23:57.101435",{"slug":5144,"name":5144,"fn":5145,"description":5146,"org":5147,"tags":5148,"stars":27,"repoUrl":28,"updatedAt":5157},"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},[5149,5152,5153,5154],{"name":5150,"slug":5151,"type":14},"Analytics","analytics",{"name":9,"slug":13,"type":14},{"name":4999,"slug":5000,"type":14},{"name":5155,"slug":5156,"type":14},"Research","research","2026-04-24T05:09:45.870658",37,{"items":5160,"total":1353},[5161,5168,5174,5181,5188,5195,5203],{"slug":5023,"name":5023,"fn":5024,"description":5025,"org":5162,"tags":5163,"stars":27,"repoUrl":28,"updatedAt":5036},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5164,5165,5166,5167],{"name":5029,"slug":5030,"type":14},{"name":5032,"slug":5033,"type":14},{"name":9,"slug":13,"type":14},{"name":4999,"slug":5000,"type":14},{"slug":5038,"name":5038,"fn":5039,"description":5040,"org":5169,"tags":5170,"stars":27,"repoUrl":28,"updatedAt":5050},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5171,5172,5173],{"name":5044,"slug":5045,"type":14},{"name":5029,"slug":5030,"type":14},{"name":5048,"slug":5049,"type":14},{"slug":5052,"name":5052,"fn":5053,"description":5054,"org":5175,"tags":5176,"stars":27,"repoUrl":28,"updatedAt":5063},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5177,5178,5179,5180],{"name":22,"slug":23,"type":14},{"name":5044,"slug":5045,"type":14},{"name":5060,"slug":5061,"type":14},{"name":19,"slug":20,"type":14},{"slug":5065,"name":5065,"fn":5066,"description":5067,"org":5182,"tags":5183,"stars":27,"repoUrl":28,"updatedAt":5076},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5184,5185,5186,5187],{"name":22,"slug":23,"type":14},{"name":5044,"slug":5045,"type":14},{"name":5073,"slug":5074,"type":14},{"name":9,"slug":13,"type":14},{"slug":5078,"name":5078,"fn":5079,"description":5080,"org":5189,"tags":5190,"stars":27,"repoUrl":28,"updatedAt":5091},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5191,5192,5193,5194],{"name":22,"slug":23,"type":14},{"name":5044,"slug":5045,"type":14},{"name":5086,"slug":5087,"type":14},{"name":5089,"slug":5090,"type":14},{"slug":5093,"name":5093,"fn":5094,"description":5095,"org":5196,"tags":5197,"stars":27,"repoUrl":28,"updatedAt":5105},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5198,5199,5200,5201,5202],{"name":22,"slug":23,"type":14},{"name":5044,"slug":5045,"type":14},{"name":5073,"slug":5074,"type":14},{"name":9,"slug":13,"type":14},{"name":5103,"slug":5104,"type":14},{"slug":5107,"name":5107,"fn":5108,"description":5109,"org":5204,"tags":5205,"stars":27,"repoUrl":28,"updatedAt":5115},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[5206,5207,5208],{"name":22,"slug":23,"type":14},{"name":5044,"slug":5045,"type":14},{"name":5073,"slug":5074,"type":14}]