Skip to content

Studio: duplicate a past training run into a new Configure draft - #12979

Merged
Etherll merged 2 commits into
unslothai:mainfrom
Padi142:studio-duplicate-training-run
Oct 8, 2026
Merged

Etherll merged 2 commits into
unslothai:mainfrom
Padi142:studio-duplicate-training-run

Conversation

@Padi142

@Padi142 Padi142 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #12977.

Adds a Duplicate action for past training runs in Unsloth Studio. It loads the run's saved config into a fresh Configure draft and switches to the Configure tab. It never starts training, so the user can review and edit before pressing Start Training.

Entry points:

  • The run's ⋮ menu in the sidebar Recents, next to Rename and Delete
  • The Training Config popover in the training progress view, for current and historical runs

Screenshots

Sidebar run menu Training Config popover
sidebar-run-menu-duplicate-hover run-config-popover-duplicate

What is copied, and what is not

  • Copied: the model (including local path, subfolder and format), training method, dataset source (Hugging Face, uploaded files, or S3 bucket/region/prefix), subset, splits, slice, format, column mapping, system prompt, label mapping, and the hyperparameters and LoRA settings.
  • Not copied:
    • Credentials. The backend's _sanitize_db_config already strips HF/W&B tokens and S3 keys, and the draft clears the W&B token.
    • Remote-code approval (trust_remote_code and its fingerprint).
    • Output and TensorBoard directories, and resume-from-checkpoint.

Duplicating replaces the current Configure draft.

🤖 Notice: Made with Claude and Astra but I kept an eye on them

@Etherll

Etherll commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Duplicate is available from the Recents run menu and from the Training config popover of a past run. It loads that run's saved settings into a fresh Configure draft and switches to Configure without starting training.

Checked against a seeded finished run on the merge base 660bcbad9 and the PR head 43801d040. On the base, the menu has only Rename and Delete. On the head, Duplicate restores the model, dataset, split, method, steps, batch, context length, learning rate, project name and system prompt. The saved remote-code approval is not carried over, and no training request is sent. The keyboard path through the menu works as well. The same flow passes in Chrome 147 and Edge 151, and the frontend suite (10,940 tests) and typecheck pass.

Optional, not blocking: app-sidebar.tsx and progress-section.tsx import the hook from @/features/training/hooks/use-duplicate-training-run, which trips the repo's no-restricted-imports rule. Exporting it from @/features/training, like the other training hooks, would fix that.

Limits: Studio ran CPU-only with the Train view enabled through a stubbed capability flag. Windows and macOS were not run natively.

Fork CI is still running: Etherll#186

Before and after: the Recents run menu, the Training config popover, and the Configure draft after Duplicate
Before: merge base 660bcbad9. After: PR head 43801d040. Same seeded run on both sides.

@Padi142

Padi142 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Yay

Adds a Duplicate action to the sidebar run menu and the training config
popover. It loads the run's saved config into a fresh Configure draft and
switches to the Configure tab without starting training. Credentials,
remote-code approval, output paths and resume state are not copied.

Closes unslothai#12977
The sidebar and progress section imported the hook by its internal path,
which the no-restricted-imports rule rejects. Export it from
@/features/training like the other training hooks.
@Padi142
Padi142 force-pushed the studio-duplicate-training-run branch from bcc14e5 to 75eb68e Compare October 8, 2026 09:07
@Padi142

Padi142 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Sorry I was removing the Co authored by claude 😭

@Etherll

Etherll commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

LGTM! Thanks for the PR !

@Etherll
Etherll merged commit f51a3ff into unslothai:main Oct 8, 2026
danielhanchen added a commit that referenced this pull request Oct 10, 2026
…'s token after #13005 (#13022)

* Hub token identity tests: let the llama-backend stub take the token #12979 now passes

#12979 (184e1fc) made `_llama_backend_active(model, token)` so the embedding resolver
can gate the llama-server path on the caller's Hub token, and `_resolve_embedding_model_plan`
now calls it with both. The two stub tables in `test_hub_token_caller_identity.py` still
hand it a one-argument lambda, so every test built on `_st_resolver` / `_gguf_resolver`
fails with `TypeError: <lambda>() takes 1 positional argument but 2 were given`: seven
cases, red on Backend CI `(Python 3.13, a-k)` for 184e1fc and 04013e9.

The stubs now accept the token and ignore it, which is what they did with the model.
`tests/test_hub_token_caller_identity.py`: 197 passed.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_012DRiTpjxAymRtv9p8Xr2kd

* Pin that the embedding resolver asks the backend probe with the caller's token

#13005 made _resolve_embedding_model_plan pass the caller's Hub token to
_llama_backend_active, because whether llama-server or sentence-transformers
serves a private repo depends on files only that token can read. The stubs
fixed above made the suite pass again but nothing checked the token still
arrives; this test fails if the resolver drops it.

* Shorten the new test's docstring

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
Co-authored-by: Daniel Han <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Unsloth Studio: Make it easy to duplicate a past training run into a new Configure draft

3 participants