TheBloke / gpt4all-j

Python bindings for the C++ port of GPT4All-J model.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python bindings for the C++ port of GPT4All-J model.

Installation

pip install gpt4all-j

Download the model from here.

Usage

from gpt4allj import Model

model = Model('/path/to/ggml-gpt4all-j.bin')

print(model.generate('AI is going to'))

Run in Google Colab

Parameters

model.generate(prompt,
               seed=-1,
               n_threads=-1,
               n_predict=200,
               top_k=40,
               top_p=0.9,
               temp=0.9)

macOS

macOS isn't supported out of the box yet but you can use it with Docker or try building the C++ library from source here. Once you have built the shared libraries, you can use them as:

from gpt4allj import Model, load_library

lib = load_library('/path/to/libgptj.so', '/path/to/libggml.so')

model = Model('/path/to/ggml-gpt4all-j.bin', lib=lib)

License

MIT

About

Python bindings for the C++ port of GPT4All-J model.

License:MIT License


Languages

Language:Python 96.0%Language:Shell 4.0%