Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions examples/government_rag/singletask_learning_bench/testenv/acc.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ def acc_model(y_true, y_pred):
"timestamp": datetime.now().strftime("%Y-%m-%d %H:%M:%S")
}

with open("accuracy_results_model.json", "w", encoding="utf-8") as f:
import os
output_dir = os.environ.get("IANVS_EVAL_WORKSPACE", ".")
output_path = os.path.join(output_dir, "accuracy_results_model.json")

with open(output_path, "w", encoding="utf-8") as f:
json.dump(results, f, ensure_ascii=False, indent=4)

return global_acc
Expand Down Expand Up @@ -143,7 +147,11 @@ def acc_global(y_true, y_pred):
"timestamp": datetime.now().strftime("%Y-%m-%d %H:%M:%S")
}

with open("accuracy_results_global.json", "w", encoding="utf-8") as f:
import os
output_dir = os.environ.get("IANVS_EVAL_WORKSPACE", ".")
output_path = os.path.join(output_dir, "accuracy_results_global.json")

with open(output_path, "w", encoding="utf-8") as f:
json.dump(results, f, ensure_ascii=False, indent=4)

return global_acc
Expand Down Expand Up @@ -204,7 +212,11 @@ def acc_local(y_true, y_pred):
"timestamp": datetime.now().strftime("%Y-%m-%d %H:%M:%S")
}

with open("accuracy_results_local.json", "w", encoding="utf-8") as f:
import os
output_dir = os.environ.get("IANVS_EVAL_WORKSPACE", ".")
output_path = os.path.join(output_dir, "accuracy_results_local.json")

with open(output_path, "w", encoding="utf-8") as f:
json.dump(results, f, ensure_ascii=False, indent=4)

return global_acc
Expand Down Expand Up @@ -265,7 +277,11 @@ def acc_other(y_true, y_pred):
"timestamp": datetime.now().strftime("%Y-%m-%d %H:%M:%S")
}

with open("accuracy_results_other.json", "w", encoding="utf-8") as f:
import os
output_dir = os.environ.get("IANVS_EVAL_WORKSPACE", ".")
output_path = os.path.join(output_dir, "accuracy_results_other.json")

with open(output_path, "w", encoding="utf-8") as f:
json.dump(results, f, ensure_ascii=False, indent=4)

return global_acc