Skip to content

Commit fbb211d

Browse files
committed
chore: update files
1 parent 9433630 commit fbb211d

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

docs/faq/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ hide:
77

88
#### Q: 为什么我的模型在ONNXRuntime GPU版上比在CPU上还要慢?
99

10-
**A:** 因为OCR任务中输入图像Shape是动态的。每次GPU上都需要重新清空上一次不同Shape的缓存结果。如果输入图像Shape不变的情况下,ONNXRuntime GPU版一般都要比CPU快的。该问题已经提了相关issue[issue #13198](https://github.com/microsoft/onnxruntime/issues/13198)
10+
**A:** 因为OCR任务中输入图像Shape是动态的。每次GPU上都需要重新清空上一次不同Shape的缓存结果。如果输入图像Shape不变的情况下,ONNXRuntime GPU版一般都要比CPU快的。该问题已经提了相关issue #13198
1111

1212
推荐CPU端推理用`rapidocr_onnxruntime`或者`rapidocr_openvino`,GPU端用`rapidocr_paddle`。关于`rapidocr_onnxruntime``rapidocr_paddle`两者之间推理,可参见:[docs](https://rapidai.github.io/RapidOCRDocs/v1.4.4/install_usage/rapidocr_paddle/usage/#_4)
1313

hooks/link.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55
def on_page_markdown(markdown, page, config, files):
66
"""
77
将 'issue #数字'、'PR #数字'、'commit 哈希' 替换为 GitHub 链接
8-
(忽略代码块和行内代码,只在指定页面生效,支持通配符匹配
8+
(忽略代码块和行内代码,只在指定页面生效,支持通配符
99
"""
1010

1111
repo_url = config.get("repo_url", "").rstrip("/")
1212
if not repo_url:
1313
return markdown
1414

15-
# 从 mkdocs.yml 读取页面白名单(支持通配符
15+
# 页面白名单,支持通配符
1616
allowed_pages = config.get("link_pages", [])
17-
page_src = page.file.src_path # e.g. "docs/releases/v1.0.md"
18-
17+
page_src = page.file.src_path # 相对于 docs/ 的路径
1918
if allowed_pages:
2019
matched = any(fnmatch.fnmatch(page_src, pattern) for pattern in allowed_pages)
2120
if not matched:
@@ -35,31 +34,28 @@ def store_placeholder(match):
3534
# 提取行内代码(`...`)
3635
markdown = re.sub(r"`.*?`", store_placeholder, markdown)
3736

38-
# issue 替换
37+
# --- issue 替换 ---
38+
# 支持 issue#123 / issue: #123 / issue #123
3939
def issue_replacer(match):
4040
num = match.group(1)
4141
return f"issue [#{num}]({repo_url}/issues/{num})"
4242

43-
markdown = re.sub(
44-
r"\bissue\s+#(\d+)", issue_replacer, markdown, flags=re.IGNORECASE
45-
)
43+
markdown = re.sub(r"(?i)issue\s*[:#]?\s*#?(\d+)", issue_replacer, markdown)
4644

47-
# PR 替换
45+
# --- PR 替换 ---
4846
def pr_replacer(match):
4947
num = match.group(1)
5048
return f"PR [#{num}]({repo_url}/pull/{num})"
5149

52-
markdown = re.sub(r"\bPR\s+#(\d+)", pr_replacer, markdown, flags=re.IGNORECASE)
50+
markdown = re.sub(r"(?i)PR\s*[:#]?\s*#?(\d+)", pr_replacer, markdown)
5351

54-
# commit 替换(显示前 7 位)
52+
# --- commit 替换 ---
5553
def commit_replacer(match):
5654
sha = match.group(1)
5755
short_sha = sha[:7]
5856
return f"commit [{short_sha}]({repo_url}/commit/{sha})"
5957

60-
markdown = re.sub(
61-
r"\bcommit\s+([0-9a-f]{6,40})", commit_replacer, markdown, flags=re.IGNORECASE
62-
)
58+
markdown = re.sub(r"(?i)commit\s+([0-9a-f]{6,40})", commit_replacer, markdown)
6359

6460
# 还原代码块和行内代码
6561
for key, value in placeholders.items():

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ hooks:
101101
- hooks/link.py
102102

103103
link_pages:
104-
- chagnelog/*.md
104+
- changelog/*.md
105105
- faq/*.md
106106

107107
extra:

0 commit comments

Comments
 (0)