Skip to content

Commit

Permalink
chore: update model's size on import
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-menlo committed Nov 4, 2024
1 parent 55bbe0d commit 10ce225
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions engine/controllers/models.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "database/models.h"
#include <drogon/HttpTypes.h>
#include <cstdint>
#include <filesystem>
#include <optional>
#include "config/gguf_parser.h"
Expand Down Expand Up @@ -351,8 +352,12 @@ void Models::ImportModel(
modelPath, file_path,
std::filesystem::copy_options::update_existing);
model_config.files.push_back(file_path.string());
auto size = std::filesystem::file_size(file_path);
model_config.size = size;
} else {
model_config.files.push_back(modelPath);
auto size = std::filesystem::file_size(modelPath);
model_config.size = size;
}
model_config.model = modelHandle;
model_config.name = modelName.empty() ? model_config.name : modelName;
Expand Down
1 change: 0 additions & 1 deletion engine/services/download_service.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include "download_service.h"
#include <curl/curl.h>
#include <httplib.h>
#include <stdio.h>
Expand Down

0 comments on commit 10ce225

Please sign in to comment.