Refactor: Use IANVS_EVAL_WORKSPACE for evaluating metric artifact paths#386
Refactor: Use IANVS_EVAL_WORKSPACE for evaluating metric artifact paths#386ARYANPATEL-BIT wants to merge 2 commits intokubeedge:mainfrom
Conversation
Signed-off-by: Aryan Patel <aryan.patel7291@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ARYANPATEL-BIT The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Code Review
This pull request updates the accuracy evaluation script to support a configurable workspace directory via the IANVS_EVAL_WORKSPACE environment variable across multiple functions. Feedback highlights that the implementation lacks directory creation logic, which will cause a FileNotFoundError if the specified workspace does not exist. Additionally, it is recommended to refactor the duplicated file-saving logic into a shared helper function to improve code maintainability.
examples/government_rag/singletask_learning_bench/testenv/acc.py
Outdated
Show resolved
Hide resolved
examples/government_rag/singletask_learning_bench/testenv/acc.py
Outdated
Show resolved
Hide resolved
examples/government_rag/singletask_learning_bench/testenv/acc.py
Outdated
Show resolved
Hide resolved
examples/government_rag/singletask_learning_bench/testenv/acc.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Aryan Patel <aryan.patel7291@gmail.com>
|
/assign @jaypume |
Refactor: Use dynamic EVAL_WORKSPACE for metric artifact paths
🎯 Fixes
**Fixes #385 **
🚨 The Problem
Current hardcoded paths in
government_ragevaluation (acc.py):Impact:
benchmarkingjob.yamlworkspace structure✅ The Solution
Dynamic workspace resolution using
IANVS_EVAL_WORKSPACE:📁 Before vs After
model./accuracy_results_model.json./workspace/accuracy_results_model.jsonglobal./accuracy_results_global.json./workspace/accuracy_results_global.jsonlocal./accuracy_results_local.json./workspace/accuracy_results_local.jsonother./accuracy_results_other.json./workspace/accuracy_results_other.json💾 Complete Refactored Function
🧪 Verification
🎉 Benefits
| ✅ Clean | Root directory stays pristine |
| ✅ Isolated | Each job iteration has own workspace |
| ✅ Compatible | Falls back to
"."if no env var || ✅ Scalable | Works with KubeEdge-Ianvs at scale |
Status: Ready to merge - Proper workspace integration for production benchmarking! 🚀