@tiens.nguyen/gonext-local-worker 1.0.112 → 1.0.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gonext-local-worker.mjs +5 -1
- package/package.json +1 -1
package/gonext-local-worker.mjs
CHANGED
|
@@ -143,6 +143,10 @@ const OCR_CORRECT_TIMEOUT_MS = 120_000;
|
|
|
143
143
|
// (The user-configurable "OCR translation model" chooser was removed.)
|
|
144
144
|
const OCR_TRANSLATE_OLLAMA_URL = "https://ollama1.gomarsic.cc";
|
|
145
145
|
const OCR_TRANSLATE_OLLAMA_MODEL = "qwen3:14b";
|
|
146
|
+
// Ollama defaults num_ctx to 2048 and silently truncates longer inputs (keeping
|
|
147
|
+
// only the tail), which would drop the start of a long OCR page. Pin the context
|
|
148
|
+
// window to 32k so full-page/multi-paragraph OCR is corrected in one pass.
|
|
149
|
+
const OCR_TRANSLATE_NUM_CTX = 32768;
|
|
146
150
|
|
|
147
151
|
async function workerFetch(path, init = {}) {
|
|
148
152
|
const url = `${apiBase}${path.startsWith("/") ? path : `/${path}`}`;
|
|
@@ -1031,7 +1035,7 @@ async function correctOcrTextViaOllama(extractedText, base, model) {
|
|
|
1031
1035
|
model,
|
|
1032
1036
|
stream: false,
|
|
1033
1037
|
think: false,
|
|
1034
|
-
options: { temperature: 0 },
|
|
1038
|
+
options: { temperature: 0, num_ctx: OCR_TRANSLATE_NUM_CTX },
|
|
1035
1039
|
messages: [
|
|
1036
1040
|
{ role: "system", content: systemPrompt },
|
|
1037
1041
|
{ role: "user", content: `Text:\n${extractedText}` },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiens.nguyen/gonext-local-worker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.113",
|
|
4
4
|
"description": "Polls GoNext cloud API for async local LLM jobs and runs them against Ollama/OpenAI-compatible servers on this Mac",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|