Make user_data configurable: add --user-data-dir flag, auto-detect ../user_data

If --user-data-dir is not set, auto-detect: use ../user_data when
./user_data doesn't exist, making it easy to share user data across
portable builds by placing it one folder up.
This commit is contained in:
oobabooga 2026-03-05 19:26:21 -08:00
parent 4c406e024f
commit e2548f69a9
21 changed files with 166 additions and 133 deletions

View file

@ -384,7 +384,7 @@ class LlamaServer:
if shared.args.mmproj not in [None, 'None']:
path = Path(shared.args.mmproj)
if not path.exists():
path = Path('user_data/mmproj') / shared.args.mmproj
path = shared.user_data_dir / 'mmproj' / shared.args.mmproj
if path.exists():
cmd += ["--mmproj", str(path)]