Skip to content

Commit 94ad660

Browse files
committed
feat: add Orama tokenizer and update search configuration for enhanced search capabilities
1 parent c122ae6 commit 94ad660

6 files changed

Lines changed: 31 additions & 3 deletions

File tree

public/images/word/word-img-01.png renamed to app/docs/ai/llm-basics/pytorch/index.assets/word-img-01.png

File renamed without changes.

public/images/word/word-img-02.png renamed to app/docs/ai/llm-basics/pytorch/index.assets/word-img-02.png

File renamed without changes.

app/docs/ai/llm-basics/pytorch/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ PyTorch是现代深度学习最重要的框架之一,特别在研究和大模
3535
## 核心概念
3636

3737
- **张量 (Tensor)**:PyTorch 的核心数据结构,支持 GPU 加速的多维数组
38-
![](/images/word/word-img-01.png)
39-
![](/images/word/word-img-02.png)
38+
![](./index.assets/word-img-01.png)
39+
![](./index.assets/word-img-02.png)
4040
- **自动梯度 (Autograd)**:动态计算图与自动微分系统
4141
- **神经网络模块 (nn.Module)**:模块化构建神经网络
4242
- **训练循环**:优化器、损失函数、学习率调度等

app/search.json/route.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
import { createFromSource } from "fumadocs-core/search/server";
22
import { source } from "@/lib/source";
3+
import { createTokenizer } from "@orama/tokenizers/mandarin";
34

45
// Ensure this route is statically generated during `next export`.
56
export const dynamic = "force-static";
67

78
// Static search database for static export (Next.js `output: "export"`).
8-
const api = createFromSource(source);
9+
const api = createFromSource(source, {
10+
components: {
11+
tokenizer: createTokenizer(),
12+
},
13+
search: {
14+
threshold: 0,
15+
tolerance: 0,
16+
},
17+
});
918
export const GET = api.staticGET;

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"migrate:images": "node scripts/move-doc-images.mjs"
1313
},
1414
"dependencies": {
15+
"@orama/orama": "^3.1.13",
16+
"@orama/tokenizers": "^3.1.13",
1517
"@types/mdx": "^2.0.13",
1618
"class-variance-authority": "^0.7.1",
1719
"clsx": "^2.1.1",

pnpm-lock.yaml

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)