diff --git a/mediapipe/tasks/c/text/text_embedder/text_embedder_test.cc b/mediapipe/tasks/c/text/text_embedder/text_embedder_test.cc index c4461df83..bce4ffe38 100644 --- a/mediapipe/tasks/c/text/text_embedder/text_embedder_test.cc +++ b/mediapipe/tasks/c/text/text_embedder/text_embedder_test.cc @@ -69,12 +69,14 @@ TEST(TextEmbedderTest, SucceedsWithCosineSimilarity) { std::string model_path = GetFullPath(kTestBertModelPath); TextEmbedderOptions options = { /* base_options= */ {/* model_asset_buffer= */ nullptr, + /* model_asset_buffer_count= */ 0, /* model_asset_path= */ model_path.c_str()}, /* embedder_options= */ {/* l2_normalize= */ false, /* quantize= */ false}}; - void* embedder = text_embedder_create(&options); + void* embedder = text_embedder_create(&options, + /* error_msg */ nullptr); EXPECT_NE(embedder, nullptr); // Extract both embeddings. @@ -89,7 +91,7 @@ TEST(TextEmbedderTest, SucceedsWithCosineSimilarity) { &similarity); double expected_similarity = 0.98077; EXPECT_LE(abs(similarity - expected_similarity), kPrecision); - text_embedder_close(embedder); + text_embedder_close(embedder, /* error_msg */ nullptr); } TEST(TextEmbedderTest, ErrorHandling) { diff --git a/mediapipe/tasks/c/vision/image_embedder/image_embedder_test.cc b/mediapipe/tasks/c/vision/image_embedder/image_embedder_test.cc index d31b8b736..52a5a27a8 100644 --- a/mediapipe/tasks/c/vision/image_embedder/image_embedder_test.cc +++ b/mediapipe/tasks/c/vision/image_embedder/image_embedder_test.cc @@ -63,6 +63,7 @@ TEST(ImageEmbedderTest, ImageModeTest) { const std::string model_path = GetFullPath(kModelName); ImageEmbedderOptions options = { /* base_options= */ {/* model_asset_buffer= */ nullptr, + /* model_asset_buffer_count= */ 0, /* model_asset_path= */ model_path.c_str()}, /* running_mode= */ RunningMode::IMAGE, /* embedder_options= */ @@ -98,6 +99,7 @@ TEST(ImageEmbedderTest, SucceedsWithCosineSimilarity) { const std::string model_path = GetFullPath(kModelName); ImageEmbedderOptions options = { /* base_options= */ {/* model_asset_buffer= */ nullptr, + /* model_asset_buffer_count= */ 0, /* model_asset_path= */ model_path.c_str()}, /* running_mode= */ RunningMode::IMAGE, /* embedder_options= */ @@ -152,6 +154,7 @@ TEST(ImageEmbedderTest, VideoModeTest) { const std::string model_path = GetFullPath(kModelName); ImageEmbedderOptions options = { /* base_options= */ {/* model_asset_buffer= */ nullptr, + /* model_asset_buffer_count= */ 0, /* model_asset_path= */ model_path.c_str()}, /* running_mode= */ RunningMode::VIDEO, /* embedder_options= */ @@ -210,6 +213,7 @@ TEST(ImageEmbedderTest, LiveStreamModeTest) { ImageEmbedderOptions options = { /* base_options= */ {/* model_asset_buffer= */ nullptr, + /* model_asset_buffer_count= */ 0, /* model_asset_path= */ model_path.c_str()}, /* running_mode= */ RunningMode::LIVE_STREAM, /* embedder_options= */ @@ -244,6 +248,7 @@ TEST(ImageEmbedderTest, InvalidArgumentHandling) { // It is an error to set neither the asset buffer nor the path. ImageEmbedderOptions options = { /* base_options= */ {/* model_asset_buffer= */ nullptr, + /* model_asset_buffer_count= */ 0, /* model_asset_path= */ nullptr}, /* embedder_options= */ {}, }; @@ -261,6 +266,7 @@ TEST(ImageEmbedderTest, FailedEmbeddingHandling) { const std::string model_path = GetFullPath(kModelName); ImageEmbedderOptions options = { /* base_options= */ {/* model_asset_buffer= */ nullptr, + /* model_asset_buffer_count= */ 0, /* model_asset_path= */ model_path.c_str()}, /* running_mode= */ RunningMode::IMAGE, /* embedder_options= */