MCPcopy Create free account
hub / github.com/awslabs/gap-text2sql / log

Method log

rat-sql-gap/seq2struct/commands/train.py:62–74  ·  view source on GitHub ↗
(self, msg)

Source from the content-addressed store, hash-verified

60 self.log_file = open(log_path, 'a+')
61
62 def log(self, msg):
63 formatted = '[{}] {}'.format(
64 datetime.datetime.now().replace(microsecond=0).isoformat(),
65 msg)
66 print(formatted)
67 if self.log_file:
68 self.log_file.write(formatted + '\n')
69 if self.reopen_to_flush:
70 log_path = self.log_file.name
71 self.log_file.close()
72 self.log_file = open(log_path, 'a+')
73 else:
74 self.log_file.flush()
75
76class Trainer:
77 def __init__(self, logger, config):

Callers 11

mainFunction · 0.95
print_2d_tensorFunction · 0.80
entropyFunction · 0.80
masked_log_softmaxFunction · 0.80
logsumexpFunction · 0.80
_logMethod · 0.80
_logMethod · 0.80
trainMethod · 0.80
_eval_modelMethod · 0.80
compute_align_lossFunction · 0.80

Calls 1

closeMethod · 0.80

Tested by

no test coverage detected