From 97f36d61d0085dac91c6ee2675733d48e2a7ae73 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Fri, 13 Jun 2025 17:08:58 +0300 Subject: [PATCH] Reduce likelyhood that thinking model will go into infinite loop --- .../eu/svjatoslav/alyverkko_cli/AiTask.java | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/svjatoslav/alyverkko_cli/AiTask.java b/src/main/java/eu/svjatoslav/alyverkko_cli/AiTask.java index 530e114..925284d 100644 --- a/src/main/java/eu/svjatoslav/alyverkko_cli/AiTask.java +++ b/src/main/java/eu/svjatoslav/alyverkko_cli/AiTask.java @@ -229,20 +229,50 @@ public class AiTask { "--model " + mailQuery.model.filesystemPath, "--threads " + configuration.getThreadCount(), "--threads-batch " + configuration.getBatchThreadCount(), - "--mirostat 2", - "--flash-attn", + "--top-k 40", + "--top-p 0.95", + "--min-p 0.1", + "--repeat-penalty 1.1", + "--dry-multiplier 0.5", + "--presence-penalty 0.1", + "--mirostat 0", + "--samplers 'top_k;top_p;min_p;temperature;dry;typ_p;xtc'", "--cache-type-k q8_0", "--cache-type-v q8_0", "--no-display-prompt", "--no-warmup", - "--temp " + temperature, + "--flash-attn", + "--temp 0.6", "--ctx-size " + mailQuery.model.contextSizeTokens, "--batch-size 8", "--no-conversation", "-n -1", - "--repeat_penalty 1.1", "--file " + inputFile ); + +// Old solution that sometimes went into an infinite loop, for backup purposes: +// +// return join(" ", +// "nice", "-n", Integer.toString(niceValue), +// executablePath, +// "--model " + mailQuery.model.filesystemPath, +// "--threads " + configuration.getThreadCount(), +// "--threads-batch " + configuration.getBatchThreadCount(), +// "--mirostat 2", +// "--flash-attn", +// "--cache-type-k q8_0", +// "--cache-type-v q8_0", +// "--no-display-prompt", +// "--no-warmup", +// "--temp " + temperature, +// "--ctx-size " + mailQuery.model.contextSizeTokens, +// "--batch-size 8", +// "--no-conversation", +// "-n -1", +// "--repeat_penalty 1.1", +// "--file " + inputFile +// ); + } /** -- 2.20.1