Skip to content

Studio: use one shared Hugging Face token across Settings and training - #7152

Merged
oobabooga merged 4 commits into
unslothai:mainfrom
NilayYadav:unify-hf-token
Jul 16, 2026
Merged

oobabooga merged 4 commits into
unslothai:mainfrom
NilayYadav:unify-hf-token

Conversation

@NilayYadav

Copy link
Copy Markdown
Collaborator

The token in Settings and the "Hugging Face Token (Optional)" field in Studio were stored separately and never synced. Setting a token in Settings didn't work for training gated models users had to paste it twice.

Fix

  • Both fields now read/write the same token; editing one updates the other (chat and Hub too).
  • Existing Studio-only tokens are migrated automatically.
  • The "invalid or expired token" error now shows only under the token field, not under the dataset search.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request centralizes the management of the Hugging Face token (hfToken) by migrating it to a shared store (useHfTokenStore). The chat runtime and training config stores have been updated to mirror this shared state, and a migration path (version 12) has been added to transition legacy persisted tokens. Additionally, local token validation has been removed from the dataset section. I have no feedback to provide as there are no review comments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@oobabooga

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 0f0617ae05

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@oobabooga

Copy link
Copy Markdown
Member

@NilayYadav your change unifies the Settings and training Hugging Face token onto the shared store. I drove the real Studio UI to confirm it. A token set in either place now shows up in the other, a legacy Studio-only token migrates into the shared store with the persisted config bumped to v12 and the old field dropped, and the invalid-token error renders once under the token field instead of also under the dataset search.

I pushed one follow-up. It folds the duplicated mirror subscription into a shared helper, makes the Settings-path setHfToken delegate to the shared store like training already does, and drops the now-dead token-changed event bridge. I rebuilt and reran the same UI flows green, including Settings now normalizing quoted and whitespace-padded tokens the way the Studio field did, plus a clean tsc. Thanks @NilayYadav. Merging.

@oobabooga
oobabooga merged commit 8c83478 into unslothai:main Jul 16, 2026
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants