Skip to content

Commit

Permalink
Handle the case where output file does not exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzhao9 committed Jun 27, 2024
1 parent 3c3544a commit fe9a9b7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion userbenchmark/torchao/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import csv
import subprocess
import warnings
from pathlib import Path
from typing import List

Expand Down Expand Up @@ -33,7 +34,11 @@ def post_ci_process(output_files: List[str]):
head_repo = "pytorch/ao"
head_branch = "main"
head_sha = _get_torchao_head_sha()
print(f"Processing file {path} ")
print(f"Processing file {path} ...")
# When the test fails to run or crashes, the output file does not exist.
if not path.exists():
warnings.warn(f"Expected output file {path} does not exist.")
continue
with open(path) as csvfile:
reader = csv.DictReader(csvfile, delimiter=",")

Expand Down

0 comments on commit fe9a9b7

Please sign in to comment.