Skip to content

Commit

Permalink
py: improve README (#1860)
Browse files Browse the repository at this point in the history
Signed-off-by: Jared Van Bortel <[email protected]>
  • Loading branch information
cebtenzzre authored Jan 22, 2024
1 parent a9c5f53 commit b881598
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions gpt4all-bindings/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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. Clone GPT4All and change directory:
```
git clone --recurse-submodules https://github.com/nomic-ai/gpt4all.git
cd gpt4all/gpt4all-backend
```

2. Build the backend.

1. Setup `llmodel`
If you are using Windows and have Visual Studio installed:
```
cmake -B build
cmake --build build --parallel --config RelWithDebInfo
```

For all other platforms:
```
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
cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build --parallel
```
Confirm that `libllmodel.*` exists in `gpt4all-backend/build`.

2. Setup Python package
`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
Expand Down

0 comments on commit b881598

Please sign in to comment.