MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / print_single_query

Function print_single_query

demo/BERT/inference_varseqlen.py:216–222  ·  view source on GitHub ↗
(eval_time_elapsed, prediction, nbest_json)

Source from the content-addressed store, hash-verified

214 return eval_time_elapsed, prediction, nbest_json
215
216 def print_single_query(eval_time_elapsed, prediction, nbest_json):
217 print("------------------------")
218 print("Running inference in {:.3f} Sentences/Sec".format(1/eval_time_elapsed))
219 print("------------------------")
220
221 print("Answer: '{}'".format(prediction))
222 print("With probability: {:.3f}".format(nbest_json[0]['probability'] * 100.0))
223
224 if squad_examples:
225 all_predictions = collections.OrderedDict()

Callers 1

Calls 1

printFunction · 0.85

Tested by

no test coverage detected