Skip to content

Commit e33fb5d

Browse files
committed
refactor: extract contextSizePad to the config file
1 parent f4596aa commit e33fb5d

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,4 @@ export const documentationPageUrls = {
125125
export const newGithubIssueUrl = "https://github.com/withcatai/node-llama-cpp/issues";
126126
export const recommendedBaseDockerImage = "node:20";
127127
export const minAllowedContextSizeInCalculations = 24;
128+
export const contextSizePad = 256; // source: `GGML_PAD` usage in `llama_context::llama_context` in `llama-context.cpp`

src/evaluator/LlamaContext/utils/padSafeContextSize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const contextSizePad = 256;
1+
import {contextSizePad} from "../../../config.js";
22

33
export function padSafeContextSize(value: number, padDirection: "up" | "down", padding: number = contextSizePad) {
44
const paddedSize = ggmlPad(value, padding);

0 commit comments

Comments
 (0)