Skip to content

Commit 822c3a5

Browse files
committed
Fix regex
1 parent bb0de70 commit 822c3a5

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/scripts/extract_benchmark_results.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
BENCHMARK_RESULTS_FILENAME = "benchmark_results.json"
2525
ARTIFACTS_FILENAME_REGEX = re.compile(r"(android|ios)-artifacts-(?P<job_id>\d+).json")
2626
BENCHMARK_CONFIG_REGEX = re.compile(
27-
r"# The benchmark config is (?P<benchmark_config>.+)"
27+
r"The benchmark config is (?P<benchmark_config>.+)"
2828
)
2929

3030
# iOS-related regexes and variables
@@ -337,7 +337,8 @@ def read_benchmark_config(
337337
try:
338338
with request.urlopen(artifact_s3_url) as data:
339339
for line in data.read().decode("utf8").splitlines():
340-
m = IOS_TEST_SPEC_REGEX.match(line)
340+
print(line)
341+
m = BENCHMARK_CONFIG_REGEX.match(line)
341342
if not m:
342343
continue
343344

@@ -356,6 +357,7 @@ def read_benchmark_config(
356357
except json.JSONDecodeError as e:
357358
warning(f"Fail to load benchmark config {filename}: {e}")
358359

360+
print(">>>>>>>")
359361
except error.HTTPError:
360362
warning(f"Fail to read the test spec output at {artifact_s3_url}")
361363

@@ -484,6 +486,9 @@ def main() -> None:
484486
benchmark_config = read_benchmark_config(
485487
artifact_s3_url, args.benchmark_configs
486488
)
489+
print(benchmark_config)
490+
491+
continue
487492

488493
if app_type == "ANDROID_APP":
489494
benchmark_results = extract_android_benchmark_results(

extension/benchmark/android/benchmark/android-llm-device-farm-test-spec.yml.j2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ phases:
88

99
pre_test:
1010
commands:
11-
# The benchmark config is {{ benchmark_config_id }}
11+
# Print this so that the upload script can read and process the benchmark config
12+
echo "The benchmark config is {{ benchmark_config_id }}"
1213

1314
# Download the model from S3
1415
- curl -s --fail '{{ model_path }}' -o model.zip

0 commit comments

Comments
 (0)