Spaces:
Running
Running
Jae-Won Chung
commited on
Commit
•
176e245
1
Parent(s):
94f739f
Do not makedir when there is no dir
Browse files
scripts/compute_metrics.py
CHANGED
@@ -10,7 +10,8 @@ def main(data_dir: str, out_file: str) -> None:
|
|
10 |
model_names = os.listdir(data_dir)
|
11 |
print(f"{model_names=}")
|
12 |
|
13 |
-
os.
|
|
|
14 |
out_csv = csv.writer(open(out_file, "w", newline=""))
|
15 |
metrics = ["throughput", "response_length", "latency", "energy"]
|
16 |
out_csv.writerow(["model"] + metrics)
|
|
|
10 |
model_names = os.listdir(data_dir)
|
11 |
print(f"{model_names=}")
|
12 |
|
13 |
+
if dirname := os.path.dirname(out_file):
|
14 |
+
os.makedirs(dirname, exist_ok=True)
|
15 |
out_csv = csv.writer(open(out_file, "w", newline=""))
|
16 |
metrics = ["throughput", "response_length", "latency", "energy"]
|
17 |
out_csv.writerow(["model"] + metrics)
|