From e3ef9b202c40e680909e2d89af005a999111f298 Mon Sep 17 00:00:00 2001 From: myhloli Date: Wed, 17 Jul 2024 13:09:51 +0800 Subject: [PATCH] docs(readme): add link to FAQ for common issue resolution --- README_zh-CN.md | 9 +++++++-- docs/FAQ_zh_cn.md | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 docs/FAQ_zh_cn.md diff --git a/README_zh-CN.md b/README_zh-CN.md index e0e131b6..ed36ae7e 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -168,7 +168,7 @@ magic-pdf --help ```python image_writer = DiskReaderWriter(local_image_dir) image_dir = str(os.path.basename(local_image_dir)) -jso_useful_key = {"_pdf_type": "", "model_list": []} +jso_useful_key = {"_pdf_type": "", "model_list": model_json} pipe = UNIPipe(pdf_bytes, jso_useful_key, image_writer) pipe.pipe_classify() pipe.pipe_parse() @@ -181,7 +181,7 @@ s3pdf_cli = S3ReaderWriter(pdf_ak, pdf_sk, pdf_endpoint) image_dir = "s3://img_bucket/" s3image_cli = S3ReaderWriter(img_ak, img_sk, img_endpoint, parent_path=image_dir) pdf_bytes = s3pdf_cli.read(s3_pdf_path, mode=s3pdf_cli.MODE_BIN) -jso_useful_key = {"_pdf_type": "", "model_list": []} +jso_useful_key = {"_pdf_type": "", "model_list": model_json} pipe = UNIPipe(pdf_bytes, jso_useful_key, s3image_cli) pipe.pipe_classify() pipe.pipe_parse() @@ -191,6 +191,11 @@ md_content = pipe.pipe_mk_markdown(image_dir, drop_mode="none") 详细实现可参考 [demo.py](demo/demo.py) +### 常见问题处理解答 + +参考 [FAQ](docs/FAQ_zh_cn.md) + + # Magic-Doc diff --git a/docs/FAQ_zh_cn.md b/docs/FAQ_zh_cn.md new file mode 100644 index 00000000..80bb93f9 --- /dev/null +++ b/docs/FAQ_zh_cn.md @@ -0,0 +1,25 @@ +# 常见问题解答 + +##### 1.离线部署首次运行,报错urllib.error.URLError: + +首次运行需要在线下载一个小的语言检测模型,如果是离线部署需要手动下载该模型并放到指定目录。 +参考:https://github.com/opendatalab/MinerU/issues/121 + +##### 2.在较新版本的mac上使用命令安装pip install magic-pdf[full-cpu] zsh: no matches found: magic-pdf[full-cpu] + +在 macOS 上,默认的 shell 从 Bash 切换到了 Z shell,而 Z shell 对于某些类型的字符串匹配有特殊的处理逻辑,这可能导致no matches found错误。 +可以通过在命令行禁用globbing特性,再尝试运行安装命令 +```bash +setopt no_nomatch +pip install magic-pdf[full-cpu] +``` + +##### 3.在intel cpu 的mac上 安装最新版的 magic-pdf[full-cpu] (>=0.6.1) 不成功 + +完整功能包依赖的公式解析库unimernet限制了pytorch的最低版本为2.3.0,而pytorch官方没有为intel cpu的macOS 提供2.3.0版本的预编译包,所以会产生依赖不兼容的问题。 +可以先尝试安装unimernet的老版本之后再尝试安装完整功能包的其他依赖。(为避免依赖冲突,请激活一个全新的虚拟环境) +```bash +pip install magic-pdf +pip install unimernet==0.1.0 +pip install matplotlib ultralytics paddleocr==2.7.3 paddlepaddle +``` \ No newline at end of file