@@ -94,8 +94,12 @@ class AssistedDecodingPipelinesHttpTest : public ::testing::Test {
9494 }
9595 }
9696
97- int generateExpectedText (std::string prompt, bool addSpecialTokens) {
97+ int generateExpectedText (std::string prompt, bool addSpecialTokens, bool applyChatTemplate ) {
9898 try {
99+ if (applyChatTemplate) {
100+ ov::genai::ChatHistory chatHistory ({{{" role" , " user" }, {" content" , prompt}}});
101+ prompt = cbPipe->get_tokenizer ().apply_chat_template (chatHistory, true );
102+ }
99103 ov::Tensor promptIds = cbPipe->get_tokenizer ().encode (prompt, ov::genai::add_special_tokens (addSpecialTokens)).input_ids ;
100104 std::cout << " Generated prompt ids: " << getPromptTokensString (promptIds) << std::endl;
101105 auto generationHandle = cbPipe->add_request (
@@ -162,7 +166,7 @@ TEST_F(AssistedDecodingPipelinesHttpTest, unaryCompletionsJsonSpeculativeDecodin
162166 // Generate reference from the base model (unassisted generation)
163167 config.max_new_tokens = 10 ;
164168 config.temperature = 0 ;
165- ASSERT_EQ (generateExpectedText (" What is OpenVINO?" , true ), 0 );
169+ ASSERT_EQ (generateExpectedText (" What is OpenVINO?" , true , false ), 0 );
166170 ASSERT_EQ (config.num_return_sequences , expectedMessages.size ());
167171
168172 // Static number of candidates
@@ -185,8 +189,7 @@ TEST_F(AssistedDecodingPipelinesHttpTest, unaryCompletionsJsonSpeculativeDecodin
185189 ASSERT_EQ (parsedResponse[" choices" ].Capacity (), 1 );
186190 auto & choice = parsedResponse[" choices" ].GetArray ()[0 ];
187191 ASSERT_TRUE (choice[" text" ].IsString ());
188- // TODO: awaiting OV/GenAI fix, uncomment when fixed
189- // EXPECT_STREQ(choice["text"].GetString(), expectedMessages[0].c_str());
192+ EXPECT_STREQ (choice[" text" ].GetString (), expectedMessages[0 ].c_str ());
190193
191194 // Dynamic number of candidates
192195 requestBody = R"(
@@ -208,15 +211,15 @@ TEST_F(AssistedDecodingPipelinesHttpTest, unaryCompletionsJsonSpeculativeDecodin
208211 ASSERT_EQ (parsedResponse[" choices" ].Capacity (), 1 );
209212 choice = parsedResponse[" choices" ].GetArray ()[0 ];
210213 ASSERT_TRUE (choice[" text" ].IsString ());
211- // TODO: awaiting OV/GenAI fix, uncomment when fixed
212- // EXPECT_STREQ(choice["text"].GetString(), expectedMessages[0].c_str());
214+ EXPECT_STREQ (choice[" text" ].GetString (), expectedMessages[0 ].c_str ());
213215}
214216
215217TEST_F (AssistedDecodingPipelinesHttpTest, unaryChatCompletionsJsonSpeculativeDecoding) {
218+ GTEST_SKIP (); // TODO: Temporary skip to synchronize CI workers
216219 // Generate reference from the base model (unassisted generation)
217220 config.max_new_tokens = 10 ;
218221 config.temperature = 0 ;
219- ASSERT_EQ (generateExpectedText (" What is OpenVINO?" , false ), 0 );
222+ ASSERT_EQ (generateExpectedText (" What is OpenVINO?" , false , true ), 0 );
220223 ASSERT_EQ (config.num_return_sequences , expectedMessages.size ());
221224
222225 // Static number of candidates
@@ -247,8 +250,7 @@ TEST_F(AssistedDecodingPipelinesHttpTest, unaryChatCompletionsJsonSpeculativeDec
247250 ASSERT_TRUE (choice[" message" ][" content" ].IsString ());
248251 ASSERT_TRUE (choice[" finish_reason" ].IsString ());
249252 ASSERT_FALSE (choice[" logprobs" ].IsObject ());
250- // TODO: awaiting OV/GenAI fix, uncomment when fixed
251- // ASSERT_EQ(choice["message"]["content"].GetString(), expectedMessages[0]);
253+ ASSERT_EQ (choice[" message" ][" content" ].GetString (), expectedMessages[0 ]);
252254
253255 // Dynamic number of candidates
254256 requestBody = R"(
@@ -278,8 +280,7 @@ TEST_F(AssistedDecodingPipelinesHttpTest, unaryChatCompletionsJsonSpeculativeDec
278280 ASSERT_TRUE (choice[" message" ][" content" ].IsString ());
279281 ASSERT_TRUE (choice[" finish_reason" ].IsString ());
280282 ASSERT_FALSE (choice[" logprobs" ].IsObject ());
281- // TODO: awaiting OV/GenAI fix, uncomment when fixed
282- // ASSERT_EQ(choice["message"]["content"].GetString(), expectedMessages[0]);
283+ ASSERT_EQ (choice[" message" ][" content" ].GetString (), expectedMessages[0 ]);
283284}
284285
285286TEST_F (AssistedDecodingPipelinesHttpTest, speculativeDecodingExclusiveParametersProvided) {
@@ -318,7 +319,7 @@ TEST_F(AssistedDecodingPipelinesHttpTest, unaryCompletionsJsonPromptLookupDecodi
318319 // Generate reference from the base model (unassisted generation)
319320 config.max_new_tokens = 10 ;
320321 config.temperature = 0 ;
321- ASSERT_EQ (generateExpectedText (" What is OpenVINO?" , true ), 0 );
322+ ASSERT_EQ (generateExpectedText (" What is OpenVINO?" , true , false ), 0 );
322323 ASSERT_EQ (config.num_return_sequences , expectedMessages.size ());
323324
324325 std::string requestBody = R"(
@@ -341,15 +342,15 @@ TEST_F(AssistedDecodingPipelinesHttpTest, unaryCompletionsJsonPromptLookupDecodi
341342 ASSERT_EQ (parsedResponse[" choices" ].Capacity (), 1 );
342343 auto & choice = parsedResponse[" choices" ].GetArray ()[0 ];
343344 ASSERT_TRUE (choice[" text" ].IsString ());
344- // TODO: awaiting OV/GenAI fix, uncomment when fixed
345- // EXPECT_STREQ(choice["text"].GetString(), expectedMessages[0].c_str());
345+ EXPECT_STREQ (choice[" text" ].GetString (), expectedMessages[0 ].c_str ());
346346}
347347
348348TEST_F (AssistedDecodingPipelinesHttpTest, unaryChatCompletionsJsonPromptLookupDecoding) {
349+ GTEST_SKIP (); // TODO: Temporary skip to synchronize CI workers
349350 // Generate reference from the base model (unassisted generation)
350351 config.max_new_tokens = 10 ;
351352 config.temperature = 0 ;
352- ASSERT_EQ (generateExpectedText (" What is OpenVINO?" , false ), 0 );
353+ ASSERT_EQ (generateExpectedText (" What is OpenVINO?" , false , true ), 0 );
353354 ASSERT_EQ (config.num_return_sequences , expectedMessages.size ());
354355
355356 auto requestBody = R"(
@@ -380,8 +381,7 @@ TEST_F(AssistedDecodingPipelinesHttpTest, unaryChatCompletionsJsonPromptLookupDe
380381 ASSERT_TRUE (choice[" message" ][" content" ].IsString ());
381382 ASSERT_TRUE (choice[" finish_reason" ].IsString ());
382383 ASSERT_FALSE (choice[" logprobs" ].IsObject ());
383- // TODO: awaiting OV/GenAI fix, uncomment when fixed
384- // ASSERT_EQ(choice["message"]["content"].GetString(), expectedMessages[0]);
384+ ASSERT_EQ (choice[" message" ][" content" ].GetString (), expectedMessages[0 ]);
385385}
386386
387387// Consider parametrization of negative tests with request body and endpoint as parameters
0 commit comments