Commit 42a7d792 authored by myhloli's avatar myhloli

refactor(magic_pdf): import model helpers directly for clarity

Update import statements in `pdf_parse_union_core_v2.py` to directly import
`prepare_inputs`, `boxes2inputs`, and `parse_logits` from `magic_pdf.model.v3.helpers`
instead of from `magic_pdf.model.v3`. This change streamlines the imports, making the
code more readable and maintaining a cleaner approach to modular design.
parent 5522d0a3
......@@ -140,7 +140,7 @@ class ModelSingleton:
def do_predict(boxes: List[List[int]], model) -> List[int]:
from magic_pdf.model.v3 import prepare_inputs, boxes2inputs, parse_logits
from magic_pdf.model.v3.helpers import prepare_inputs, boxes2inputs, parse_logits
inputs = boxes2inputs(boxes)
inputs = prepare_inputs(inputs, model)
logits = model(**inputs).logits.cpu().squeeze(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment