Skip to content

Commit

Permalink
Merge branch 'new-feat' of github.com:hellofinch/PDFMathTranslate int…
Browse files Browse the repository at this point in the history
…o new-feat
  • Loading branch information
xyzyx233 committed Jan 14, 2025
2 parents 3c95e4f + 80d0bea commit a9cad4f
Show file tree
Hide file tree
Showing 9 changed files with 506 additions and 25 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">

English | [简体中文](docs/README_zh-CN.md) | [日本語](docs/README_ja-JP.md)
English | [简体中文](docs/README_zh-CN.md) | [繁體中文](docs/README_zh-TW.md) | [日本語](docs/README_ja-JP.md)

<img src="./docs/images/banner.png" width="320px" alt="PDF2ZH"/>

Expand Down Expand Up @@ -165,6 +165,11 @@ The present program needs an AI model(`wybxc/DocLayout-YOLO-DocStructBench-onnx`
set HF_ENDPOINT=https://hf-mirror.com
```

For PowerShell user:
```shell
$env:HF_ENDPOINT = https://hf-mirror.com
```

If the solution does not work to you / you encountered other issues, please refer to [frequently asked questions](https://github.com/Byaidu/PDFMathTranslate/wiki#-faq--%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98).

<h2 id="usage">Advanced Options</h2>
Expand Down Expand Up @@ -195,6 +200,7 @@ In the following table, we list all advanced options for reference:
| `--serverport` | [Use Custom WebUI port] | `pdf2zh --serverport 7860` |
| `--dir` | [batch translate] | `pdf2zh --dir /path/to/translate/` |
| `--config` | [configuration file](https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#cofig) | `pdf2zh --config /path/to/config/config.json` |
| `--serverport` | [custom gradio server port] | `pdf2zh --serverport 7860` |

For detailed explanations, please refer to our document about [Advanced Usage](./docs/ADVANCED.md) for a full list of each option.

Expand Down
6 changes: 6 additions & 0 deletions docs/ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ set OPENAI_MODEL=gpt-4o-mini
pdf2zh example.pdf -s openai
```

For PowerShell user:
```shell
$env:OPENAI_MODEL = gpt-4o-mini
pdf2zh example.pdf -s openai
```

[⬆️ Back to top](#toc)

---
Expand Down
14 changes: 13 additions & 1 deletion docs/README_ja-JP.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">

[English](../README.md) | [简体中文](README_zh-CN.md) | 日本語
[English](../README.md) | [简体中文](README_zh-CN.md) | [繁體中文](README_zh-TW.md) | 日本語

<img src="./images/banner.png" width="320px" alt="PDF2ZH"/>

Expand Down Expand Up @@ -80,6 +80,11 @@ pdf2zhの実行には追加モデル(`wybxc/DocLayout-YOLO-DocStructBench-onnx
set HF_ENDPOINT=https://hf-mirror.com
```

For PowerShell user:
```shell
$env:HF_ENDPOINT = https://hf-mirror.com
```

<h3 id="cmd">方法1. コマンドライン</h3>

1. Pythonがインストールされていること (バージョン3.8 <= バージョン <= 3.12)
Expand Down Expand Up @@ -182,6 +187,7 @@ Python環境を事前にインストールする必要はありません
| `--serverport` | [カスタムWebUIポートを使用する] | `pdf2zh --serverport 7860` |
| `--dir` | [batch translate] | `pdf2zh --dir /path/to/translate/` |
| `--config` | [configuration file](https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#cofig) | `pdf2zh --config /path/to/config/config.json` |
| `--serverport` | [custom gradio server port] | `pdf2zh --serverport 7860` |

<h3 id="partial">全文または部分的なドキュメント翻訳</h3>

Expand Down Expand Up @@ -247,6 +253,12 @@ set OPENAI_MODEL=gpt-4o-mini
pdf2zh example.pdf -s openai
```
For PowerShell user:
```shell
$env:OPENAI_MODEL = gpt-4o-mini
pdf2zh example.pdf -s openai
```
<h3 id="exceptions">例外を指定して翻訳</h3>
正規表現を使用して保持する必要がある数式フォントと文字を指定します:
Expand Down
14 changes: 13 additions & 1 deletion docs/README_zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">

[English](../README.md) | 简体中文 | [日本語](README_ja-JP.md)
[English](../README.md) | 简体中文 | [繁體中文](README_zh-TW.md) | [日本語](README_ja-JP.md)

<img src="./images/banner.png" width="320px" alt="PDF2ZH"/>

Expand Down Expand Up @@ -82,6 +82,11 @@ pdf2zh的运行依赖于额外模型(`wybxc/DocLayout-YOLO-DocStructBench-onnx`)
set HF_ENDPOINT=https://hf-mirror.com
```

如使用 PowerShell,请使用如下方法设置环境变量:
```shell
$env:HF_ENDPOINT = https://hf-mirror.com
```

<h3 id="cmd">方法一、命令行工具</h3>

1. 确保安装了版本大于 3.8 且小于 3.12 的 Python
Expand Down Expand Up @@ -182,6 +187,7 @@ set HF_ENDPOINT=https://hf-mirror.com
| `--onnx` | [使用自定义的 DocLayout-YOLO ONNX 模型] | `pdf2zh --onnx [onnx/model/path]` |
| `--serverport` | [使用自定义的 WebUI 端口] | `pdf2zh --serverport 7860` |
| `--dir` | [文件夹翻译] | `pdf2zh --dir /path/to/translate/` |
| `--serverport` | [自定义端口号] | `pdf2zh --serverport 7860` |
| `--config` | [持久化定义配置文件](https://github.com/Byaidu/PDFMathTranslate/blob/main/docs/ADVANCED.md#cofig) | `pdf2zh --config /path/to/config/config.json` |


Expand Down Expand Up @@ -248,6 +254,12 @@ set OPENAI_MODEL=gpt-4o-mini
pdf2zh example.pdf -s openai
```
对于 PowerShell 用户,请使用如下方式设置环境变量指定模型:
```shell
$env:OPENAI_MODEL = gpt-4o-mini
pdf2zh example.pdf -s openai
```
<h3 id="exceptions">指定例外规则</h3>
使用正则表达式指定需保留的公式字体与字符:
Expand Down
Loading

0 comments on commit a9cad4f

Please sign in to comment.