Skip to content

configure script needs to resolve config dir properly like webui does#2745

Merged
bghira merged 1 commit into
mainfrom
bugfix/cli-configure-dir-resolver
Jun 7, 2026
Merged

configure script needs to resolve config dir properly like webui does#2745
bghira merged 1 commit into
mainfrom
bugfix/cli-configure-dir-resolver

Conversation

@bghira
Copy link
Copy Markdown
Owner

@bghira bghira commented Jun 5, 2026

This pull request updates how the default configuration save path is determined in the simpletuner/configure.py file. The change ensures that configurations saved from the CLI are stored in the same directory as the WebUI expects, improving compatibility, especially when running in Docker or mounted environments.

Configuration path logic update:

  • The _save_config method now determines the default configuration directory by using ConfigStore(config_type="model").config_dir, ensuring consistency with the WebUI's configuration API and Docker mount points.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns the CLI configurator’s default “save config” location with the directory resolution used by the WebUI, so configs saved via simpletuner/configure.py end up where the WebUI expects (especially in Docker/mounted setups).

Changes:

  • Updates _save_config to derive the default config save directory from the WebUI/server-side configuration directory logic (via ConfigStore(...).config_dir).
  • Switches the default save target from a relative config/config.json to <resolved-config-dir>/config.json.
  • Adds explanatory comments and uses a lazy import to reduce circular-import risk.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread simpletuner/configure.py
Comment on lines +2654 to +2661
# Default to the same directory the WebUI's config API resolves to
# (SIMPLETUNER_CONFIG_DIR -> onboarding configs_dir -> <root>/config) so a
# config saved here is visible to the WebUI, including Docker /workspace mounts.
# Imported lazily: config_store imports from this module at load time.
from simpletuner.simpletuner_sdk.server.services.config_store import ConfigStore

default_dir = ConfigStore(config_type="model").config_dir
default_path = self.state.loaded_config_path or str(default_dir / "config.json")
@bghira bghira merged commit 1614399 into main Jun 7, 2026
3 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