Add the installation step of postgresql and pgvector on windows in LlamaIndex GPU support (#10328)

* add the installation of postgresql and pgvector of windows

* fix some format
This commit is contained in:
hxsz1997 2024-03-05 18:31:19 +08:00 committed by GitHub
parent 0011ff9f64
commit af11c53473

View file

@ -21,25 +21,48 @@ The RAG example ([rag.py](./rag.py)) is adapted from the [Official llama index R
Follow the instructions in [GPU Install Guide](https://bigdl.readthedocs.io/en/latest/doc/LLM/Overview/install_gpu.html) to install bigdl-llm.
* **Database Setup (using PostgreSQL)**:
* Installation:
```bash
sudo apt-get install postgresql-client
sudo apt-get install postgresql
```
* Initialization:
* Linux
* Installation:
```bash
sudo apt-get install postgresql-client
sudo apt-get install postgresql
```
* Initialization:
Switch to the **postgres** user and launch **psql** console:
Switch to the **postgres** user and launch **psql** console
```bash
sudo su - postgres
psql
```
Then, create a new user role:
```bash
CREATE ROLE <user> WITH LOGIN PASSWORD '<password>';
ALTER ROLE <user> SUPERUSER;
```
* Windows
* click `Download the installer` in [PostgreSQL](https://www.postgresql.org/download/windows/).
* Run the downloaded installation package as administrator, then click `next` continuously.
* Open PowerShell:
```bash
sudo su - postgres
psql
cd C:\Program Files\PostgreSQL\14\bin
```
Then, create a new user role:
The exact path will vary depending on your PostgreSQL location.
* Then in PowerShell:
```bash
.\psql -U postgres
```
Input the password you set in the previous installation. If PowerShell shows `postgres=#`, it indicates a successful connection.
* Create a new user role:
```bash
CREATE ROLE <user> WITH LOGIN PASSWORD '<password>';
ALTER ROLE <user> SUPERUSER;
```
* **Pgvector Installation**:
Follow installation instructions on [pgvector's GitHub](https://github.com/pgvector/pgvector) and refer to the [installation notes](https://github.com/pgvector/pgvector#installation-notes) for additional help.
* Linux
* Follow installation instructions on [pgvector's GitHub](https://github.com/pgvector/pgvector) and refer to the [installation notes](https://github.com/pgvector/pgvector#installation-notes) for additional help.
* Windows
* It is recommended to use [pgvector for Windows](https://github.com/pgvector/pgvector?tab=readme-ov-file#windows) instead of others (such as conda-force) to avoid potential errors. Some steps may require running as administrator.
* **Data Preparation**: Download the Llama2 paper and save it as `data/llama2.pdf`, which serves as the default source file for retrieval.