Skip to content

Commit 18a3a1d

Browse files
authored
build system for docs (#1404)
1 parent a1b067e commit 18a3a1d

31 files changed

+372
-175
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ __pycache__/
77
output
88
demo_data/index-cache
99
log
10+
docs/site/
11+
uv.lock

.readthedocs.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version, and other tools you might need
8+
build:
9+
os: ubuntu-24.04
10+
tools:
11+
python: "3.13"
12+
13+
# Build documentation with Mkdocs
14+
mkdocs:
15+
configuration: docs/mkdocs.yml
16+
17+
# Optionally, but recommended,
18+
# declare the Python requirements required to build your documentation
19+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
20+
python:
21+
install:
22+
- requirements: docs/requirements.txt

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[ERNIE Bot](https://ernie.baidu.com/) | [🤗Hugging Face](https://huggingface.co/baidu) | [AI Studio](https://aistudio.baidu.com/modelsoverview)
88

9-
📑 [Blog](https://yiyan.baidu.com/blog/posts/ernie4.5) | 📚 [Cookbook](./cookbook/) | 📑 [Paper](https://yiyan.baidu.com/blog/publication/) | 🛠️ [Training](./docs/erniekit.md) | ⚡️ [Deploy](https://github.com/PaddlePaddle/FastDeploy)
9+
📑 [Blog](https://yiyan.baidu.com/blog/posts/ernie4.5) | 📚 [Cookbook](./cookbook/) | 📑 [Paper](https://yiyan.baidu.com/blog/publication/) | 🛠️ [Training](./docs/source/erniekit.md) | ⚡️ [Deploy](https://github.com/PaddlePaddle/FastDeploy)
1010

1111
<a href="https://trendshift.io/repositories/14169" target="_blank"><img src="https://trendshift.io/api/badge/repositories/14169" alt="PaddlePaddle%2FERNIE | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
1212

@@ -22,7 +22,7 @@
2222
**[2025-10] 🔥 Released ERNIEKit v1.4:**
2323

2424
- **New Features**
25-
- VL Model Training: Support SFT for [PaddleOCR-VL-0.9B]((https://huggingface.co/PaddlePaddle/PaddleOCR-VL/tree/main/PaddleOCR-VL-0.9B)) model. More details in [PaddleOCR-VL-0.9B SFT](./docs/paddleocr_vl_sft.md).
25+
- VL Model Training: Support SFT for [PaddleOCR-VL-0.9B]((https://huggingface.co/PaddlePaddle/PaddleOCR-VL/tree/main/PaddleOCR-VL-0.9B)) model. More details in [PaddleOCR-VL-0.9B SFT](./docs/source/paddleocr_vl_sft.md).
2626
- Dataflow : Support padding-free startegy.
2727
- Packing data within a batch into a sequence to avoid padding, thereby reducing GPU memory usage and accelerating training.
2828

@@ -178,7 +178,7 @@ In the non-thinking mode, ERNIE-4.5-VL exhibits outstanding proficiency in visua
178178

179179
## Model Development
180180

181-
ERNIE 4.5 models are trained and deployed for inference using the [PaddlePaddle]((https://github.com/PaddlePaddle/Paddle)) framework. The full workflow of training, compression, and inference for ERNIE 4.5 is supported through the [ERNIEKit](./docs/erniekit.md) and [FastDeploy](https://github.com/PaddlePaddle/FastDeploy) toolkit. The table below details the feature matrix of the ERNIE 4.5 model family for training and inference.
181+
ERNIE 4.5 models are trained and deployed for inference using the [PaddlePaddle]((https://github.com/PaddlePaddle/Paddle)) framework. The full workflow of training, compression, and inference for ERNIE 4.5 is supported through the [ERNIEKit](./docs/source/erniekit.md) and [FastDeploy](https://github.com/PaddlePaddle/FastDeploy) toolkit. The table below details the feature matrix of the ERNIE 4.5 model family for training and inference.
182182
<div align="center">
183183

184184
| Model | Training | Inference |
@@ -209,7 +209,7 @@ _Note: For different ERNIE 4.5 model, we provide diverse quantization schemes us
209209
* Quantization-Aware Training (QAT)
210210
* Post-Training Quantization (PTQ) [WIP]
211211

212-
Minimum hardware requirements for training each model are documented [here](./docs/erniekit.md).
212+
Minimum hardware requirements for training each model are documented [here](./docs/source/erniekit.md).
213213

214214

215215
#### Quick Start
@@ -223,7 +223,7 @@ huggingface-cli download baidu/ERNIE-4.5-0.3B-Paddle --local-dir baidu/ERNIE-4.5
223223
erniekit train examples/configs/ERNIE-4.5-0.3B/sft/run_sft_8k.yaml
224224
```
225225

226-
For detailed guides on installation, CLI usage, WebUI, multi-node training, and advanced features, please refer to [ERNIEKit Training Document](./docs/erniekit.md).
226+
For detailed guides on installation, CLI usage, WebUI, multi-node training, and advanced features, please refer to [ERNIEKit Training Document](./docs/source/erniekit.md).
227227

228228
For detailed guides on High-performance pre-training, please refer to [Pre-Training Document](./examples/pre-training/README.md).
229229

docs/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# ERNIE Documentation
2+
3+
Source files for contents presented at [https://ernie.readthedocs.io/](https://ernie.readthedocs.io/en/latest/).
4+
5+
## Contributing
6+
7+
You can build the docs as web pages locally.
8+
9+
```bash
10+
cd docs
11+
uv venv
12+
source .venv/bin/activate
13+
uv run mkdocs serve
14+
```
15+
16+
### Markdown Linting
17+
18+
We use `pymarkdown` to lint markdown files. Install the linting tools with:
19+
20+
```bash
21+
uv sync --extra lint
22+
```
23+
24+
Check all markdown files:
25+
26+
```bash
27+
uv run pymarkdown scan source/
28+
```
29+
30+
Auto-fix issues (where supported):
31+
32+
```bash
33+
uv run pymarkdown fix source/
34+
```

docs/mkdocs.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
site_name: ERNIE Docs
2+
site_url: !ENV READTHEDOCS_CANONICAL_URL
3+
repo_url: https://github.com/PaddlePaddle/ERNIE
4+
repo_name: PaddlePaddle/ERNIE
5+
edit_uri: edit/develop/docs/source/
6+
docs_dir: source
7+
site_dir: site
8+
strict: false
9+
10+
theme:
11+
name: material
12+
logo: assets/images/favicon.ico
13+
favicon: assets/images/favicon.ico
14+
palette:
15+
# Palette toggle for automatic mode
16+
- media: "(prefers-color-scheme)"
17+
toggle:
18+
icon: material/brightness-auto
19+
name: Switch to light mode
20+
# Palette toggle for light mode
21+
- media: "(prefers-color-scheme: light)"
22+
scheme: default
23+
primary: white
24+
toggle:
25+
icon: material/brightness-7
26+
name: Switch to dark mode
27+
# Palette toggle for dark mode
28+
- media: "(prefers-color-scheme: dark)"
29+
scheme: slate
30+
primary: black
31+
toggle:
32+
icon: material/brightness-2
33+
name: Switch to system preference
34+
features:
35+
- content.action.edit
36+
- content.code.copy
37+
- content.tabs.link
38+
- navigation.tracking
39+
- navigation.sections
40+
- navigation.top
41+
- search.highlight
42+
- search.share
43+
- toc.follow
44+
45+
plugins:
46+
- search
47+
- meta
48+
- awesome-nav
49+
- glightbox
50+
- i18n:
51+
docs_structure: suffix
52+
fallback_to_default: true
53+
languages:
54+
- locale: en
55+
default: true
56+
name: English
57+
build: true
58+
- locale: zh
59+
name: 中文
60+
build: true
61+
nav_translations:
62+
Home: 首页
63+
64+
extra:
65+
alternate:
66+
- name: English
67+
link: /
68+
lang: en
69+
- name: Chinese
70+
link: /zh/
71+
lang: zh
72+
73+
markdown_extensions:
74+
- attr_list
75+
- md_in_html
76+
- admonition
77+
- pymdownx.details
78+
# For content tabs
79+
- pymdownx.superfences
80+
- pymdownx.tabbed:
81+
slugify: !!python/object/apply:pymdownx.slugs.slugify
82+
kwds:
83+
case: lower
84+
alternate_style: true
85+
# For code highlighting
86+
- pymdownx.highlight:
87+
anchor_linenums: true
88+
line_spans: __span
89+
pygments_lang_class: true
90+
- pymdownx.inlinehilite
91+
- pymdownx.snippets
92+
# For emoji and icons
93+
- pymdownx.emoji:
94+
emoji_index: !!python/name:material.extensions.emoji.twemoji
95+
emoji_generator: !!python/name:material.extensions.emoji.to_svg
96+
# For in page [TOC] (not sidebar)
97+
- toc:
98+
permalink: true
99+
# For math rendering
100+
- mdx_math:
101+
enable_dollar_delimiter: true
102+
103+
extra_javascript:
104+
- https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML
105+
106+
use_directory_urls: false

docs/pyproject.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[project]
2+
name = "ernie-docs"
3+
version = "0.1.0"
4+
description = "Documentation for ERNIE"
5+
requires-python = ">=3.10"
6+
dependencies = [
7+
"mkdocs",
8+
"mkdocs-material",
9+
"mkdocs-api-autonav",
10+
"mkdocs-awesome-nav",
11+
"mkdocs-glightbox",
12+
"python-markdown-math",
13+
"mkdocs-same-dir",
14+
"mkdocs-static-i18n",
15+
]
16+
17+
[project.optional-dependencies]
18+
lint = [
19+
"pymarkdownlnt",
20+
]
21+
22+
[tool.pymarkdown.plugins]
23+
# Disable line length check (too strict for documentation)
24+
md013.enabled = false
25+
# Allow multiple top-level headings (common in docs)
26+
md025.enabled = false
27+
# Allow duplicate headings (common in multi-section docs)
28+
md024.enabled = false
29+
# Allow emphasis as headers (stylistic choice)
30+
md036.enabled = false
31+
# Set list indent to 4 spaces (Python style)
32+
md007.indent = 4
33+
# Allow both dash and asterisk for unordered lists
34+
md004.enabled = false
35+
# Allow code blocks without blank lines around them
36+
md031.enabled = false
37+
# Allow lists without blank lines around them
38+
md032.enabled = false
39+
# Allow headings without blank lines around them
40+
md022.enabled = false
41+
# Allow bare URLs
42+
md034.enabled = false

docs/requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
mkdocs>=1.5.0
2+
mkdocs-material>=9.5.0
3+
mkdocs-api-autonav
4+
mkdocs-awesome-nav
5+
mkdocs-glightbox
6+
python-markdown-math
7+
mkdocs-same-dir
8+
mkdocs-static-i18n>=1.2.0

docs/source/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# ERNIE Documentation
2+
3+
Welcome to the ERNIE documentation.
4+
5+
## Guides
6+
7+
- [ERNIEKit Overview & Installation](erniekit.md)
8+
- [WebUI & CLI Usage](cli_webui_usage.md)
9+
- [PaddleOCR-VL SFT](paddleocr_vl_sft.md)
10+
- [Datasets Guide](datasets.md)
11+
- [Training & Evaluation Arguments](training_eval_args.md)
12+
- [Chat Arguments](chat_args.md)
13+
- [Export Arguments](export_args.md)
14+
- [FP8 Quantization-Aware Training (QAT)](fp8_qat.md)
15+
- [WINT8 Mixed Precision LoRA](wint8mix_lora.md)
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)