Skip to content
Open
Changes from all commits
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
9 changes: 8 additions & 1 deletion src/harbor_adapter/template/tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ if [ -f "$LOGS_DIR/metrics.json" ]; then
cat "$LOGS_DIR/metrics.json"

# Try to extract accuracy from the metrics JSON
PARSE_ERROR_LOG="$LOGS_DIR/metrics_parse_error.txt"
ACCURACY=$(python3 -c "
import json
try:
Expand All @@ -297,7 +298,13 @@ try:
except Exception as e:
print(f'Error parsing metrics: {e}', file=__import__('sys').stderr)
print(0)
" 2>&1)
" 2>"$PARSE_ERROR_LOG")

if [ -s "$PARSE_ERROR_LOG" ]; then
cat "$PARSE_ERROR_LOG" >&2
else
rm -f "$PARSE_ERROR_LOG"
fi

echo "Accuracy: $ACCURACY"
echo "$ACCURACY" > "$LOGS_DIR/reward.txt"
Expand Down