Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make logging output dir user-specific #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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