diff --git a/examples/common/common.hpp b/examples/common/common.hpp index 558817eea..0ab5c08a4 100644 --- a/examples/common/common.hpp +++ b/examples/common/common.hpp @@ -1349,6 +1349,9 @@ struct SDGenerationParams { } void extract_and_remove_lora(const std::string& lora_model_dir) { + if (lora_model_dir.empty()) { + return; + } static const std::regex re(R"(]+):([^>]+)>)"); static const std::vector valid_ext = {".pt", ".safetensors", ".gguf"}; std::smatch m; diff --git a/examples/server/main.cpp b/examples/server/main.cpp index 90cf484b9..f1ba0cd14 100644 --- a/examples/server/main.cpp +++ b/examples/server/main.cpp @@ -425,7 +425,7 @@ int main(int argc, const char** argv) { return; } - if (!gen_params.process_and_check(IMG_GEN, ctx_params.lora_model_dir)) { + if (!gen_params.process_and_check(IMG_GEN, "")) { res.status = 400; res.set_content(R"({"error":"invalid params"})", "application/json"); return; @@ -605,7 +605,7 @@ int main(int argc, const char** argv) { return; } - if (!gen_params.process_and_check(IMG_GEN, ctx_params.lora_model_dir)) { + if (!gen_params.process_and_check(IMG_GEN, "")) { res.status = 400; res.set_content(R"({"error":"invalid params"})", "application/json"); return;