From 0248aba8def4e6cd108cac4692122725259b4098 Mon Sep 17 00:00:00 2001 From: openhands Date: Wed, 2 Oct 2024 03:54:30 +0000 Subject: [PATCH] Fix issue #4157: '[Bug]: Sandbox image build failed on eval' --- evaluation/swe_bench/eval_infer.py | 6 ++++++ evaluation/swe_bench/run_infer.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/evaluation/swe_bench/eval_infer.py b/evaluation/swe_bench/eval_infer.py index 525bc17e9701..0321cb8a7e34 100644 --- a/evaluation/swe_bench/eval_infer.py +++ b/evaluation/swe_bench/eval_infer.py @@ -1,4 +1,5 @@ import os +import platform import tempfile import time @@ -303,6 +304,11 @@ def process_instance( ) args, _ = parser.parse_known_args() + # Check if the processor is arm64 + if platform.machine() == 'arm64': + logger.error("SWE-bench evaluation is not supported on arm64 processors.") + raise SystemExit("Evaluation aborted: arm64 processor detected.") + # Load SWE-Bench dataset full_dataset: list[SWEbenchInstance] = load_swebench_dataset( args.dataset, args.split diff --git a/evaluation/swe_bench/run_infer.py b/evaluation/swe_bench/run_infer.py index 62333662c583..92417360d06e 100644 --- a/evaluation/swe_bench/run_infer.py +++ b/evaluation/swe_bench/run_infer.py @@ -2,6 +2,7 @@ import json import os import tempfile +import platform from typing import Any import pandas as pd @@ -435,6 +436,11 @@ def filter_dataset(dataset: pd.DataFrame, filter_column: str) -> pd.DataFrame: ) args, _ = parser.parse_known_args() + # Check if the processor is arm64 + if platform.machine() == 'arm64': + logger.error("SWE-bench evaluation is not supported on arm64 processors.") + raise SystemExit("Evaluation aborted: arm64 processor detected.") + # NOTE: It is preferable to load datasets from huggingface datasets and perform post-processing # so we don't need to manage file uploading to OpenHands's repo dataset = load_dataset(args.dataset, split=args.split)