CodeBench: --spec-model lippu — eri malli spec-vaiheille (1-2)
This commit is contained in:
@@ -35,6 +35,7 @@ const RESULTS_DIR = join(__dirname, 'results');
|
||||
const THINK_MODE = args.includes('--think');
|
||||
const COMPACT_MODE = args.includes('--compact');
|
||||
const NO_ORCHESTRATE = args.includes('--no-orchestrate');
|
||||
const SPEC_MODEL = arg('spec-model', ''); // Eri malli spec-vaiheille (1-2)
|
||||
const LANG = arg('lang', 'python'); // python | rust | go
|
||||
const ROUNDS = parseInt(arg('rounds', '1')); // 1-10 toistoa
|
||||
const MAX_FIX_ROUNDS = 2;
|
||||
@@ -328,8 +329,9 @@ async function runPipeline(model, scenario, round = 1) {
|
||||
|
||||
try {
|
||||
// 1. Vaatimukset
|
||||
console.log(` [1/5] Vaatimukset...`);
|
||||
const req = await ollamaChat(model, scenario.prompt, CLIENT_SYSTEM, 2048);
|
||||
const specModel = SPEC_MODEL || model;
|
||||
console.log(` [1/5] Vaatimukset${SPEC_MODEL ? ` (${SPEC_MODEL})` : ''}...`);
|
||||
const req = await ollamaChat(specModel, scenario.prompt, CLIENT_SYSTEM, 2048);
|
||||
timings.push(req);
|
||||
if (!req.text || req.text.length < 50) { result.error = 'Vaatimukset liian lyhyet'; return result; }
|
||||
result.reqOk = true;
|
||||
@@ -337,7 +339,7 @@ async function runPipeline(model, scenario, round = 1) {
|
||||
|
||||
// 2. JSON-speksi
|
||||
console.log(` [2/5] JSON-speksi...`);
|
||||
const specResp = await ollamaChat(model, `${req.text}\n\nOutput a JSON spec for this project.`, SPEC_SYSTEM, 4096);
|
||||
const specResp = await ollamaChat(specModel, `${req.text}\n\nOutput a JSON spec for this project.`, SPEC_SYSTEM, 4096);
|
||||
timings.push(specResp);
|
||||
const spec = extractJson(specResp.text);
|
||||
if (!spec || !spec.entities || spec.entities.length === 0) { result.error = 'JSON-speksi epäonnistui'; writeFileSync(`${dir}/_spec_raw.txt`, specResp.text); return result; }
|
||||
|
||||
Reference in New Issue
Block a user