🌐 AI搜索 & 代理 主页
Skip to content

Commit 15d0f82

Browse files
authored
feat(server): do not parse lora fromt client-side prompts (#1083)
1 parent 6888fcb commit 15d0f82

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

examples/common/common.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,9 @@ struct SDGenerationParams {
13491349
}
13501350

13511351
void extract_and_remove_lora(const std::string& lora_model_dir) {
1352+
if (lora_model_dir.empty()) {
1353+
return;
1354+
}
13521355
static const std::regex re(R"(<lora:([^:>]+):([^>]+)>)");
13531356
static const std::vector<std::string> valid_ext = {".pt", ".safetensors", ".gguf"};
13541357
std::smatch m;

examples/server/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ int main(int argc, const char** argv) {
425425
return;
426426
}
427427

428-
if (!gen_params.process_and_check(IMG_GEN, ctx_params.lora_model_dir)) {
428+
if (!gen_params.process_and_check(IMG_GEN, "")) {
429429
res.status = 400;
430430
res.set_content(R"({"error":"invalid params"})", "application/json");
431431
return;
@@ -605,7 +605,7 @@ int main(int argc, const char** argv) {
605605
return;
606606
}
607607

608-
if (!gen_params.process_and_check(IMG_GEN, ctx_params.lora_model_dir)) {
608+
if (!gen_params.process_and_check(IMG_GEN, "")) {
609609
res.status = 400;
610610
res.set_content(R"({"error":"invalid params"})", "application/json");
611611
return;

0 commit comments

Comments
 (0)