To support system prompt as a input parameter (#280)

This commit is contained in:
jiangzeyinzi 2025-03-28 11:51:31 +08:00 committed by GitHub
parent bc3249d61c
commit d6434cf8ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -137,12 +137,14 @@ class PromptExpander:
def __call__(self, def __call__(self,
prompt, prompt,
system_prompt=None,
tar_lang="zh", tar_lang="zh",
image=None, image=None,
seed=-1, seed=-1,
*args, *args,
**kwargs): **kwargs):
system_prompt = self.decide_system_prompt(tar_lang=tar_lang) if system_prompt is None:
system_prompt = self.decide_system_prompt(tar_lang=tar_lang)
if seed < 0: if seed < 0:
seed = random.randint(0, sys.maxsize) seed = random.randint(0, sys.maxsize)
if image is not None and self.is_vl: if image is not None and self.is_vl: