Skip to content

Commit 868931c

Browse files
committed
more debugging
1 parent 832dd66 commit 868931c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/evaluation.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ def recursive_evaluation(responses, answers, chain, parser):
7878
for ans in list(remaining_answers): # Convert set to list for iteration
7979
eval_result = chain.invoke({"word": res, "target": ans})
8080
eval_result_content = eval_result.content
81+
print("eval_result_content: ", eval_result_content) #TODO: debugging
8182
similarity_result = parser.invoke(eval_result_content)
8283

83-
print("eval_result_content: ", eval_result_content, "; similarity_result: ", similarity_result, "; res: ", res, "; ans: ", ans) #TODO: debugging
84+
print("similarity_result: ", similarity_result, "; res: ", res, "; ans: ", ans) #TODO: debugging
8485

8586
if similarity_result == "True":
8687
matched_word = ans
@@ -117,7 +118,9 @@ def evaluation_function(response, answer, param=None):
117118
param = Param(**param)
118119

119120
# Initialize LLM
121+
print("Setting up LLM...") #TODO: debugging
120122
llm = setup_llm(param)
123+
print("LLM setup done") #TODO: debugging
121124

122125
# Define prompt template
123126
prompt_template = PromptTemplate(
@@ -174,7 +177,9 @@ def evaluation_function(response, answer, param=None):
174177
if not (isinstance(response, list) and all(isinstance(item, str) for item in response) and
175178
isinstance(answer, list) and all(isinstance(item, str) for item in answer)):
176179
return {"is_correct": False, "error": "Invalid input: response and answer must be lists of strings."}
177-
180+
print("Valid Inputs received: response: ", response, "; answer: ", answer) #TODO: debugging
181+
182+
print("Starting recursive evaluation...") #TODO: debugging
178183
is_correct, correct_answers, incorrect_answers = recursive_evaluation(response, answer, chain, parser)
179184
print("correct_answers: ", correct_answers, "; incorrect_answers: ", incorrect_answers) #TODO: debugging
180185

0 commit comments

Comments
 (0)