Repository navigation
fix: avoid scanning cwd during server startup - #2086
Conversation
leejet
left a comment
There was a problem hiding this comment.
SDContextParams is shared by sd-server and sd-cli. Changing lora_model_dir from "." to an empty string also causes CLI generation to skip extract_and_remove_lora() when --lora-model-dir is omitted.
For example, sd-cli -m model.safetensors -p "a cat <lora:foo:1>" previously loaded foo.safetensors from the working directory. With this change, the LoRA is silently ignored and the tag remains in the prompt. This also contradicts the documented default in docs/lora.md.
Could we preserve "." in the shared parameters and clear it only during server initialization, before parsing command-line arguments? That would avoid the default server scan without breaking existing CLI usage.
|
Thank you for your contribution. |
Summary
Keep the shared
SDContextParams::lora_model_dirdefault as.sosd-clicontinues resolving prompt LoRA tags from its current working directory.sd-serverclears that default before parsing command-line arguments, preventing a recursive scan of its working directory unless--lora-model-diris explicitly supplied.--lora-model-dirvalue.Issue: #2081
Fixes #2081
Verification
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DSD_WEBP=OFF -DSD_WEBM=OFF -DSD_SERVER_BUILD_FRONTEND=OFF -DGGML_NATIVE=OFFcmake --build build --config Release --parallel 2ctest --test-dir build --output-on-failure(no tests are registered in this repository)build/bin/sd-server --helpbuild/bin/sd-cli --helpclang-format --dry-run --Werror -style=file examples/common/common.h examples/server/main.cpp