@@ -195,13 +195,14 @@ describe("llama 3.2", () => {
195195 } ) ;
196196 const contextSequence1 = context1 . getSequence ( ) ;
197197 const contextSequence2 = context2 . getSequence ( ) ;
198+ expect ( context2 . contextSize ) . to . eql ( 256 ) ; // the context is actually bigger due to `llama.cpp`'s padding
198199
199200 const chatSession1 = new LlamaChatSession ( {
200201 contextSequence : contextSequence1
201202 } ) ;
202203
203- const res1 = await chatSession1 . prompt ( "Remember: locks are not doors" , { maxTokens : 4 } ) ;
204- expect ( res1 ) . to . toMatchInlineSnapshot ( "\"That's a clever\"" ) ;
204+ const res1 = await chatSession1 . prompt ( "Remember: locks are not doors. Also, write a long poem about it " , { maxTokens : 154 } ) ;
205+ expect ( res1 ) . toMatch ( / ^ A c l e v e r r e m i n d e r i n d e e d . / ) ;
205206
206207
207208 const stateFile1Path = await getTempTestFilePath ( "state1" ) ;
@@ -211,12 +212,12 @@ describe("llama 3.2", () => {
211212 const contextSequence1TokensState = contextSequence1 . tokenMeter . getState ( ) ;
212213
213214 expect ( contextSequence1 . contextTokens ) . to . eql ( state1Tokens ) ;
214- expect ( contextSequence1 . contextTokens . length ) . toMatchInlineSnapshot ( "103 " ) ;
215- expect ( toBytes ( ( await fs . stat ( stateFile1Path ) ) . size ) ) . to . toMatchInlineSnapshot ( '"11.27MB "' ) ;
215+ expect ( contextSequence1 . contextTokens . length ) . toMatchInlineSnapshot ( "262 " ) ;
216+ expect ( toBytes ( ( await fs . stat ( stateFile1Path ) ) . size ) ) . to . toMatchInlineSnapshot ( '"28.66MB "' ) ;
216217 expect ( contextSequence1TokensState ) . to . toMatchInlineSnapshot ( `
217218 {
218- "usedInputTokens": 99 ,
219- "usedOutputTokens": 4 ,
219+ "usedInputTokens": 108 ,
220+ "usedOutputTokens": 154 ,
220221 }
221222 ` ) ;
222223
0 commit comments