docs(sampling): clarify that sampler override presets resolve from the working directory (#419)#435
Open
Anai-Guo wants to merge 1 commit into
Open
Conversation
…e CWD (theroyallab#419) The sampler override preset name is turned into the relative path `sampler_overrides/<name>.yml`, so it is resolved against the process's current working directory rather than the TabbyAPI install directory. Nothing said that, and the "Make sure it's located in the sampler_overrides folder" error did not say which sampler_overrides folder was searched, so launching TabbyAPI from another directory looked like a missing-file bug. - Hoist the lookup directory into a documented SAMPLER_OVERRIDES_DIR constant shared by overrides_from_file() and get_all_presets(). - Report the resolved path and the current working directory in the not-found error. - Say in the docstrings, the config description, config_sample.yml, and the docs that the value is a preset name (not a path) resolved relative to the launch directory. No behaviour change.
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.
Fixes #419.
Problem
sampler_override/override_presettakes a preset name, whichoverrides_from_file()turns into the relative pathsampler_overrides/<name>.yml. A relative path resolves against the process's current working directory, so the folder that actually gets searched is the one you launched TabbyAPI from — not the one next to the TabbyAPI source.Nothing in the docstrings, the config description,
config_sample.yml, or the docs said this, and the failure message did not help either:Which
sampler_overridesfolder? The one shipped in the repo has the preset in it, so from the user's side this reads as a bug rather than a working-directory mismatch (see #419 and turboderp-org/exllamav3#199).Change
No behaviour change — this is the "adjust the docstring to make it clear how the search happens" option from the issue.
SAMPLER_OVERRIDES_DIRconstant with a comment explaining the relative-path semantics, and use it from bothoverrides_from_file()andget_all_presets()(they previously spelled"sampler_overrides"out separately).override_presetconfig description,config_sample.yml, anddocs/02+docs/08that the value is a preset name rather than a path, resolved relative to the launch directory.While there, the config description and
config_sample.ymlboth said "sampler-overrides folder"; the folder issampler_overrides.The issue also floated dropping the name→path transformation and accepting a full path instead. I left that alone since it changes existing configs — happy to follow up if you'd prefer that direction.
Verification
ruff format --diffandruff checkclean with the pinnedruff == 0.11.10against the repo'spyproject.toml.🤖 Generated with Claude Code