Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion mlxu/logging.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import random
import string
import tempfile
import time
import uuid
Expand All @@ -20,11 +21,18 @@
class WandBLogger(object):
@staticmethod
def get_default_config(updates=None):
# grab username and perform filtering to prevent code injection
username = os.environ["USER"]
username = [
c for c in username if c in string.ascii_letters + string.digits + "_-"
]
username = "".join(username[:32]) # usernames are limited to 32 chars

config = config_dict()
config.online = False
config.prefix = ""
config.project = "mlxu"
config.output_dir = "/tmp/mlxu"
config.output_dir = f"/tmp/mlxu-{username}"
config.wandb_dir = ""
config.random_delay = 0.0
config.experiment_id = config_placeholder(str)
Expand Down