MCPcopy Create free account
hub / github.com/PaddlePaddle/Research / inference

Function inference

NLP/Text2SQL-BASELINE/text2sql/launch/infer.py:39–46  ·  view source on GitHub ↗
(model, data, output_path, beam_size=1, mode='infer', output_history=True, use_heuristic=True, model_name='seq2tree')

Source from the content-addressed store, hash-verified

37
38
39def inference(model, data, output_path, beam_size=1, mode='infer', output_history=True, use_heuristic=True, model_name='seq2tree'):
40 model.eval()
41 os.makedirs(os.path.dirname(output_path), exist_ok=True)
42 with paddle.no_grad(), open(output_path, 'w') as ofs:
43 if mode == 'infer':
44 _do_infer(model, data, beam_size, output_history, ofs, use_heuristic, model_name)
45 elif mode == 'debug':
46 _debug(model, data, ofs)
47
48
49def _do_infer(model, data, beam_size, output_history, ofs, use_heuristic=True, model_name='seq2tree'):

Callers

nothing calls this directly

Calls 3

_do_inferFunction · 0.85
_debugFunction · 0.85
evalMethod · 0.45

Tested by

no test coverage detected