Skip to content

Commit

Permalink
refactor(magic_pdf): import model helpers directly for clarity
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
myhloli committed Sep 28, 2024
1 parent 5522d0a commit 42a7d79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion magic_pdf/pdf_parse_union_core_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def get_model(self, model_name: str, local_path=None):


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)
Expand Down

0 comments on commit 42a7d79

Please sign in to comment.