Benchmark: käytä thinking-kenttää fallbackina jos content tyhjä
qwen3.5 palauttaa vastauksen thinking-kentässä kun content on tyhjä. Lisätty debug-logi thinking-malleille.
This commit is contained in:
@@ -81,8 +81,10 @@ async function ollamaChat(model, prompt, systemPrompt, maxTokens = 2048) {
|
|||||||
const elapsed = Date.now() - start;
|
const elapsed = Date.now() - start;
|
||||||
// Ollama: jotkin mallit (qwen3.5) palauttavat ajattelun erillisessä thinking-kentässä
|
// Ollama: jotkin mallit (qwen3.5) palauttavat ajattelun erillisessä thinking-kentässä
|
||||||
const rawContent = (data.message?.content || '').trim();
|
const rawContent = (data.message?.content || '').trim();
|
||||||
const text = stripThinking(rawContent);
|
const thinking = (data.message?.thinking || '').trim();
|
||||||
|
const text = stripThinking(rawContent || thinking);
|
||||||
const evalCount = data.eval_count || 0;
|
const evalCount = data.eval_count || 0;
|
||||||
|
if (!rawContent && thinking) console.log(` ⚠ thinking-malli: ${thinking.length} merkkiä ajattelua, content tyhjä`);
|
||||||
const evalDurationNs = data.eval_duration || 1;
|
const evalDurationNs = data.eval_duration || 1;
|
||||||
const tokPerSec = evalCount / (evalDurationNs / 1e9);
|
const tokPerSec = evalCount / (evalDurationNs / 1e9);
|
||||||
return { text, tokens: evalCount, durationMs: elapsed, tokPerSec };
|
return { text, tokens: evalCount, durationMs: elapsed, tokPerSec };
|
||||||
|
|||||||
Reference in New Issue
Block a user