Larger context and WiP fix to prefix handling

This commit is contained in:
2025-05-22 20:24:29 +00:00
parent 41079c8ba1
commit ab349993ba
2 changed files with 4 additions and 8 deletions

View File

@@ -25,7 +25,7 @@ def main():
parser.add_argument(
'--token-limit',
type=int,
default=os.getenv('SIA_GEMMA_TOKEN_LIMIT', 4096),
default=os.getenv('SIA_GEMMA_TOKEN_LIMIT', 10000),
help='Token limit (default: 4096, env: SIA_GEMMA_TOKEN_LIMIT)'
)

View File

@@ -60,17 +60,13 @@ class GemmaLlmEngine(LlmEngine):
"prefix": True,
},
] if prefix else [
{
"role": "system",
"content": system,
},
{
"role": "user",
"content": context,
},
"content": f"{system}\n\n--- Context ---\n{context}",
}
]
return self._tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
add_generation_prompt=prefix is None or len(prefix) == 0
).removeprefix("<bos>")