mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2024-10-01 01:06:10 -04:00
py: improve README (#1860)
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
parent
a9c5f53562
commit
b881598166
@ -9,11 +9,17 @@ https://docs.gpt4all.io/gpt4all_python.html
|
||||
|
||||
## Installation
|
||||
|
||||
The easiest way to install the Python bindings for GPT4All is to use pip:
|
||||
|
||||
```
|
||||
pip install gpt4all
|
||||
```
|
||||
|
||||
## Local Build Instructions
|
||||
This will download the latest version of the `gpt4all` package from PyPI.
|
||||
|
||||
## Local Build
|
||||
|
||||
As an alternative to downloading via pip, you may build the Python bindings from source.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
@ -23,25 +29,32 @@ macOS users do not need Vulkan, as GPT4All will use Metal instead.
|
||||
|
||||
### Building the python bindings
|
||||
|
||||
**NOTE**: If you are doing this on a Windows machine, you must build the GPT4All backend using [MinGW64](https://www.mingw-w64.org/) compiler.
|
||||
|
||||
1. Setup `llmodel`
|
||||
|
||||
1. Clone GPT4All and change directory:
|
||||
```
|
||||
git clone --recurse-submodules https://github.com/nomic-ai/gpt4all.git
|
||||
cd gpt4all/gpt4all-backend/
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
cmake --build . --parallel # optionally append: --config Release
|
||||
cd gpt4all/gpt4all-backend
|
||||
```
|
||||
Confirm that `libllmodel.*` exists in `gpt4all-backend/build`.
|
||||
|
||||
2. Setup Python package
|
||||
2. Build the backend.
|
||||
|
||||
If you are using Windows and have Visual Studio installed:
|
||||
```
|
||||
cmake -B build
|
||||
cmake --build build --parallel --config RelWithDebInfo
|
||||
```
|
||||
|
||||
For all other platforms:
|
||||
```
|
||||
cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
cmake --build build --parallel
|
||||
```
|
||||
|
||||
`RelWithDebInfo` is a good default, but you can also use `Release` or `Debug` depending on the situation.
|
||||
|
||||
2. Install the Python package:
|
||||
```
|
||||
cd ../../gpt4all-bindings/python
|
||||
pip3 install -e .
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
Loading…
Reference in New Issue
Block a user