Skip to content

Commit

Permalink
fix: add n_ubatch to params (#30)
Browse files Browse the repository at this point in the history
Co-authored-by: vansangpfiev <[email protected]>
  • Loading branch information
vansangpfiev and sangjanai authored May 20, 2024
1 parent a7a04cc commit bf485f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/llama_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ bool LlamaEngine::LoadModelImpl(std::shared_ptr<Json::Value> jsonBody) {
model_type = jsonBody->get("model_type", "llm").asString();
// Check if n_parallel exists in jsonBody, if not, set to drogon_thread
params.n_batch = jsonBody->get("n_batch", 512).asInt();
params.n_ubatch = jsonBody->get("n_ubatch", params.n_batch).asInt();
params.n_parallel = jsonBody->get("n_parallel", 1).asInt();
params.n_threads =
jsonBody->get("cpu_threads", std::thread::hardware_concurrency())
Expand Down Expand Up @@ -710,8 +711,8 @@ bool LlamaEngine::CheckModelLoaded(
if (auto si = server_map_.find(model_id);
si == server_map_.end() || !si->second.ctx.model_loaded_external) {
LOG_WARN << "Error: model_id: " << model_id
<< ", existed: " << (si != server_map_.end())
<< ", loaded: " << false;
<< ", existed: " << (si != server_map_.end())
<< ", loaded: " << false;
Json::Value jsonResp;
jsonResp["message"] =
"Model has not been loaded, please load model into nitro";
Expand Down

0 comments on commit bf485f2

Please sign in to comment.