configure script needs to resolve config dir properly like webui does#2745
Merged
Conversation
Contributor
There was a problem hiding this comment.
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_configto derive the default config save directory from the WebUI/server-side configuration directory logic (viaConfigStore(...).config_dir). - Switches the default save target from a relative
config/config.jsonto<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 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates how the default configuration save path is determined in the
simpletuner/configure.pyfile. 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:
_save_configmethod now determines the default configuration directory by usingConfigStore(config_type="model").config_dir, ensuring consistency with the WebUI's configuration API and Docker mount points.