Skip to content

Commit aa60684

Browse files
authored
feat(agent): fix the "task_id" TypeError when testing xbench-ds (#96)
* fix the bug of testing xbench
1 parent de2a366 commit aa60684

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

common_benchmark.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,13 @@ async def entrypoint(cfg: DictConfig) -> float:
594594

595595
def parse_func(x: str) -> BenchmarkTask:
596596
data = json.loads(x)
597+
if isinstance(data.get("task_id"), (str, bytes, os.PathLike)) is False:
598+
try:
599+
data["task_id"] = str(data["task_id"])
600+
except TypeError:
601+
raise TypeError(
602+
"expected task_id to be a string, bytes or os.PathLike object"
603+
)
597604
return BenchmarkTask(
598605
task_id=data["task_id"],
599606
task_question=data["task_question"],

0 commit comments

Comments
 (0)