Skip to content

Commit 39cb09a

Browse files
committed
Sort after sample
1 parent 12c8bde commit 39cb09a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cometx/cli/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,10 @@ def log_tensorboard_folder_assets(workspace, project_name, full_path):
237237
{"value": value, "step": step, "wall_time": wall_time}
238238
)
239239
if len(data) > 15_000:
240-
data = random.sample(data, 15_000)
240+
data = sorted(
241+
random.sample(data, 15_000),
242+
key=lambda item: item["step"],
243+
)
241244
for row in data:
242245
experiment.log_metric(
243246
f"{subdir}/{metric_name}",

0 commit comments

Comments
 (0)