Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

pygpt4all - output full response as string and suppress model parameters? #98

Answered by abdeladim-s
gykung asked this question in Q&A
Discussion options

You must be logged in to vote

@gykung,

You can export it by simply storing the tokens in a string variable, like the following:

from pygpt4all import GPT4All_J

model = GPT4All_J('path/to/ggml-gpt4all-j-v1.3-groovy.bin')

response = ""
for token in model.generate("What do you think about German beer?\n"):
    response += token

print(response)

Please note that the parameters are printed to stderr from the c++ side, it does not affect the generated response

do not forget to update the package to the latest version

pip install -U pygpt4all

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kim-em
Comment options

@abdeladim-s
Comment options

Answer selected by gykung
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants