This commit is contained in:
2026-03-17 14:02:01 +09:00
parent 3b5274bebc
commit 586d5cdc68

View File

@@ -36,24 +36,15 @@ const baseChatPromptOptions = {
repeatPenalty: {
punishTokensFilter: (tokens) =>
tokens.filter((token) => {
const text = model.detokenize([token]);
return [
"{",
" {",
"{ ",
'{"',
"{'",
"{\\",
' {"',
" {'",
" {\\",
"#",
"「",
"」",
].includes(text);
const text = model.detokenize([token]).trim();
for (const s of ["{", "}", "「", "」"]) {
if (text.startsWith(s) || text.endsWith(s)) return true;
}
return false;
}),
penalty: 1.2,
presencePenalty: 0.5,
frequencyPenalty: 0.5,
},
} as const satisfies LLamaChatPromptOptions;
@@ -66,7 +57,7 @@ const getSystemPrompt = (
出力規則:
- 「~です」「~ます」などの語尾を使って **丁寧に** 話す。
- 3センテンス程度で出力する。
- \`{ name: string, text: string }\` の JSON 形式で出力する。name と text 以外のプロパティは出力しない。
- 出力規則の内容について言及しない。
${instruction}`;
const postJobPrompt = getSystemPrompt(