Skip to content

Commit

Permalink
修复init错误
Browse files Browse the repository at this point in the history
  • Loading branch information
myhloli committed Mar 29, 2024
1 parent 4b8dbd7 commit 016cde3
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ tmp
ocr_demo

/app/common/__init__.py
/magic_pdf/spark/__init__.py
/magic_pdf/config/__init__.py
1 change: 0 additions & 1 deletion demo/ocr_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
make_standard_format_with_para
)
from magic_pdf.libs.commons import join_path, read_file
from magic_pdf.pdf_parse_by_ocr import parse_pdf_by_ocr


def save_markdown(markdown_text, input_filepath):
Expand Down
4 changes: 2 additions & 2 deletions magic_pdf/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
from loguru import logger

from magic_pdf.pdf_parse_for_train import parse_pdf_for_train
from magic_pdf.spark.base import exception_handler, get_data_source, get_bookname, get_pdf_bytes
from magic_pdf.spark import exception_handler, get_data_source
from magic_pdf.train_utils.convert_to_train_format import convert_to_train_format
from magic_pdf.spark.s3 import get_s3_config, get_s3_client
from magic_pdf.spark import get_s3_config, get_s3_client



Expand Down
2 changes: 1 addition & 1 deletion magic_pdf/pipeline_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from magic_pdf.dict2md.mkcontent import mk_mm_markdown, mk_universal_format
from magic_pdf.libs.commons import join_path
from magic_pdf.libs.json_compressor import JsonCompressor
from magic_pdf.spark.base import exception_handler, get_data_source
from magic_pdf.spark import exception_handler, get_data_source


def txt_pdf_to_standard_format(jso: dict, debug_mode=False) -> dict:
Expand Down
Empty file added magic_pdf/spark/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion magic_pdf/spark/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
try:
from app.config import s3_buckets, s3_clusters, get_cluster_name, s3_users
except ImportError:
from magic_pdf.spark import s3_buckets, s3_clusters, get_cluster_name, s3_users
from magic_pdf.config import s3_buckets, s3_clusters, get_cluster_name, s3_users

__re_s3_path = re.compile("^s3a?://([^/]+)(?:/(.*))?$")
def get_s3_config(path: Union[str, List[str]], outside=False):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
from magic_pdf.libs.commons import fitz

from magic_pdf.spark.s3 import get_s3_config, get_s3_client
from magic_pdf.spark import get_s3_config, get_s3_client
from magic_pdf.libs.commons import join_path, json_dump_path, read_file, parse_bucket_key
from loguru import logger

Expand Down

0 comments on commit 016cde3

Please sign in to comment.