update
This commit is contained in:
@@ -406,9 +406,10 @@ function extractWineAttributes_1(a::T1, input::T2)::String where {T1<:agent, T2<
|
||||
]
|
||||
|
||||
# put in model format
|
||||
prompt = GeneralUtils.formatLLMtext(_prompt; formatname="qwen")
|
||||
prompt = GeneralUtils.formatLLMtext(_prompt, "granite3")
|
||||
response = a.func[:text2textInstructLLM](prompt)
|
||||
response = GeneralUtils.remove_french_accents(response)
|
||||
response = GeneralUtils.deFormatLLMtext(response, "granite3")
|
||||
|
||||
# check wheter all attributes are in the response
|
||||
checkFlag = false
|
||||
@@ -640,9 +641,10 @@ function extractWineAttributes_2(a::T1, input::T2)::String where {T1<:agent, T2<
|
||||
]
|
||||
|
||||
# put in model format
|
||||
prompt = GeneralUtils.formatLLMtext(_prompt; formatname="qwen")
|
||||
prompt = GeneralUtils.formatLLMtext(_prompt, "granite3")
|
||||
|
||||
response = a.func[:text2textInstructLLM](prompt)
|
||||
response = GeneralUtils.deFormatLLMtext(response, "granite3")
|
||||
|
||||
# check whether response has all header
|
||||
detected_kw = GeneralUtils.detect_keyword(header, response)
|
||||
@@ -765,10 +767,11 @@ function paraphrase(text2textInstructLLM::Function, text::String)
|
||||
]
|
||||
|
||||
# put in model format
|
||||
prompt = GeneralUtils.formatLLMtext(_prompt; formatname="qwen")
|
||||
prompt = GeneralUtils.formatLLMtext(_prompt, "granite3")
|
||||
|
||||
try
|
||||
response = text2textInstructLLM(prompt)
|
||||
response = GeneralUtils.deFormatLLMtext(response, "granite3")
|
||||
# sometime the model response like this "here's how I would respond: ..."
|
||||
if occursin("respond:", response)
|
||||
errornote = "You don't need to intro your response"
|
||||
@@ -984,7 +987,7 @@ end
|
||||
# ]
|
||||
|
||||
# # put in model format
|
||||
# prompt = GeneralUtils.formatLLMtext(_prompt; formatname="qwen")
|
||||
# prompt = GeneralUtils.formatLLMtext(_prompt, "granite3")
|
||||
# prompt *=
|
||||
# """
|
||||
# <|start_header_id|>assistant<|end_header_id|>
|
||||
|
||||
Reference in New Issue
Block a user