Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions llama/toolchains/llvm.win32.host-x64.target-x64.cmake
Original file line number Diff line number Diff line change
@@ -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})
Expand Down
2 changes: 2 additions & 0 deletions llama/toolchains/win32.host-arm64.target-arm64.cmake
Original file line number Diff line number Diff line change
@@ -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})
Expand Down
2 changes: 1 addition & 1 deletion src/evaluator/LlamaDecisionContext/LlamaDecisionContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
40 changes: 20 additions & 20 deletions test/modelDependent/gemma4-e2b/structuredDecisions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe("gemma4 e2b", () => {
{
"isUrgent": {
"type": "noul",
"value": 0.999,
"value": 1,
},
}
`);
Expand Down Expand Up @@ -98,8 +98,8 @@ describe("gemma4 e2b", () => {
"confidence": 1,
"probabilities": {
"API": 1,
"codebase": 0.0000762,
"database": 0.00000208,
"codebase": 0,
"database": 0,
},
"type": "choice",
},
Expand All @@ -110,8 +110,8 @@ describe("gemma4 e2b", () => {
"level": {
"confidence": 1,
"probabilities": [
0.0000264,
0.0000152,
0,
0,
1,
],
"score": 2,
Expand All @@ -122,8 +122,8 @@ describe("gemma4 e2b", () => {
"confidence": 1,
"probabilities": {
"engineering": 1,
"hr": 0.000242,
"sales": 0.0000568,
"hr": 0,
"sales": 0,
},
"type": "choice",
},
Expand Down Expand Up @@ -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);
});
});
});
Expand Down Expand Up @@ -430,7 +430,7 @@ describe("gemma4 e2b", () => {
{
"animal": {
"type": "noul",
"value": 0.999,
"value": 1,
},
"animalOrigins": {
"type": "noul",
Expand All @@ -446,7 +446,7 @@ describe("gemma4 e2b", () => {
},
"relatedAnimals": {
"type": "noul",
"value": 0.999,
"value": 1,
},
}
`);
Expand Down Expand Up @@ -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",
},
Expand Down
3 changes: 1 addition & 2 deletions test/utils/helpers/simplifyTestDecisionAnswerRange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Loading