Skip to content
/ pygptj Public
forked from abdeladim-s/pygptj

Python bindings for the GGML GPT-J Laguage model

License

Notifications You must be signed in to change notification settings

KeremP/pygptj

 
 

Repository files navigation

PyGPT-J

Official supported Python bindings for GPT4All-J language model based on ggml.

License: MIT

Table of contents

Installation

  1. The easy way is to use the prebuilt wheels
pip install pygptj
  1. Build it from source:
git clone --recursive https://github.com/abdeladim-s/pygptj && cd pygptj
pip install .

Usage

from pygptj.model import Model

 def new_text_callback(text):
        print(text, end="")

model = Model('./models/ggml-gpt4all-j.bin')
model.generate("Once upon a time, ", n_predict=55, new_text_callback=new_text_callback)

If you don't want to use the callback, you can get the results from the generate method once the inference is finished:

generated_text = model.generate("Once upon a time, ", n_predict=55)
print(generated_text)

GPT4All-J Model

Download the GPT4All-J model.

License

This project is licensed under the MIT License.

About

Python bindings for the GGML GPT-J Laguage model

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 69.5%
  • Python 23.9%
  • CMake 6.5%
  • Other 0.1%