This commit is contained in:
narawat lamaiin
2025-04-01 21:17:03 +07:00
parent bc0f735ab7
commit fd5ac82662
3 changed files with 25 additions and 22 deletions
+8 -8
View File
@@ -406,9 +406,9 @@ function getdata_decisionMaker(state::Dict, context::Dict, text2textInstructLLM:
]
# put in model format
prompt = GeneralUtils.formatLLMtext(_prompt; formatname="qwen")
prompt = GeneralUtils.formatLLMtext(_prompt; formatname="llama3instruct")
try
response = text2textInstructLLM(prompt)
response = text2textInstructLLM(prompt, modelsize="medium")
header = ["Comprehension:", "Plan:", "Code:"]
dictkey = ["comprehension", "plan", "code"]
@@ -627,12 +627,12 @@ function extractContent_dataframe(df::DataFrame, text2textInstructLLM::Function,
]
# put in model format
prompt = GeneralUtils.formatLLMtext(_prompt; formatname="qwen")
prompt = GeneralUtils.formatLLMtext(_prompt; formatname="llama3instruct")
header = ["About_resulting_table:", "Search_summary:"]
dictkey = ["about_resulting_table", "search_summary"]
for i in 1:5
response = text2textInstructLLM(prompt)
response = text2textInstructLLM(prompt, modelsize="medium")
kw = []
# use for loop and detect_keyword function to get the exact variation of each keyword in the text then push to kw list
@@ -762,13 +762,13 @@ function getTableNameFromSQL(sql::T, text2textInstructLLM::Function)::Vector{Str
]
# put in model format
prompt = GeneralUtils.formatLLMtext(_prompt; formatname="qwen")
prompt = GeneralUtils.formatLLMtext(_prompt; formatname="llama3instruct")
header = ["Table_name:"]
dictkey = ["table_name"]
for attempt in 1:5
try
response = text2textInstructLLM(prompt)
response = text2textInstructLLM(prompt, modelsize="medium")
responsedict = GeneralUtils.textToDict(response, header;
dictKey=dictkey, symbolkey=true)
response = copy(JSON3.read(responsedict[:table_name]))
@@ -914,12 +914,12 @@ function compareState(question::String, highValueStateList::Vector{T},
]
# put in model format
prompt = GeneralUtils.formatLLMtext(_prompt; formatname="qwen")
prompt = GeneralUtils.formatLLMtext(_prompt; formatname="llama3instruct")
header = ["Comparison:", "Rationale:", "Selected_response_number:"]
dictkey = ["comparison", "rationale", "selected_response_number"]
response = text2textInstructLLM(prompt)
response = text2textInstructLLM(prompt, modelsize="medium")
# sometime LLM output something like **Comprehension**: which is not expected
response = replace(response, "**"=>"")