fix inference, add prompt template
Former-commit-id: 3940e50c71472b210bbc1b01248bf85a191c4065
This commit is contained in:
16
src/utils/template.py
Normal file
16
src/utils/template.py
Normal file
@@ -0,0 +1,16 @@
|
||||
def prompt_template_alpaca(query, history=None):
|
||||
prompt = ""
|
||||
if history:
|
||||
for old_query, response in history:
|
||||
prompt += "Human:{}\nAssistant:{}\n".format(old_query, response)
|
||||
prompt += "Human:{}\nAssistant:".format(query)
|
||||
return prompt
|
||||
|
||||
|
||||
def prompt_template_ziya(query, history=None):
|
||||
prompt = ""
|
||||
if history:
|
||||
for old_query, response in history:
|
||||
prompt += "<human>:{}\n<bot>:{}\n".format(old_query, response)
|
||||
prompt += "<human>:{}\n<bot>:".format(query)
|
||||
return prompt
|
||||
Reference in New Issue
Block a user