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

Method begin_inference

rat-sql-gap/seq2struct/models/enc_dec.py:117–136  ·  view source on GitHub ↗
(self, orig_item, preproc_item)

Source from the content-addressed store, hash-verified

115 return result
116
117 def begin_inference(self, orig_item, preproc_item):
118 ## TODO: Don't hardcode train
119 #valid, validation_info = self.preproc.enc_preproc.validate_item(item, 'train')
120 #if not valid:
121 # return None
122 #enc_input = self.preproc.enc_preproc.preprocess_item(item, validation_info)
123
124 enc_input, _ = preproc_item
125 if self.decoder.visualize_flag:
126 print('question:')
127 print(enc_input['question'])
128 print('columns:')
129 print(enc_input['columns'])
130 print('tables:')
131 print(enc_input['tables'])
132 if getattr(self.encoder, 'batched'):
133 enc_state, = self.encoder([enc_input])
134 else:
135 enc_state = self.encoder(enc_input)
136 return self.decoder.begin_inference(enc_state, orig_item)

Callers 1

beam_searchFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected