[FIX] Added handling for the "begin section" in meta_template to APITemplateParser (#1405)

Co-authored-by: leifei <nuuooo@icloud.com>
This commit is contained in:
hailsham 2024-09-19 18:12:04 +08:00 committed by GitHub
parent 5a27c2bd6f
commit a81bbb85bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -281,6 +281,9 @@ class APITemplateParser:
new_prompt.append(item) new_prompt.append(item)
prompt = new_prompt prompt = new_prompt
if self.meta_template.get('begin', None):
prompt.insert(0, self.meta_template['begin'])
else: else:
# in case the model does not have any meta template # in case the model does not have any meta template
prompt = '' prompt = ''