This commit is contained in:
narawat lamaiin
2024-08-28 10:40:17 +07:00
parent 83315a747f
commit 9f80e8359f
2 changed files with 30 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
module util
export clearhistory, addNewMessage, vectorOfDictToText, eventdict
export clearhistory, addNewMessage, vectorOfDictToText, eventdict, noises
using UUIDs, Dates, DataStructures, HTTP, MQTTClient, JSON3
using GeneralUtils
@@ -181,7 +181,15 @@ function eventdict(;
end
noise(n::Integer) = String(rand('a':'z', n))
function noises(totalword::Integer, wordlength::Integer)
noises = ""
for i in 1:totalword
noises *= noise(wordlength) * " "
end
noises = strip(noises)
return noises
end
# """ Convert a single chat dictionary into LLM model instruct format.