Программы на Python
Anonymous
ModuleNotFoundError: нет модуля с именем «llama_index.langchain_helpers.chatgpt».
Сообщение
Anonymous » 01 ноя 2025, 08:08
Я хотел бы использовать 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')
. 1/ЧААЧ ХАМЭ 4 ХАМ/ЧВЫЙ.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
1761973705
Anonymous
Я хотел бы использовать ChatGPTLLMPredictor из llama_index.langchain_helpers.chatgpt, но на M1 Macbook Air я получил ошибку ниже. [code]ModuleNotFoundError: No module named 'llama_index.langchain_helpers.chatgpt' [/code] Мой код выглядит так, и проблема в строке 3. [code]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') . 1/ЧААЧ ХАМЭ 4 ХАМ/ЧВЫЙ.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 [/code] Спасибо. Подробнее здесь: [url]https://stackoverflow.com/questions/76040306/modulenotfounderror-no-module-named-llama-index-langchain-helpers-chatgpt[/url]