diff --git a/python/llm/example/GPU/LlamaIndex/README.md b/python/llm/example/GPU/LlamaIndex/README.md index cc8b50db..bc6b3322 100644 --- a/python/llm/example/GPU/LlamaIndex/README.md +++ b/python/llm/example/GPU/LlamaIndex/README.md @@ -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: + * Linux + * Installation: + ```bash + sudo apt-get install postgresql-client + sudo apt-get install postgresql + ``` + * Initialization: + + Switch to the **postgres** user and launch **psql** console + ```bash + sudo su - postgres + psql + ``` + + Then, create a new user role: + ```bash + CREATE ROLE WITH LOGIN PASSWORD ''; + ALTER ROLE 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 apt-get install postgresql-client - sudo apt-get install postgresql - ``` - * Initialization: - - Switch to the **postgres** user and launch **psql** console: + cd C:\Program Files\PostgreSQL\14\bin + ``` + The exact path will vary depending on your PostgreSQL location. + * Then in PowerShell: ```bash - sudo su - postgres - psql - ``` - Then, create a new user role: + .\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 WITH LOGIN PASSWORD ''; ALTER ROLE 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.