Skip to content

Commit

Permalink
fix: add permission
Browse files Browse the repository at this point in the history
  • Loading branch information
sangjanai committed Feb 5, 2025
1 parent 565cb58 commit 4a0e548
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/llama_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,21 @@ bool LlamaEngine::SpawnLlamaServer(const Json::Value& json_params) {
// Some engines requires to add lib search path before process being created
std::string exe = "llama-server";
std::string p = (load_opt_.engine_path / exe).string();
if (std::filesystem::exists(p)) {
try {
std::filesystem::permissions(p,
std::filesystem::perms::owner_exec |
std::filesystem::perms::group_exec |
std::filesystem::perms::others_exec,
std::filesystem::perm_options::add);
} catch (const std::filesystem::filesystem_error& e) {
LOG_WARN << "Error: " << e.what();
}
} else {
LOG_ERROR << "llama-server does not exist";
return false;
}

std::vector<std::string> params = ConvertJsonToParamsVector(json_params);
params.push_back("--host");
params.push_back(s.host);
Expand Down

0 comments on commit 4a0e548

Please sign in to comment.