Skip to content

huggingface-llm-trainer: Approach 4 example drops required push_to_hub configuration #173

Description

@specterslient95-lgtm

The skills/huggingface-llm-trainer/SKILL.md Hub-push section states:

EPHEMERAL ENVIRONMENT—MUST PUSH TO HUB. The Jobs environment is temporary. All files are deleted when the job ends. If the model isn't pushed to Hub, ALL TRAINING IS LOST.

with required configuration:

  • push_to_hub=True
  • hub_model_id="username/model-name"
  • secrets={"HF_TOKEN": "$HF_TOKEN"} in the job submission

Approaches 1 (UV Scripts), 2 (TRL Maintained Scripts), and 3 (HF Jobs CLI) each show both halves of this contract in their examples.

Approach 4 (TRL Jobs Package) does not:

uvx trl-jobs sft \
  --model_name Qwen/Qwen2.5-0.5B \
  --dataset_name trl-lib/Capybara

There is no --push-to-hub, no --hub-model-id, and no HF_TOKEN surfaced. The text claims "automatic Hub push", but trl-jobs actually pushes only when the user has previously run huggingface-cli login on the host so a token is on disk. A user who copy-pastes the Approach 4 one-liner without first running huggingface-cli login will lose all training (no upload, ephemeral filesystem wiped).

The other three approaches don't have this implicit precondition; Approach 4 silently does.

Suggested fix

Either:

(a) Make the Approach 4 example consistent with 1-3 by adding the flags explicitly:

HF_TOKEN=hf_xxx uvx trl-jobs sft \
  --model_name Qwen/Qwen2.5-0.5B \
  --dataset_name trl-lib/Capybara \
  --push-to-hub username/model-name

OR

(b) Inline the precondition for this approach: "Approach 4 requires that you have previously run huggingface-cli login on this machine; the on-disk token replaces the per-job secrets={\"HF_TOKEN\": \"\$HF_TOKEN\"} contract shown for Approaches 1-3."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions