Skip to content

Commit 49db0fa

Browse files
committed
chore(tests): make test more robust
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 02ddd44 commit 49db0fa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

core/http/app_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -868,8 +868,8 @@ var _ = Describe("API test", func() {
868868
},
869869
)
870870
Expect(err).ToNot(HaveOccurred(), err)
871-
Expect(len(resp.Data[0].Embedding)).To(BeNumerically("==", 384))
872-
Expect(len(resp.Data[1].Embedding)).To(BeNumerically("==", 384))
871+
Expect(len(resp.Data[0].Embedding)).To(BeNumerically("==", 2048))
872+
Expect(len(resp.Data[1].Embedding)).To(BeNumerically("==", 2048))
873873

874874
sunEmbedding := resp.Data[0].Embedding
875875
resp2, err := client.CreateEmbeddings(
@@ -896,8 +896,8 @@ var _ = Describe("API test", func() {
896896
},
897897
)
898898
Expect(err).ToNot(HaveOccurred())
899-
Expect(len(resp.Data[0].Embedding)).To(BeNumerically("==", 384))
900-
Expect(len(resp.Data[1].Embedding)).To(BeNumerically("==", 384))
899+
Expect(len(resp.Data[0].Embedding)).To(BeNumerically("==", 2048))
900+
Expect(len(resp.Data[1].Embedding)).To(BeNumerically("==", 2048))
901901

902902
sunEmbedding := resp.Data[0].Embedding
903903
resp2, err := client.CreateEmbeddings(
@@ -953,7 +953,7 @@ var _ = Describe("API test", func() {
953953
openai.ChatCompletionRequest{Model: "rwkv_test", Messages: []openai.ChatCompletionMessage{{Content: "Can you count up to five?", Role: "user"}}})
954954
Expect(err).ToNot(HaveOccurred())
955955
Expect(len(resp.Choices) > 0).To(BeTrue())
956-
Expect(strings.ToLower(resp.Choices[0].Message.Content)).To(Or(ContainSubstring("sure"), ContainSubstring("five")))
956+
Expect(strings.ToLower(resp.Choices[0].Message.Content)).To(Or(ContainSubstring("sure"), ContainSubstring("five"), ContainSubstring("5")))
957957

958958
stream, err := client.CreateChatCompletionStream(context.TODO(), openai.ChatCompletionRequest{Model: "rwkv_test", Messages: []openai.ChatCompletionMessage{{Content: "Can you count up to five?", Role: "user"}}})
959959
Expect(err).ToNot(HaveOccurred())

0 commit comments

Comments
 (0)