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