From 4434391811345284b171546c1dfde01e773a11af Mon Sep 17 00:00:00 2001 From: Luke Nguyen Date: Wed, 13 Nov 2024 08:45:33 +0700 Subject: [PATCH 1/3] fix: incorrect mapper upload engines api --- engine/controllers/engines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/controllers/engines.h b/engine/controllers/engines.h index 4f6a1f6fa..dc9ef5a54 100644 --- a/engine/controllers/engines.h +++ b/engine/controllers/engines.h @@ -42,7 +42,7 @@ class Engines : public drogon::HttpController { Get); ADD_METHOD_TO(Engines::LoadEngine, "/v1/engines/{1}/load", Options, Post); - ADD_METHOD_TO(Engines::UnloadEngine, "/v1/engines/{1}/load", Options, Post); + ADD_METHOD_TO(Engines::UnloadEngine, "/v1/engines/{1}/load", Options, Delete); ADD_METHOD_TO(Engines::UpdateEngine, "/v1/engines/{1}/update", Options, Post); ADD_METHOD_TO(Engines::GetEngineVersions, "/v1/engines/{1}/versions", Get); ADD_METHOD_TO(Engines::GetEngineVariants, "/v1/engines/{1}/versions/{2}", From 187850ae6d2a50e9ec26f6b71f980278a33d0f5d Mon Sep 17 00:00:00 2001 From: Luke Nguyen Date: Wed, 13 Nov 2024 09:00:00 +0700 Subject: [PATCH 2/3] chore: disable unit tests due to model got removed --- .../test/components/test_huggingface_utils.cc | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/engine/test/components/test_huggingface_utils.cc b/engine/test/components/test_huggingface_utils.cc index afa3092a1..0c0adc8eb 100644 --- a/engine/test/components/test_huggingface_utils.cc +++ b/engine/test/components/test_huggingface_utils.cc @@ -16,28 +16,29 @@ TEST_F(HuggingFaceUtilTestSuite, TestGetModelRepositoryBranches) { EXPECT_EQ(branches.value()["gguf"].ref, "refs/heads/gguf"); } -TEST_F(HuggingFaceUtilTestSuite, TestGetHuggingFaceModelRepoInfoSuccessfully) { - auto model_info = - huggingface_utils::GetHuggingFaceModelRepoInfo("cortexso", "tinyllama"); - - EXPECT_TRUE(model_info.has_value()); - EXPECT_EQ(model_info->id, "cortexso/tinyllama"); - EXPECT_EQ(model_info->modelId, "cortexso/tinyllama"); - EXPECT_EQ(model_info->author, "cortexso"); - EXPECT_EQ(model_info->disabled, false); - EXPECT_EQ(model_info->gated, false); - - auto tag_contains_gguf = - std::find(model_info->tags.begin(), model_info->tags.end(), "gguf") != - model_info->tags.end(); - EXPECT_TRUE(tag_contains_gguf); - - auto contain_gguf_info = model_info->gguf.has_value(); - EXPECT_TRUE(contain_gguf_info); - - auto sibling_not_empty = !model_info->siblings.empty(); - EXPECT_TRUE(sibling_not_empty); -} +// temporary disable this test due to the model got removed +// TEST_F(HuggingFaceUtilTestSuite, TestGetHuggingFaceModelRepoInfoSuccessfully) { +// auto model_info = +// huggingface_utils::GetHuggingFaceModelRepoInfo("cortexso", "tinyllama"); + +// EXPECT_TRUE(model_info.has_value()); +// EXPECT_EQ(model_info->id, "cortexso/tinyllama"); +// EXPECT_EQ(model_info->modelId, "cortexso/tinyllama"); +// EXPECT_EQ(model_info->author, "cortexso"); +// EXPECT_EQ(model_info->disabled, false); +// EXPECT_EQ(model_info->gated, false); + +// auto tag_contains_gguf = +// std::find(model_info->tags.begin(), model_info->tags.end(), "gguf") != +// model_info->tags.end(); +// EXPECT_TRUE(tag_contains_gguf); + +// auto contain_gguf_info = model_info->gguf.has_value(); +// EXPECT_TRUE(contain_gguf_info); + +// auto sibling_not_empty = !model_info->siblings.empty(); +// EXPECT_TRUE(sibling_not_empty); +// } TEST_F(HuggingFaceUtilTestSuite, TestGetHuggingFaceModelRepoInfoReturnNullGgufInfoWhenNotAGgufModel) { From a221930a47e8c1db4b041f7c30fe4111212fbf95 Mon Sep 17 00:00:00 2001 From: Luke Nguyen Date: Wed, 13 Nov 2024 09:29:32 +0700 Subject: [PATCH 3/3] chore: disable test by using prefix --- .../test/components/test_huggingface_utils.cc | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/engine/test/components/test_huggingface_utils.cc b/engine/test/components/test_huggingface_utils.cc index 0c0adc8eb..236c904af 100644 --- a/engine/test/components/test_huggingface_utils.cc +++ b/engine/test/components/test_huggingface_utils.cc @@ -16,29 +16,29 @@ TEST_F(HuggingFaceUtilTestSuite, TestGetModelRepositoryBranches) { EXPECT_EQ(branches.value()["gguf"].ref, "refs/heads/gguf"); } -// temporary disable this test due to the model got removed -// TEST_F(HuggingFaceUtilTestSuite, TestGetHuggingFaceModelRepoInfoSuccessfully) { -// auto model_info = -// huggingface_utils::GetHuggingFaceModelRepoInfo("cortexso", "tinyllama"); - -// EXPECT_TRUE(model_info.has_value()); -// EXPECT_EQ(model_info->id, "cortexso/tinyllama"); -// EXPECT_EQ(model_info->modelId, "cortexso/tinyllama"); -// EXPECT_EQ(model_info->author, "cortexso"); -// EXPECT_EQ(model_info->disabled, false); -// EXPECT_EQ(model_info->gated, false); - -// auto tag_contains_gguf = -// std::find(model_info->tags.begin(), model_info->tags.end(), "gguf") != -// model_info->tags.end(); -// EXPECT_TRUE(tag_contains_gguf); - -// auto contain_gguf_info = model_info->gguf.has_value(); -// EXPECT_TRUE(contain_gguf_info); - -// auto sibling_not_empty = !model_info->siblings.empty(); -// EXPECT_TRUE(sibling_not_empty); -// } + +TEST_F(HuggingFaceUtilTestSuite, DISABLED_TestGetHuggingFaceModelRepoInfoSuccessfully) { + auto model_info = + huggingface_utils::GetHuggingFaceModelRepoInfo("cortexso", "tinyllama"); + + EXPECT_TRUE(model_info.has_value()); + EXPECT_EQ(model_info->id, "cortexso/tinyllama"); + EXPECT_EQ(model_info->modelId, "cortexso/tinyllama"); + EXPECT_EQ(model_info->author, "cortexso"); + EXPECT_EQ(model_info->disabled, false); + EXPECT_EQ(model_info->gated, false); + + auto tag_contains_gguf = + std::find(model_info->tags.begin(), model_info->tags.end(), "gguf") != + model_info->tags.end(); + EXPECT_TRUE(tag_contains_gguf); + + auto contain_gguf_info = model_info->gguf.has_value(); + EXPECT_TRUE(contain_gguf_info); + + auto sibling_not_empty = !model_info->siblings.empty(); + EXPECT_TRUE(sibling_not_empty); +} TEST_F(HuggingFaceUtilTestSuite, TestGetHuggingFaceModelRepoInfoReturnNullGgufInfoWhenNotAGgufModel) {