Skip to content

Official supported Python bindings for llama.cpp + gpt4all

License

Notifications You must be signed in to change notification settings

SecCEN/pygpt4all

 
 

Repository files navigation

PyGPT4All

Official Python CPU inference for GPT4All language models based on llama.cpp and ggml

License: MIT

NB: Under active development

Installation

pip install pygpt4all

Usage

GPT4All model

Download a GPT4All model from http://gpt4all.io/models/ggml-gpt4all-l13b-snoozy.bin

from pygpt4all.models.gpt4all import GPT4All

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

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

GPT4All-J model

Download the GPT4All-J model from https://gpt4all.io/models/ggml-gpt4all-j-v1.3-groovy.bin

from pygpt4all.models.gpt4all_j import GPT4All_J

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

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

License

This project is licensed under the MIT License.

About

Official supported Python bindings for llama.cpp + gpt4all

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 55.2%
  • Python 21.6%
  • C 15.8%
  • CMake 5.2%
  • Batchfile 0.8%
  • Makefile 0.7%
  • Other 0.7%