update
This commit is contained in:
15
src/utils.jl
15
src/utils.jl
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user