ModuleNotFoundError: нет модуля с именем «llama_index.langchain_helpers.chatgpt».Python

Программы на Python
Ответить
Anonymous
 ModuleNotFoundError: нет модуля с именем «llama_index.langchain_helpers.chatgpt».

Сообщение Anonymous »

Я хотел бы использовать ChatGPTLLMPredictor из llama_index.langchain_helpers.chatgpt, но на M1 Macbook Air я получил ошибку ниже.

Код: Выделить всё

ModuleNotFoundError: No module named 'llama_index.langchain_helpers.chatgpt'
Мой код выглядит так, и проблема в строке 3.

Код: Выделить всё

import csv
from llama_index import GPTSimpleVectorIndex, SimpleWebPageReader
from llama_index.langchain_helpers.chatgpt import ChatGPTLLMPredictor

article_urls = []
with open('article-urls.csv') as f:
reader = csv.reader(f)
for row in reader:
article_urls.append(row[0])

documents = SimpleWebPageReader().load_data(article_urls)
index = GPTSimpleVectorIndex(documents=documents, llm_predictor=ChatGPTLLMPredictor()
)
index.save_to_disk('index.json')
  • Python v3.10.10
  • requirements.txt

Код: Выделить всё

aiohttp==3.8.4
aiosignal==1.3.1
async-timeout==4.0.2
attrs==23.1.0
cachetools==5.3.0
certifi==2022.12.7
charset-normalizer==3.1.0
dataclasses-json==0.5.7
frozenlist==1.3.3
gptcache==0.1.14
idna==3.4
langchain==0.0.142
llama-index==0.5.16
marshmallow==3.19.0
marshmallow-enum==1.5.1
multidict==6.0.4
mypy-extensions==1.0.0
numexpr==2.8.4
numpy==1.24.2
openai==0.27.4
openapi-schema-pydantic==1.2.4
packaging==23.1
pandas==2.0.0
pydantic==1.10.7
python-dateutil==2.8.2
pytz==2023.3
PyYAML==6.0
regex==2023.3.23
requests==2.28.2
six==1.16.0
SQLAlchemy==1.4.47
tenacity==8.2.2
tiktoken==0.3.3
tqdm==4.65.0
typing-inspect==0.8.0
typing_extensions==4.5.0
tzdata==2023.3
urllib3==1.26.15
yarl==1.8.2
Спасибо.


Подробнее здесь: https://stackoverflow.com/questions/760 ... rs-chatgpt
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Python»