This commit is contained in:
ton
2023-10-10 09:11:01 +07:00
parent a9e2e4b2a6
commit 19c0cddbcc

View File

@@ -87,7 +87,7 @@ function generatePrompt_tokenSuffix(a::agent;
content = msg[:content]
if role == "system"
prompt = replace(systemToken, "content" => content)
prompt = replace(systemToken, "content" => content) * " "
elseif role == "user"
prompt *= " " * content * userToken
elseif role == "assistant"
@@ -101,7 +101,7 @@ function generatePrompt_tokenSuffix(a::agent;
end
function generatePrompt_tokenPrefix(a::agent;
userToken::String=" [/INST]", assistantToken=" [INST]",
userToken::String="[/INST]", assistantToken="[INST]",
systemToken="[INST]<<SYS>> content <</SYS>>")
prompt = nothing
for msg in a.messages
@@ -109,7 +109,7 @@ function generatePrompt_tokenPrefix(a::agent;
content = msg[:content]
if role == "system"
prompt = replace(systemToken, "content" => content)
prompt = replace(systemToken, "content" => content) * " "
elseif role == "user"
prompt *= userToken * content * " "
elseif role == "assistant"