Skip to content

Commit

Permalink
Fix src/bpe_model_test.cc (#7)
Browse files Browse the repository at this point in the history
Co-authored-by: Kuba Podgórski <kuba--@users.noreply.github.com>
  • Loading branch information
rbehjati and kuba-- authored Oct 28, 2023
1 parent 8cfe46f commit b31bcf8
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/bpe_model_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ TEST(BPEModelTest, EncodeTest) {
model_proto.mutable_pieces(12)->set_type( // r
ModelProto::SentencePiece::USER_DEFINED);


const Model model(std::make_unique<const ModelProto>(model_proto));

EncodeResult result;
Expand Down Expand Up @@ -152,7 +151,6 @@ TEST(BPEModelTest, EncodeAmbiguousTest) {

const Model model(std::make_unique<const ModelProto>(model_proto));


EncodeResult result;

// leftmost symbols are merged first.
Expand Down Expand Up @@ -192,7 +190,6 @@ TEST(BPEModelTest, NotSupportedTest) {
ModelProto model_proto = MakeBaseModelProto();

const Model model(std::make_unique<const ModelProto>(model_proto));

EXPECT_EQ(NBestEncodeResult(), model.NBestEncode("test", 10));
}

Expand All @@ -211,7 +208,6 @@ TEST(BPEModelTest, EncodeWithUnusedTest) {
// No unused.
{
const Model model(std::make_unique<const ModelProto>(model_proto));

const auto result = model.Encode("abcd");
EXPECT_EQ(1, result.size());
EXPECT_EQ("abcd", result[0].first);
Expand All @@ -221,7 +217,6 @@ TEST(BPEModelTest, EncodeWithUnusedTest) {
model_proto.mutable_pieces(3)->set_type(ModelProto::SentencePiece::UNUSED);

const Model model(std::make_unique<const ModelProto>(model_proto));

const auto result = model.Encode("abcd");
EXPECT_EQ(2, result.size());
EXPECT_EQ("abc", result[0].first);
Expand All @@ -234,7 +229,6 @@ TEST(BPEModelTest, EncodeWithUnusedTest) {
model_proto.mutable_pieces(5)->set_type(ModelProto::SentencePiece::UNUSED);

const Model model(std::make_unique<const ModelProto>(model_proto));

const auto result = model.Encode("abcd");
EXPECT_EQ(2, result.size());
EXPECT_EQ("abc", result[0].first);
Expand All @@ -251,7 +245,6 @@ TEST(BPEModelTest, EncodeWithUnusedTest) {
model_proto.mutable_pieces(5)->set_type(ModelProto::SentencePiece::NORMAL);

const Model model(std::make_unique<const ModelProto>(model_proto));

const auto result = model.Encode("abcd");
EXPECT_EQ(3, result.size());
EXPECT_EQ("ab", result[0].first);
Expand All @@ -271,7 +264,6 @@ TEST(SampleModelTest, EncodeTest) {
// No regularization
{
const Model model(std::make_unique<const ModelProto>(model_proto));

const auto result = model.Encode("abcd");
EXPECT_EQ(1, result.size());
EXPECT_EQ("abcd", result[0].first);
Expand Down

0 comments on commit b31bcf8

Please sign in to comment.