MCPcopy Create free account
hub / github.com/Alibaba-NLP/ViDoRAG / build_option

Function build_option

scripts/ocr_triditional.py:87–102  ·  view source on GitHub ↗

Build FastDeploy runtime options based on backend and device.

()

Source from the content-addressed store, hash-verified

85 return res_text
86
87def build_option():
88 """Build FastDeploy runtime options based on backend and device."""
89 det_option = fd.RuntimeOption()
90 cls_option = fd.RuntimeOption()
91 rec_option = fd.RuntimeOption()
92
93 if BACKEND.lower() == "gpu":
94 det_option.use_gpu(DEVICE_ID)
95 cls_option.use_gpu(DEVICE_ID)
96 rec_option.use_gpu(DEVICE_ID)
97 else:
98 det_option.use_cpu()
99 cls_option.use_cpu()
100 rec_option.use_cpu()
101
102 return det_option, cls_option, rec_option
103
104
105# Build model file paths

Callers 1

ocr_triditional.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected