To support system prompt as a input parameter

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

View File

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