MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / predict

Method predict

benchmarks/paddleocr_vl/benchmark.py:23–36  ·  view source on GitHub ↗
(self, task_info, batch_data)

Source from the content-addressed store, hash-verified

21
22class Predictor(object):
23 def predict(self, task_info, batch_data):
24 task_info["start_time"] = get_curr_time()
25 try:
26 markdown, num_pages = self._predict(batch_data)
27 except Exception as e:
28 task_info["successful"] = False
29 print(e)
30 raise
31 finally:
32 task_info["end_time"] = get_curr_time()
33 task_info["successful"] = True
34 task_info["processed_pages"] = num_pages
35 task_info["generated_tokens"] = len(encoding.encode(markdown))
36 return markdown
37
38 def _predict(self, batch_data):
39 raise NotImplementedError

Callers 3

test_image_parseMethod · 0.80
_predictMethod · 0.80
benchmark.pyFile · 0.80

Calls 4

_predictMethod · 0.95
get_curr_timeFunction · 0.85
printFunction · 0.85
encodeMethod · 0.45

Tested by 1

test_image_parseMethod · 0.64