Commit 54f31b65 authored by 赵小蒙's avatar 赵小蒙

update cli

parent 4ce15c44
......@@ -98,12 +98,13 @@ def _do_parse(pdf_file_name, pdf_bytes, model_list, parse_method, image_writer,
@click.group()
@click.version_option(__version__, "--version", "-v", help="显示版本信息")
@click.help_option("--help", "-h", help="显示帮助信息")
def cli():
pass
@cli.command()
@click.version_option(__version__, "--version", "-v", help="显示版本信息")
@click.option("--json", type=str, help="输入一个S3路径")
@click.option(
"--method",
......@@ -143,7 +144,7 @@ def json_command(json, method):
pdf_file_name = Path(s3_file_path).stem
pdf_data = read_s3_path(s3_file_path)
local_image_dir, local_md_dir = prepare_env(pdf_file_name, method)
local_image_rw, local_md_rw = DiskReaderWriter(local_image_dir), DiskReaderWriter(
local_md_dir
)
......@@ -161,7 +162,6 @@ def json_command(json, method):
@cli.command()
@click.version_option(__version__, "--version", "-v", help="显示版本信息")
@click.option("--local_json", type=str, help="输入一个本地jsonl路径")
@click.option(
"--method",
......@@ -218,7 +218,6 @@ def local_json_command(local_json, method):
@cli.command()
@click.version_option(__version__, "--version", "-v", help="显示版本信息")
@click.option(
"--pdf", type=click.Path(exists=True), required=True, help="PDF文件的路径"
)
......@@ -260,7 +259,6 @@ def pdf_command(pdf, model, method):
)
if __name__ == "__main__":
"""
python magic_pdf/cli/magicpdf.py json-command --json s3://llm-pdf-text/pdf_ebook_and_paper/manual/v001/part-660407a28beb-000002.jsonl?bytes=0,63551
......
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