Nodiw52992 commited on
Commit
d8a701a
·
verified ·
1 Parent(s): 93edcef

Update manager.py

Browse files
Files changed (1) hide show
  1. manager.py +12 -0
manager.py CHANGED
@@ -12,6 +12,18 @@ LR, CLIP_EPS, VF_COEFF, ENT_COEFF = 3e-4, 0.2, 0.5, 0.01
12
  CKPT_PATH = "ckpt.zst"
13
  CKPT_FREQ = 100
14
  LOG_DIR = "logs"
 
 
 
 
 
 
 
 
 
 
 
 
15
  DEVICE = "cpu"
16
  MANAGER_HOST = "0.0.0.0"
17
  MANAGER_PORT = 7860
 
12
  CKPT_PATH = "ckpt.zst"
13
  CKPT_FREQ = 100
14
  LOG_DIR = "logs"
15
+
16
+ # Try main logs dir
17
+ try:
18
+ os.makedirs(LOG_DIR, exist_ok=True)
19
+ with open(os.path.join(LOG_DIR, "test_write"), "w") as f:
20
+ f.write("ok")
21
+ os.remove(os.path.join(LOG_DIR, "test_write"))
22
+ except Exception:
23
+ LOG_DIR = "/tmp/logs"
24
+ os.makedirs(LOG_DIR, exist_ok=True)
25
+
26
+ writer = SummaryWriter(LOG_DIR)
27
  DEVICE = "cpu"
28
  MANAGER_HOST = "0.0.0.0"
29
  MANAGER_PORT = 7860