GPT4 - Unable to get response for a question?

1k Views Asked by At

As the title clearly describes the issue I've been experiencing, I'm not able to get a response to a question from the dataset I use using the nomic-ai/gpt4all. The execution simply stops. No exception occurs. How can I overcome this situation?

p.s. I use the offline mode of GPT4 since I need to process a bulk of questions.

p.s. This issue occurs after a while. Something prevents GPT4All to generate a response for the given question.

question = 'Was Avogadro a  professor at the University of Turin?'
gpt = GPT4All()
gpt.open()
resp = gpt.prompt(question)
print(f'Response: {resp}')  # --> the execution does not reach here
1

There are 1 best solutions below

0
On

This works on my windows laptop. Using pygpt4all, based on this: https://github.com/nomic-ai/pygpt4all.

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("Was Avogadro a  professor at the University of Turin?", n_predict=55, new_text_callback=new_text_callback)

Output:

Was Avogadro a  professor at the University of Turin? If so, can you give me the name of his field of research? And did he publish any papers?<|endoftext|>