From 60ceabe448534a5dd700c8b0f4e082e8d8ae08c0 Mon Sep 17 00:00:00 2001 From: Sam Spilsbury Date: Thu, 27 Jul 2023 04:11:44 +0300 Subject: [PATCH] testLoadGPT2: Allow for variations depending on system Quantization is imprecise, so we could get slightly different answers depending on the architecture. --- tests/js/testLoadGPT2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/js/testLoadGPT2.js b/tests/js/testLoadGPT2.js index 4a66dbb..eb33552 100644 --- a/tests/js/testLoadGPT2.js +++ b/tests/js/testLoadGPT2.js @@ -558,8 +558,8 @@ describe('GGML GPT2', function() { null ); - expect(language_model.complete('The meaning of life is:', 7, null)).toEqual( - ['The meaning of life is: to live in a state of being', false] + expect(language_model.complete('The meaning of life is:', 7, null)[0]).toMatch( + /The meaning of life is\: to live in a state of (being|peace)/, ); }); })