set max tokens to 5k

This commit is contained in:
Dobromir Popov
2026-07-07 18:21:13 +02:00
parent aba5fb12fa
commit 456c43ea1d
3 changed files with 4 additions and 4 deletions

View File

@@ -215,7 +215,7 @@ class TorchModelShard:
def generate_text( def generate_text(
self, self,
messages: list[dict], messages: list[dict],
max_new_tokens: int = 256, max_new_tokens: int = 5120,
temperature: float = 1.0, temperature: float = 1.0,
top_p: float = 1.0, top_p: float = 1.0,
) -> str: ) -> str:
@@ -245,7 +245,7 @@ class TorchModelShard:
def generate_text_streaming( def generate_text_streaming(
self, self,
messages: list[dict], messages: list[dict],
max_new_tokens: int = 256, max_new_tokens: int = 5000,
temperature: float = 1.0, temperature: float = 1.0,
top_p: float = 1.0, top_p: float = 1.0,
): ):

View File

@@ -321,7 +321,7 @@ class _TorchHandler(http.server.BaseHTTPRequestHandler):
if backend is None or not backend.is_head: if backend is None or not backend.is_head:
self._send_json(400, {"error": "model not loaded on this node"}) self._send_json(400, {"error": "model not loaded on this node"})
return return
max_tokens = int(body.get("max_tokens") or body.get("max_new_tokens") or 256) max_tokens = int(body.get("max_tokens") or body.get("max_new_tokens") or 5120)
temperature = float(body.get("temperature") or 1.0) temperature = float(body.get("temperature") or 1.0)
top_p = float(body.get("top_p") or 1.0) top_p = float(body.get("top_p") or 1.0)

View File

@@ -930,7 +930,7 @@ async function sendChat() {
{ role: "user", content: prompt }, { role: "user", content: prompt },
], ],
stream: false, stream: false,
max_tokens: 256, max_tokens: 15120,
}; };
chatBusy = true; chatBusy = true;
$("chat-send").disabled = true; $("chat-send").disabled = true;