mirror of https://github.com/wayvr-org/wayvr.git
translator: allow specifying llama url
This commit is contained in:
parent
6dd624e046
commit
8baac0d298
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue