Upload folder using huggingface_hub (part 2)
Browse files- 20260907-fdsn-replacement-0014/tests/test.sh +29 -0
- dataset.toml +0 -0
20260907-fdsn-replacement-0014/tests/test.sh
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
set -u
|
| 3 |
+
|
| 4 |
+
TESTS_DIR="${HARBOR_TESTS_DIR:-/tests}"
|
| 5 |
+
WORKSPACE_DIR="${HARBOR_WORKSPACE_DIR:-/workspace}"
|
| 6 |
+
LOGS_DIR="${HARBOR_LOGS_DIR:-/logs/verifier}"
|
| 7 |
+
|
| 8 |
+
mkdir -p "${LOGS_DIR}" "${WORKSPACE_DIR}/output"
|
| 9 |
+
|
| 10 |
+
python "${TESTS_DIR}/evaluator_runner.py" \
|
| 11 |
+
--output-dir "${WORKSPACE_DIR}/output" \
|
| 12 |
+
--reference-dir "${TESTS_DIR}/reference" \
|
| 13 |
+
--reward-json "${LOGS_DIR}/reward.json" \
|
| 14 |
+
--details-json "${LOGS_DIR}/ale_evaluator_details.json"
|
| 15 |
+
|
| 16 |
+
if [ ! -f "${LOGS_DIR}/reward.json" ]; then
|
| 17 |
+
echo '{"score":0.0,"format":0.0,"output_present":0.0,"evaluator_available":0.0,"item_count":0.0}' > "${LOGS_DIR}/reward.json"
|
| 18 |
+
fi
|
| 19 |
+
|
| 20 |
+
python - <<'PY' "${LOGS_DIR}/reward.json" "${LOGS_DIR}/reward.txt"
|
| 21 |
+
import json
|
| 22 |
+
import sys
|
| 23 |
+
from pathlib import Path
|
| 24 |
+
reward = json.loads(Path(sys.argv[1]).read_text(encoding="utf-8"))
|
| 25 |
+
score = float(reward.get("score", 0.0))
|
| 26 |
+
Path(sys.argv[2]).write_text(f"{score}\n", encoding="utf-8")
|
| 27 |
+
PY
|
| 28 |
+
|
| 29 |
+
exit 0
|
dataset.toml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|