GPT 4-无法获得问题的答复?

tcbh2hod  于 2023-05-01  发布在  其他
关注(0)|答案(1)|浏览(299)

由于标题清楚地描述了我遇到的问题,我无法从使用nomic-ai/gpt4all的数据集获得对问题的响应。执行只是停止。无异常发生。我该如何克服这种情况?
我使用GPT4的离线模式,因为我需要处理大量的问题。
p.s.此问题发生一段时间后。某些东西阻止GPT4All为给定的问题生成响应。

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
fnvucqvd

fnvucqvd1#

这在我的Windows笔记本电脑上工作。使用pygpt4all,基于此: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)

输出:

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|>

相关问题