diff --git a/scripts/translator/main.ts b/scripts/translator/main.ts index ec4203cd..dae44aba 100644 --- a/scripts/translator/main.ts +++ b/scripts/translator/main.ts @@ -3,6 +3,7 @@ import * as fsp from "fs/promises"; import path from "path"; import * as fs from "fs"; +const base_url = process.env["LLAMA_BASE_URL"] as string; const model_name = process.env["MODEL"] as string; const template_name = process.env["TEMPLATE"] as string; let lang_path = process.env["LANG_PATH"] as string; @@ -203,7 +204,7 @@ async function run() { english_translation, ); - const response = await fetch("http://localhost:8080/v1/chat/completions", { + const response = await fetch(base_url + "/v1/chat/completions", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ diff --git a/scripts/translator/run.sh b/scripts/translator/run.sh index 2b371229..91e86bd3 100755 --- a/scripts/translator/run.sh +++ b/scripts/translator/run.sh @@ -21,6 +21,10 @@ if [ -z "${MODEL}" ]; then export MODEL="gemma-4-26B-A4B-it-UD-Q3_K_M" fi +if [ -z "${LLAMA_BASE_URL}" ]; then + export LLAMA_BASE_URL="http://127.0.0.1:8080" +fi + TEMPLATE="pl" bun main.ts TEMPLATE="de" bun main.ts TEMPLATE="ja" bun main.ts