diff --git a/llama/toolchains/llvm.win32.host-x64.target-x64.cmake b/llama/toolchains/llvm.win32.host-x64.target-x64.cmake index 91a61167..6325ecf3 100644 --- a/llama/toolchains/llvm.win32.host-x64.target-x64.cmake +++ b/llama/toolchains/llvm.win32.host-x64.target-x64.cmake @@ -1,6 +1,8 @@ set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_SYSTEM_PROCESSOR x86_64) +set(CMAKE_CROSSCOMPILING FALSE) # event though we set `CMAKE_SYSTEM_NAME`, we don't actually cross-compile here + set(target x86_64-pc-windows-msvc) set(CMAKE_C_COMPILER_TARGET ${target}) set(CMAKE_CXX_COMPILER_TARGET ${target}) diff --git a/llama/toolchains/win32.host-arm64.target-arm64.cmake b/llama/toolchains/win32.host-arm64.target-arm64.cmake index 2af386ea..94cdf719 100644 --- a/llama/toolchains/win32.host-arm64.target-arm64.cmake +++ b/llama/toolchains/win32.host-arm64.target-arm64.cmake @@ -1,6 +1,8 @@ set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_SYSTEM_PROCESSOR arm64) +set(CMAKE_CROSSCOMPILING FALSE) # event though we set `CMAKE_SYSTEM_NAME`, we don't actually cross-compile here + set(target arm64-pc-windows-msvc) set(CMAKE_C_COMPILER_TARGET ${target}) set(CMAKE_CXX_COMPILER_TARGET ${target}) diff --git a/src/evaluator/LlamaDecisionContext/LlamaDecisionContext.ts b/src/evaluator/LlamaDecisionContext/LlamaDecisionContext.ts index 25e217a9..678c27c4 100644 --- a/src/evaluator/LlamaDecisionContext/LlamaDecisionContext.ts +++ b/src/evaluator/LlamaDecisionContext/LlamaDecisionContext.ts @@ -296,7 +296,7 @@ export class LlamaDecisionContext { : onOverflow?.type === "compressDocument" ? { lastEvaluationMetadata: null, - size: (sequence) => sequence.contextSize - 1, + size: 1, strategy({maxTokensCount, tokenizer, chatWrapper}) { const fullDocumentTokenLength = tokenizer(document, false, "trimLeadingSpace").length; const testTokenLength = chatWrapper.generateContextState({ diff --git a/test/modelDependent/gemma4-e2b/structuredDecisions.test.ts b/test/modelDependent/gemma4-e2b/structuredDecisions.test.ts index ed2ddd9c..8408564b 100644 --- a/test/modelDependent/gemma4-e2b/structuredDecisions.test.ts +++ b/test/modelDependent/gemma4-e2b/structuredDecisions.test.ts @@ -30,7 +30,7 @@ describe("gemma4 e2b", () => { { "isUrgent": { "type": "noul", - "value": 0.999, + "value": 1, }, } `); @@ -98,8 +98,8 @@ describe("gemma4 e2b", () => { "confidence": 1, "probabilities": { "API": 1, - "codebase": 0.0000762, - "database": 0.00000208, + "codebase": 0, + "database": 0, }, "type": "choice", }, @@ -110,8 +110,8 @@ describe("gemma4 e2b", () => { "level": { "confidence": 1, "probabilities": [ - 0.0000264, - 0.0000152, + 0, + 0, 1, ], "score": 2, @@ -122,8 +122,8 @@ describe("gemma4 e2b", () => { "confidence": 1, "probabilities": { "engineering": 1, - "hr": 0.000242, - "sales": 0.0000568, + "hr": 0, + "sales": 0, }, "type": "choice", }, @@ -357,7 +357,7 @@ describe("gemma4 e2b", () => { expect(Object.keys(res.category.probabilities).length).to.be.greaterThan(10); expect(Object.keys(res.category.probabilities).length).toMatchInlineSnapshot("94"); expect(res.category.choice).to.be.eql("password"); - expect(res.category.confidence).to.be.greaterThanOrEqual(0.6); + expect(res.category.confidence).to.be.greaterThanOrEqual(0.5); }); }); }); @@ -430,7 +430,7 @@ describe("gemma4 e2b", () => { { "animal": { "type": "noul", - "value": 0.999, + "value": 1, }, "animalOrigins": { "type": "noul", @@ -446,7 +446,7 @@ describe("gemma4 e2b", () => { }, "relatedAnimals": { "type": "noul", - "value": 0.999, + "value": 1, }, } `); @@ -536,32 +536,32 @@ describe("gemma4 e2b", () => { { "animal": { "type": "noul", - "value": 0.000187, + "value": 0, }, "cookingRecipe": { "type": "noul", - "value": 0.000112, + "value": 0, }, "fictionalStory": { "type": "noul", - "value": 0.0000023, + "value": 0, }, "mineralOrigin": { "type": "noul", - "value": 0.0000034, + "value": 0, }, "spaceTravel": { "type": "noul", - "value": 0.0000368, + "value": 0, }, "subject": { "choice": "materials", - "confidence": 0.998, + "confidence": 1, "probabilities": { - "brushing": 0.0000175, - "food": 0.000779, - "materials": 0.999, - "other": 0.00018, + "brushing": 0, + "food": 0, + "materials": 1, + "other": 0, }, "type": "choice", }, diff --git a/test/utils/helpers/simplifyTestDecisionAnswerRange.ts b/test/utils/helpers/simplifyTestDecisionAnswerRange.ts index 48d927f5..d7c51871 100644 --- a/test/utils/helpers/simplifyTestDecisionAnswerRange.ts +++ b/test/utils/helpers/simplifyTestDecisionAnswerRange.ts @@ -38,7 +38,6 @@ function simplifyFloat(value: number) { if (value === 0) return 0; - const step = 10 ** (Math.floor(Math.log10(Math.abs(value))) - 2); - return Number.parseFloat((Math.round(value / step) * step).toPrecision(12)); + return Math.round(Math.round(value * 100) / 4) * 4 / 100; }