Skip to content

Commit c7fef65

Browse files
authored
Fixed dataset test (#246)
Signed-off-by: irar2 <[email protected]>
1 parent dc055d6 commit c7fef65

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/dataset/custom_dataset_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,11 @@ var _ = Describe("CustomDataset", Ordered, func() {
186186
tokens, finishReason, err := dataset.GetTokens(req, common.ModeRandom, random)
187187
Expect(err).NotTo(HaveOccurred())
188188
Expect(finishReason).To(Equal(StopFinishReason))
189-
Expect(tokens).To(Equal([]string{"Hello", " llm-d ", "world", "!"}))
189+
if len(tokens) >= 4 {
190+
// The number of tokens to generate is random, and if it's less than 4
191+
// we will not get these tokens
192+
Expect(tokens).To(Equal([]string{"Hello", " llm-d ", "world", "!"}))
193+
}
190194
})
191195

192196
It("should return at most 2 tokens for existing prompt", func() {

0 commit comments

Comments
 (0)