KevinHuSh
commited on
Commit
·
1cc01e0
1
Parent(s):
0cfb2df
Add more information on vm map count setting (#241)
Browse files### What problem does this PR solve?
_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._
Issue link:#[[Link the issue
here](https://github.com/infiniflow/ragflow/issues/236)]
### Type of change
- [x] Documentation Update
- README.md +4 -4
- README_ja.md +3 -3
- README_zh.md +2 -2
- docs/max_map_count.md +66 -0
- rag/app/naive.py +1 -1
README.md
CHANGED
@@ -70,7 +70,7 @@
|
|
70 |
|
71 |
### 🚀 Start up the server
|
72 |
|
73 |
-
1. Ensure `vm.max_map_count`
|
74 |
|
75 |
> To check the value of `vm.max_map_count`:
|
76 |
>
|
@@ -78,7 +78,7 @@
|
|
78 |
> $ sysctl vm.max_map_count
|
79 |
> ```
|
80 |
>
|
81 |
-
> Reset `vm.max_map_count` to a value
|
82 |
>
|
83 |
> ```bash
|
84 |
> # In this case, we set it to 262144:
|
@@ -104,7 +104,7 @@
|
|
104 |
$ docker compose up -d
|
105 |
```
|
106 |
|
107 |
-
> The core image is about
|
108 |
|
109 |
4. Check the server status after having the server up and running:
|
110 |
|
@@ -129,7 +129,7 @@
|
|
129 |
```
|
130 |
|
131 |
5. In your web browser, enter the IP address of your server as prompted and log in to RAGFlow.
|
132 |
-
> In the given scenario, you only need to enter `http://
|
133 |
6. In [service_conf.yaml](./docker/service_conf.yaml), select the desired LLM factory in `user_default_llm` and update the `API_KEY` field with the corresponding API key.
|
134 |
|
135 |
> See [./docs/llm_api_key_setup.md](./docs/llm_api_key_setup.md) for more information.
|
|
|
70 |
|
71 |
### 🚀 Start up the server
|
72 |
|
73 |
+
1. Ensure `vm.max_map_count` >= 262144 ([more](./docs/max_map_count.md)):
|
74 |
|
75 |
> To check the value of `vm.max_map_count`:
|
76 |
>
|
|
|
78 |
> $ sysctl vm.max_map_count
|
79 |
> ```
|
80 |
>
|
81 |
+
> Reset `vm.max_map_count` to a value at least 262144 if it is not.
|
82 |
>
|
83 |
> ```bash
|
84 |
> # In this case, we set it to 262144:
|
|
|
104 |
$ docker compose up -d
|
105 |
```
|
106 |
|
107 |
+
> The core image is about 9 GB in size and may take a while to load.
|
108 |
|
109 |
4. Check the server status after having the server up and running:
|
110 |
|
|
|
129 |
```
|
130 |
|
131 |
5. In your web browser, enter the IP address of your server as prompted and log in to RAGFlow.
|
132 |
+
> In the given scenario, you only need to enter `http://IP_of_RAGFlow ` (sans port number) as the default HTTP serving port `80` can be omitted when using the default configurations.
|
133 |
6. In [service_conf.yaml](./docker/service_conf.yaml), select the desired LLM factory in `user_default_llm` and update the `API_KEY` field with the corresponding API key.
|
134 |
|
135 |
> See [./docs/llm_api_key_setup.md](./docs/llm_api_key_setup.md) for more information.
|
README_ja.md
CHANGED
@@ -66,11 +66,11 @@
|
|
66 |
- CPU >= 2 cores
|
67 |
- RAM >= 8 GB
|
68 |
- Docker
|
69 |
-
> ローカルマシン(Windows、Mac、または Linux)に Docker をインストールしていない場合は、[Docker Engine のインストール](https://docs.docker.com/engine/install/)を参照してください。
|
70 |
|
71 |
### 🚀 サーバーを起動
|
72 |
|
73 |
-
1. `vm.max_map_count`
|
74 |
|
75 |
> `vm.max_map_count` の値をチェックするには:
|
76 |
>
|
@@ -78,7 +78,7 @@
|
|
78 |
> $ sysctl vm.max_map_count
|
79 |
> ```
|
80 |
>
|
81 |
-
> `vm.max_map_count` が
|
82 |
>
|
83 |
> ```bash
|
84 |
> # In this case, we set it to 262144:
|
|
|
66 |
- CPU >= 2 cores
|
67 |
- RAM >= 8 GB
|
68 |
- Docker
|
69 |
+
> ローカルマシン(Windows、Mac、または Linux)に Docker をインストールしていない場合は、[Docker Engine のインストール](https://docs.docker.com/engine/install/) を参照してください。
|
70 |
|
71 |
### 🚀 サーバーを起動
|
72 |
|
73 |
+
1. `vm.max_map_count` >= 262144 であることを確認する【[もっと](./docs/max_map_count.md)】:
|
74 |
|
75 |
> `vm.max_map_count` の値をチェックするには:
|
76 |
>
|
|
|
78 |
> $ sysctl vm.max_map_count
|
79 |
> ```
|
80 |
>
|
81 |
+
> `vm.max_map_count` が 262144 より大きい値でなければリセットする。
|
82 |
>
|
83 |
> ```bash
|
84 |
> # In this case, we set it to 262144:
|
README_zh.md
CHANGED
@@ -70,7 +70,7 @@
|
|
70 |
|
71 |
### 🚀 启动服务器
|
72 |
|
73 |
-
1. 确保 `vm.max_map_count`
|
74 |
|
75 |
> 如需确认 `vm.max_map_count` 的大小:
|
76 |
>
|
@@ -78,7 +78,7 @@
|
|
78 |
> $ sysctl vm.max_map_count
|
79 |
> ```
|
80 |
>
|
81 |
-
> 如果 `vm.max_map_count`
|
82 |
>
|
83 |
> ```bash
|
84 |
> # 这里我们设为 262144:
|
|
|
70 |
|
71 |
### 🚀 启动服务器
|
72 |
|
73 |
+
1. 确保 `vm.max_map_count` 不小于 262144 【[更多](./docs/max_map_count.md)】:
|
74 |
|
75 |
> 如需确认 `vm.max_map_count` 的大小:
|
76 |
>
|
|
|
78 |
> $ sysctl vm.max_map_count
|
79 |
> ```
|
80 |
>
|
81 |
+
> 如果 `vm.max_map_count` 的值小于 262144,可以进行重置:
|
82 |
>
|
83 |
> ```bash
|
84 |
> # 这里我们设为 262144:
|
docs/max_map_count.md
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Set vm.max_map_count to at least 262144
|
2 |
+
|
3 |
+
## Linux
|
4 |
+
|
5 |
+
To check the value of `vm.max_map_count`:
|
6 |
+
|
7 |
+
```bash
|
8 |
+
$ sysctl vm.max_map_count
|
9 |
+
```
|
10 |
+
|
11 |
+
Reset `vm.max_map_count` to a value at least 262144 if it is not.
|
12 |
+
|
13 |
+
```bash
|
14 |
+
# In this case, we set it to 262144:
|
15 |
+
$ sudo sysctl -w vm.max_map_count=262144
|
16 |
+
```
|
17 |
+
|
18 |
+
This change will be reset after a system reboot. To ensure your change remains permanent, add or update the `vm.max_map_count` value in **/etc/sysctl.conf** accordingly:
|
19 |
+
|
20 |
+
```bash
|
21 |
+
vm.max_map_count=262144
|
22 |
+
```
|
23 |
+
|
24 |
+
## Mac
|
25 |
+
|
26 |
+
```bash
|
27 |
+
$ screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
|
28 |
+
$ sysctl -w vm.max_map_count=262144
|
29 |
+
```
|
30 |
+
To exit the screen session, type Ctrl a d.
|
31 |
+
|
32 |
+
## Windows and macOS with Docker Desktop
|
33 |
+
|
34 |
+
The vm.max_map_count setting must be set via docker-machine:
|
35 |
+
|
36 |
+
```bash
|
37 |
+
$ docker-machine ssh
|
38 |
+
$ sudo sysctl -w vm.max_map_count=262144
|
39 |
+
```
|
40 |
+
|
41 |
+
## Windows with Docker Desktop WSL 2 backend
|
42 |
+
|
43 |
+
To manually set it every time you reboot, you must run the following commands in a command prompt or PowerShell window every time you restart Docker:
|
44 |
+
|
45 |
+
```bash
|
46 |
+
$ wsl -d docker-desktop -u root
|
47 |
+
$ sysctl -w vm.max_map_count=262144
|
48 |
+
```
|
49 |
+
If you are on these versions of WSL and you do not want to have to run those commands every time you restart Docker, you can globally change every WSL distribution with this setting by modifying your %USERPROFILE%\.wslconfig as follows:
|
50 |
+
|
51 |
+
```bash
|
52 |
+
[wsl2]
|
53 |
+
kernelCommandLine = "sysctl.vm.max_map_count=262144"
|
54 |
+
```
|
55 |
+
This will cause all WSL2 VMs to have that setting assigned when they start.
|
56 |
+
|
57 |
+
If you are on Windows 11, or Windows 10 version 22H2 and have installed the Microsoft Store version of WSL, you can modify the /etc/sysctl.conf within the "docker-desktop" WSL distribution, perhaps with commands like this:
|
58 |
+
|
59 |
+
```bash
|
60 |
+
$ wsl -d docker-desktop -u root
|
61 |
+
$ vi /etc/sysctl.conf
|
62 |
+
```
|
63 |
+
and appending a line which reads:
|
64 |
+
```bash
|
65 |
+
vm.max_map_count = 262144
|
66 |
+
```
|
rag/app/naive.py
CHANGED
@@ -60,7 +60,7 @@ class Docx(DocxParser):
|
|
60 |
html += f"<td>{c.text}</td>" if span == 1 else f"<td colspan='{span}'>{c.text}</td>"
|
61 |
html += "</tr>"
|
62 |
html += "</table>"
|
63 |
-
|
64 |
return [(l, "") for l in lines if l], tbls
|
65 |
|
66 |
|
|
|
60 |
html += f"<td>{c.text}</td>" if span == 1 else f"<td colspan='{span}'>{c.text}</td>"
|
61 |
html += "</tr>"
|
62 |
html += "</table>"
|
63 |
+
tbls.append(((None, html), ""))
|
64 |
return [(l, "") for l in lines if l], tbls
|
65 |
|
66 |
|