This commit is contained in:
narawat lamaiin
2025-04-25 21:12:27 +07:00
parent 48a3704f6d
commit 44804041a3
3 changed files with 81 additions and 58 deletions

View File

@@ -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|>