Skip to content

Commit

Permalink
refactor(pdf_parse_union_core_v2): update import paths to use new pac…
Browse files Browse the repository at this point in the history
…kage structure

Adapt import statements in `pdf_parse_union_core_v2.py` to reflect the updated packagestructure, changing from the `magic_pdf.v3.helpers` module to the `magic_pdf.model.v3`
module. This ensures compatibility with the revised directory layout.
  • Loading branch information
myhloli committed Sep 28, 2024
1 parent 2145a8b commit 5522d0a
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 1 deletion.
Empty file added magic_pdf/model/v3/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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.v3.helpers import prepare_inputs, boxes2inputs, parse_logits
from magic_pdf.model.v3 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 5522d0a

Please sign in to comment.