refactor: move k3_report_test.py to bash/case and make repo-root detection robust

This commit is contained in:
sora 2026-08-03 05:53:59 +00:00
parent cdfe59cbee
commit 863af5dd12
2 changed files with 39 additions and 3 deletions

25
bash/case/api_case.sh Normal file
View File

@ -0,0 +1,25 @@
curl -X POST https://api.vectron.meta-stone.com/v1/chat/completions \
-H "Authorization: Bearer sk-xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "ZhipuAi/GLM-5.2",
"messages": [
{
"role": "user",
"content": "Say hello in one sentence."
}
],
"thinking": {
"type": "disabled",
"type": "string",
"budget_tokens": 0
},
"extra_body": {
"thinking": {
"type": "disabled",
"type": "string",
"budget_tokens": 10
}
}
}'

View File

@ -31,7 +31,18 @@ import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parent
def _find_repo_root() -> Path:
"""向上查找,直到目录下存在 bash/run.py。"""
p = Path(__file__).resolve().parent
while p != p.parent:
if (p / "bash" / "run.py").exists():
return p
p = p.parent
# 兜底:脚本所在目录的上级(兼容放在 bash/case/ 的情况)
return Path(__file__).resolve().parent.parent
ROOT = _find_repo_root()
# ---------------------------------------------------------------------------
# Kimi K3 report -> evalscope dataset 映射
@ -192,8 +203,8 @@ def build_run_command(
sys.executable,
str(ROOT / "bash" / "run.py"),
"--datasets", dataset,
"--model", model,
"--api-url", api_url,
# "--model", model,
# "--api-url", api_url,
"--output-dir", output_dir,
"--folder-name", folder_name,
"--config", config,