only set model memory_mb if not previously calculated

This commit is contained in:
Ruben Ortlam 2026-03-31 17:37:16 +02:00
parent 24f461b66d
commit d2892543f4
1 changed files with 6 additions and 2 deletions

View File

@ -590,8 +590,12 @@ void server_models::load(const std::string & name) {
if (base_params.models_memory_max > 0) {
std::lock_guard<std::mutex> lk(mutex);
auto & meta = mapping[name].meta;
new_model_memory_mb = get_model_memory_mb(meta.preset);
meta.memory_mb = new_model_memory_mb;
if (meta.memory_mb > 0) {
new_model_memory_mb = meta.memory_mb;
} else {
new_model_memory_mb = get_model_memory_mb(meta.preset);
meta.memory_mb = new_model_memory_mb;
}
if (new_model_memory_mb > 0) {
SRV_INF("model %s memory requirements: %lu MB\n", name.c_str(),
(unsigned long)new_model_memory_mb);