Change system prompt to inject Prompt Start special token

This commit is contained in:
rockerBOO
2025-02-27 02:47:04 -05:00
parent 7b83d50dc0
commit ce2610d29b
4 changed files with 15 additions and 8 deletions

View File

@@ -330,11 +330,12 @@ def sample_image_inference(
logger.info(f"renorm: {renorm_cfg}")
# logger.info(f"sample_sampler: {sampler_name}")
system_prompt = args.system_prompt or ""
system_prompt_special_token = "<Prompt Start>"
system_prompt = f"{args.system_prompt} {system_prompt_special_token} " if args.system_prompt else ""
# Apply system prompt to prompts
prompt = system_prompt + prompt
negative_prompt = system_prompt + negative_prompt
negative_prompt = negative_prompt
# Get sample prompts from cache
if sample_prompts_gemma2_outputs and prompt in sample_prompts_gemma2_outputs: