Skip to content

fix: address issues #4155, #6469, #6489, #5125 - #1

Merged
TheJagStudio merged 1 commit into
mainfrom
claude/unsloth-contributions-gv5iw0
Jun 21, 2026
Merged

TheJagStudio merged 1 commit into
mainfrom
claude/unsloth-contributions-gv5iw0

Conversation

@TheJagStudio

Copy link
Copy Markdown
Owner

Issue unslothai#4155 — DPO: add UnslothDPOConfig and update PatchDPOTrainer

  • unsloth/trainer.py: import trl.DPOConfig, expose UnslothDPOConfig
    subclass (falls back to TrainingArguments when trl<0.7); export via all
  • unsloth/models/dpo.py: replace no-op PatchDPOTrainer with a patch that
    monkey-patches DPOTrainer.init to emit a DeprecationWarning when legacy
    TrainingArguments is passed instead of DPOConfig; includes docstring example

Issue unslothai#6469 — Code block readability in Unsloth Studio UI

  • studio/frontend/src/index.css: add #f3f4f6 background + subtle border for
    fenced code blocks in light mode (dark mode keeps #181818); add
    padding-right to code-block-header so the language label is never obscured
    by the absolute-positioned copy/download action buttons; add matching inline
    code surface for spans

Issue #6489 — UnicodeEncodeError (charmap codec) on Windows

  • studio/backend/main.py: reconfigure sys.stdout/stderr to utf-8 with
    errors=replace at process start, before any print (Windows only)
  • studio/backend/startup_banner.py: introduce _safe_print() that falls back
    to encode/replace on UnicodeEncodeError; use it for all banner output
  • studio/backend/core/training/trainer.py: add encoding='utf-8' to both
    open() calls on adapter_config.json
  • unsloth_cli/commands/chat.py: add encoding='utf-8' to adapter_config open
  • unsloth_cli/commands/studio.py: pass PYTHONIOENCODING=utf-8:replace in the
    child-process environment when spawning the backend on Windows; also add
    encoding='utf-8' to the auth-secret fdopen call

Issue #5125 — Request permission before downloading model on first run

  • studio/backend/hub/schemas/downloads.py: add confirmed:bool=False field to
    DownloadModelRequest; add needs_confirmation:bool=False to DownloadStartResponse
  • studio/backend/hub/services/models/downloads.py: add _is_model_in_local_cache()
    helper that checks the HF cache; when confirmed=False and model is absent from
    cache, return state='confirmation_required' / needs_confirmation=True before
    spawning any download worker — the frontend can then show a dialog and
    re-POST with confirmed=True

Co-Authored-By: Claude Sonnet 4.6 [email protected]
Claude-Session: https://claude.ai/code/session_016EuHUXBUpgszgrjtjL7ghp

…nslothai#5125

Issue unslothai#4155 — DPO: add UnslothDPOConfig and update PatchDPOTrainer
- unsloth/trainer.py: import trl.DPOConfig, expose UnslothDPOConfig
  subclass (falls back to TrainingArguments when trl<0.7); export via __all__
- unsloth/models/dpo.py: replace no-op PatchDPOTrainer with a patch that
  monkey-patches DPOTrainer.__init__ to emit a DeprecationWarning when legacy
  TrainingArguments is passed instead of DPOConfig; includes docstring example

Issue unslothai#6469 — Code block readability in Unsloth Studio UI
- studio/frontend/src/index.css: add #f3f4f6 background + subtle border for
  fenced code blocks in light mode (dark mode keeps #181818); add
  padding-right to code-block-header so the language label is never obscured
  by the absolute-positioned copy/download action buttons; add matching inline
  code surface for <code> spans

Issue unslothai#6489 — UnicodeEncodeError (charmap codec) on Windows
- studio/backend/main.py: reconfigure sys.stdout/stderr to utf-8 with
  errors=replace at process start, before any print (Windows only)
- studio/backend/startup_banner.py: introduce _safe_print() that falls back
  to encode/replace on UnicodeEncodeError; use it for all banner output
- studio/backend/core/training/trainer.py: add encoding='utf-8' to both
  open() calls on adapter_config.json
- unsloth_cli/commands/chat.py: add encoding='utf-8' to adapter_config open
- unsloth_cli/commands/studio.py: pass PYTHONIOENCODING=utf-8:replace in the
  child-process environment when spawning the backend on Windows; also add
  encoding='utf-8' to the auth-secret fdopen call

Issue unslothai#5125 — Request permission before downloading model on first run
- studio/backend/hub/schemas/downloads.py: add confirmed:bool=False field to
  DownloadModelRequest; add needs_confirmation:bool=False to DownloadStartResponse
- studio/backend/hub/services/models/downloads.py: add _is_model_in_local_cache()
  helper that checks the HF cache; when confirmed=False and model is absent from
  cache, return state='confirmation_required' / needs_confirmation=True before
  spawning any download worker — the frontend can then show a dialog and
  re-POST with confirmed=True

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Claude-Session: https://claude.ai/code/session_016EuHUXBUpgszgrjtjL7ghp
Copilot AI review requested due to automatic review settings June 21, 2026 14:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@TheJagStudio
TheJagStudio merged commit cda3368 into main Jun 21, 2026
@TheJagStudio
TheJagStudio deleted the claude/unsloth-contributions-gv5iw0 branch June 21, 2026 14:03
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.

3 participants