Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 10ce225

Browse files
committed
chore: update model's size on import
1 parent 55bbe0d commit 10ce225

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

engine/controllers/models.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "database/models.h"
22
#include <drogon/HttpTypes.h>
3+
#include <cstdint>
34
#include <filesystem>
45
#include <optional>
56
#include "config/gguf_parser.h"
@@ -351,8 +352,12 @@ void Models::ImportModel(
351352
modelPath, file_path,
352353
std::filesystem::copy_options::update_existing);
353354
model_config.files.push_back(file_path.string());
355+
auto size = std::filesystem::file_size(file_path);
356+
model_config.size = size;
354357
} else {
355358
model_config.files.push_back(modelPath);
359+
auto size = std::filesystem::file_size(modelPath);
360+
model_config.size = size;
356361
}
357362
model_config.model = modelHandle;
358363
model_config.name = modelName.empty() ? model_config.name : modelName;

engine/services/download_service.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#include "download_service.h"
21
#include <curl/curl.h>
32
#include <httplib.h>
43
#include <stdio.h>

0 commit comments

Comments
 (0)