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

Running test py Error 'new_text_callback" #99

Open
dqtsinfo opened this issue May 4, 2023 · 2 comments
Open

Running test py Error 'new_text_callback" #99

dqtsinfo opened this issue May 4, 2023 · 2 comments

Comments

@dqtsinfo
Copy link

dqtsinfo commented May 4, 2023

Hello
im kinda new at this, very very new, and im trying to run a test with pygpt4all and i get a error, "TypeError: Model.generate() got an unexpected keyword argument 'new_text_callback'" and im not sure what i need to do

gptj_model_load: loading model from './ggml-gpt4all-j-v1.2-jazzy.bin' - please wait ... gptj_model_load: n_vocab = 50400 gptj_model_load: n_ctx = 2048 gptj_model_load: n_embd = 4096 gptj_model_load: n_head = 16 gptj_model_load: n_layer = 28 gptj_model_load: n_rot = 64 gptj_model_load: f16 = 2 gptj_model_load: ggml ctx size = 4505.45 MB gptj_model_load: memory_size = 896.00 MB, n_mem = 57344 gptj_model_load: ................................... done gptj_model_load: model size = 3609.38 MB / num tensors = 285 Traceback (most recent call last): File "C:\Users\???\testing\gpt4all\test2.py", line 7, in <module> outText = model.generate("Is she ok", n_predict=55, new_text_callback=new_text_callback) TypeError: Model.generate() got an unexpected keyword argument 'new_text_callback'

@abdeladim-s
Copy link
Collaborator

hello @dqtsinfo,

I think you are using an old version of the package.

So you have to either try with an old version or install the latest version and use the code from the readme.

@g0dEngineer
Copy link

Try cpp_generate instead of generate which allows for callback param

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants