Skip to content

Commit a60347f

Browse files
committed
escape paths in command
1 parent 3c84208 commit a60347f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/LLM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ LLMProvider::~LLMProvider() {}
4545

4646
std::string LLM::LLM_args_to_command(const std::string &model_path, int num_slots, int num_threads, int num_GPU_layers, bool flash_attention, int context_size, int batch_size, bool embedding_only, const std::vector<std::string> &lora_paths)
4747
{
48-
std::string command = "-m " + model_path +
48+
std::string command = "-m \"" + model_path + "\"" +
4949
" -t " + std::to_string(num_threads) +
5050
" -np " + std::to_string(num_slots) +
5151
" -c " + std::to_string(context_size) +
@@ -58,7 +58,7 @@ std::string LLM::LLM_args_to_command(const std::string &model_path, int num_slot
5858
if (embedding_only)
5959
command += " --embedding";
6060
for (const auto &lora_path : lora_paths)
61-
command += " --lora " + lora_path;
61+
command += " --lora \"" + lora_path + "\"";
6262
return command;
6363
}
6464

0 commit comments

Comments
 (0)