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

Method _debug

rat-sql-gap/seq2struct/commands/infer.py:143–151  ·  view source on GitHub ↗
(self, model, sliced_data, output)

Source from the content-addressed store, hash-verified

141
142
143 def _debug(self, model, sliced_data, output):
144 for i, item in enumerate(tqdm.tqdm(sliced_data)):
145 (_, history), = model.compute_loss([item], debug=True)
146 output.write(
147 json.dumps({
148 'index': i,
149 'history': history,
150 }) + '\n')
151 output.flush()
152
153 def _visualize_attention(self, model, beam_size, output_history, sliced_data, res1file, res2file, res3file, output):
154 res1 = json.load(open(res1file, 'r'))

Callers 1

inferMethod · 0.95

Calls 1

compute_lossMethod · 0.45

Tested by

no test coverage detected