This commit is contained in:
Your Name
2024-02-11 06:25:01 +07:00
parent a73207485d
commit 8a1e31b7c8
3 changed files with 70 additions and 45 deletions

View File

@@ -453,10 +453,10 @@ end
""" Convert a vector of dict into 1-continous string.
Arguments:
vecofdict, a vector of dict
Arguments\n
vecofdict : a vector of dict
Return:
Return\n
1-continous string
Example:
@@ -487,9 +487,9 @@ function messagesToString(messages::AbstractVector{T}; addressAIas="assistant")
end
if role == "user"
conversation *= "<|$role|>\n $(content[1:end-nouse])\n</s>"
conversation *= "<|$role|>\n $(content[1:end-nouse])\n</|$role|>"
elseif role == "assistant"
conversation *= "<|$addressAIas|>\n $(content[1:end-nouse])\n</s>"
conversation *= "<|$addressAIas|>\n $(content[1:end-nouse])\n</|$addressAIas|>"
else
error("undefied condition role = $role $(@__LINE__)")
end
@@ -517,9 +517,9 @@ end
# end
# if role == "user"
# conversation *= "<|im_start|>$role: $(content[1:end-nouse])\n<|im_end|>"
# conversation *= "<|$role|>\n $(content[1:end-nouse])\n</s>"
# elseif role == "assistant"
# conversation *= "<|im_start|>$addressAIas: $(content[1:end-nouse])\n<|im_end|>"
# conversation *= "<|$addressAIas|>\n $(content[1:end-nouse])\n</s>"
# else
# error("undefied condition role = $role $(@__LINE__)")
# end
@@ -531,6 +531,7 @@ end
# return conversation
# end
""" Convert a vector of dict into 1-continous string.
Arguments: