Skip to content

chore: Retrieve engine from DB instead of model.yml #2167

Open
@gau-nernst

Description

@gau-nernst

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.

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) {

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::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
No labels

Type

No type

Projects

Status

Investigating

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions