This repository was archived by the owner on Jul 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 180
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
chore: Retrieve engine
from DB instead of model.yml
#2167
Copy link
Copy link
Open
Description
Problem Statement
A lot of code does the following
- Get model entry from DB
- Get path to model.yml. Read model.yml to obtain
engine
value
e.g.
cortex.cpp/engine/controllers/models.cc
Lines 292 to 297 in b31878d
yaml_handler.ModelConfigFromFile( | |
fmu::ToAbsoluteCortexDataPath( | |
fs::path(model_entry.value().path_to_model_yaml)) | |
.string()); | |
auto model_config = yaml_handler.GetModelConfig(); | |
if (model_config.engine == kLlamaEngine) { |
cortex.cpp/engine/services/model_service.cc
Lines 495 to 499 in b31878d
auto yaml_fp = fmu::ToAbsoluteCortexDataPath( | |
fs::path(model_entry.value().path_to_model_yaml)); | |
yaml_handler.ModelConfigFromFile(yaml_fp.string()); | |
auto mc = yaml_handler.GetModelConfig(); | |
if (engine_svc_->IsRemoteEngine(mc.engine)) { |
This is unnecessary because the DB already has column engine
We must make sure the column engine
is registered correctly e.g. Currently downloading single GGUF file does not fill in column engine
cortex.cpp/engine/services/model_service.cc
Lines 75 to 85 in b31878d
cortex::db::ModelEntry model_entry{ | |
/* .model = */ ggufDownloadItem.id, | |
/* .author_repo_id = */ author_id, | |
/* .branch_name = */ branch, | |
/* .path_to_model_yaml = */ rel.string(), | |
/* .model_alias = */ ggufDownloadItem.id, | |
"", | |
"", | |
/* .status = */ cortex::db::ModelStatus::Downloaded, | |
"", | |
""}; |
This is also a prerequisite for #2151
Feature Idea
See above
Metadata
Metadata
Assignees
Labels
No labels