mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 09:25:06 +01:00
Only evaluate non-empty responses to reduce eval script latency, cost
Empty responses by Khoj will always be an incorrect response, so no need to make call to an evaluator agent to check that
This commit is contained in:
parent
ceb29eae74
commit
84a8088c2b
1 changed files with 5 additions and 1 deletions
|
@ -113,6 +113,10 @@ def process_batch(batch, counter, results, dataset_length):
|
|||
agent_response = get_agent_response(prompt)
|
||||
|
||||
# Evaluate response
|
||||
if agent_response is None or agent_response.strip() == "":
|
||||
evaluation["decision"] = False
|
||||
evaluation["explanation"] = "Agent response is empty. This maybe due to a service error."
|
||||
else:
|
||||
evaluation = evaluate_response(prompt, agent_response, answer)
|
||||
|
||||
# Store results
|
||||
|
|
Loading…
Reference in a new issue