Spaces:
Runtime error
Runtime error
LightChen2333
commited on
Commit
•
ff323e2
1
Parent(s):
c858e02
Update common/logger.py
Browse files- common/logger.py +6 -6
common/logger.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Author: Qiguang Chen
|
3 |
Date: 2023-01-11 10:39:26
|
4 |
LastEditors: Qiguang Chen
|
5 |
-
LastEditTime: 2023-02-
|
6 |
Description: log manager
|
7 |
|
8 |
'''
|
@@ -40,7 +40,7 @@ class Logger():
|
|
40 |
"""
|
41 |
self.logger_type = logger_type
|
42 |
times = time.localtime()
|
43 |
-
self.output_dir = "logs/" + logger_name + "/" +
|
44 |
self.accelerator = accelerator
|
45 |
self.logger_name = logger_name
|
46 |
if accelerator is not None:
|
@@ -59,19 +59,19 @@ class Logger():
|
|
59 |
self.logger.set_log_dir("logs/" + logger_name)
|
60 |
else:
|
61 |
mkdirs(["logs", "logs/" + logger_name, self.output_dir])
|
62 |
-
self.config_file = os.path.join(self.output_dir, "
|
63 |
with open(self.config_file, "w", encoding="utf8") as f:
|
64 |
print(f"Config will be written to {self.config_file}")
|
65 |
|
66 |
-
self.loss_file = os.path.join(self.output_dir, "
|
67 |
with open(self.loss_file, "w", encoding="utf8") as f:
|
68 |
print(f"Loss Result will be written to {self.loss_file}")
|
69 |
|
70 |
-
self.metric_file = os.path.join(self.output_dir, "
|
71 |
with open(self.metric_file, "w", encoding="utf8") as f:
|
72 |
print(f"Metric Result will be written to {self.metric_file}")
|
73 |
|
74 |
-
self.other_log_file = os.path.join(self.output_dir, "
|
75 |
with open(self.other_log_file, "w", encoding="utf8") as f:
|
76 |
print(f"Other Log Result will be written to {self.other_log_file}")
|
77 |
|
|
|
2 |
Author: Qiguang Chen
|
3 |
Date: 2023-01-11 10:39:26
|
4 |
LastEditors: Qiguang Chen
|
5 |
+
LastEditTime: 2023-02-19 22:05:49
|
6 |
Description: log manager
|
7 |
|
8 |
'''
|
|
|
40 |
"""
|
41 |
self.logger_type = logger_type
|
42 |
times = time.localtime()
|
43 |
+
self.output_dir = "logs/" + logger_name + "/" + start_time
|
44 |
self.accelerator = accelerator
|
45 |
self.logger_name = logger_name
|
46 |
if accelerator is not None:
|
|
|
59 |
self.logger.set_log_dir("logs/" + logger_name)
|
60 |
else:
|
61 |
mkdirs(["logs", "logs/" + logger_name, self.output_dir])
|
62 |
+
self.config_file = os.path.join(self.output_dir, "config.jsonl")
|
63 |
with open(self.config_file, "w", encoding="utf8") as f:
|
64 |
print(f"Config will be written to {self.config_file}")
|
65 |
|
66 |
+
self.loss_file = os.path.join(self.output_dir, "loss.jsonl")
|
67 |
with open(self.loss_file, "w", encoding="utf8") as f:
|
68 |
print(f"Loss Result will be written to {self.loss_file}")
|
69 |
|
70 |
+
self.metric_file = os.path.join(self.output_dir, "metric.jsonl")
|
71 |
with open(self.metric_file, "w", encoding="utf8") as f:
|
72 |
print(f"Metric Result will be written to {self.metric_file}")
|
73 |
|
74 |
+
self.other_log_file = os.path.join(self.output_dir, "other_log.jsonl")
|
75 |
with open(self.other_log_file, "w", encoding="utf8") as f:
|
76 |
print(f"Other Log Result will be written to {self.other_log_file}")
|
77 |
|