Skip to content

Commit

Permalink
Use str rep of the OSError
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzhao9 committed Dec 18, 2023
1 parent 204b6ac commit 6bccbf3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions userbenchmark/test_bench/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def run_config(config: TorchBenchModelConfig, metrics: List[str], dryrun: bool=F
print(" [oserror]", flush=True)
result = {}
for metric in metrics:
result[metric] = e
result[metric] = str(e)
return result

def run_config_accuracy(config: TorchBenchModelConfig, metrics: List[str], dryrun: bool=False) -> Dict[str, str]:
Expand All @@ -143,7 +143,7 @@ def run_config_accuracy(config: TorchBenchModelConfig, metrics: List[str], dryru
return {"accuracy": "not_implemented"}
except OSError as e:
print(" [oserror]", flush=True)
return {"accuracy": f"{e.__str__}"}
return {"accuracy": str(e)}

def parse_known_args(args):
parser = argparse.ArgumentParser()
Expand Down

0 comments on commit 6bccbf3

Please sign in to comment.