7
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【ChatGPT】AttributeError: 'ChatGPTLLMPredictor' object has no attribute '_llm'【GPT-index】【Llama-index】

Posted at

エラー内容

GPTindexでChatGPTLLMPredictorを使おうと、するとエラーが出る
(いくつかの使用記事があるが、現在は使えないよう)

AttributeError: 'ChatGPTLLMPredictor' object has no attribute '_llm'

解決法

githubのissueを確認すると、製作者から以下のコメントがある

image.png

要するに、ChatGPTLLMPredictorはもうサポートしないとのこと。

代わりの方法が以下のnotebookに記載されている

要約すると大体以下の通り

from gpt_index import GPTSimpleVectorIndex, SimpleDirectoryReader, LLMPredictor
from langchain.chat_models import ChatOpenAI

llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0, model_name="gpt-3.5-turbo"))
7
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?