mirror of
https://github.com/opendatalab/MinerU.git
synced 2026-09-24 23:10:23 +08:00
fix(pdf-extract): ensure model is set to evaluation mode before processing
Add model.eval() invocation to pdf_extract_kit initialization sequence to ensure the model is set to evaluation mode. This is critical for proper inference and performance metrics when processing PDF content.
This commit is contained in:
@@ -64,6 +64,7 @@ def mfr_model_init(weight_dir, cfg_path, _device_='cpu'):
|
||||
task = tasks.setup_task(cfg)
|
||||
model = task.build_model(cfg)
|
||||
model = model.to(_device_)
|
||||
model.eval()
|
||||
vis_processor = load_processor('formula_image_eval', cfg.config.datasets.formula_rec_eval.vis_processor.eval)
|
||||
mfr_transform = transforms.Compose([vis_processor, ])
|
||||
return [model, mfr_transform]
|
||||
|
||||
Reference in New Issue
Block a user