ChuanhuChatGPT icon indicating copy to clipboard operation
ChuanhuChatGPT copied to clipboard

[Bug]: 構建索引有問題

Open bloomin1 opened this issue 1 year ago • 0 comments

这个bug是否已存在现有issue了?

  • [X] 我确认没有已有issue。

错误表现

構建索引時出現error了, 我已經安裝了llama_index 0.5.3的最版本了

复现操作

構建索引時出現error了, 我已經安裝了llama_index 0.5.3的最版本了

错误日志

C:\Users\wmcha\.conda\envs\pythonProject\lib\site-packages\langchain\llms\openai.py:608: UserWarning: You are trying to use a chat model. This way of initializing it is no longer supported. Instead, please use: `from langchain.chat_models import ChatOpenAI`
  warnings.warn(
Traceback (most recent call last):
  File "C:\Users\wmcha\.conda\envs\pythonProject\lib\site-packages\gradio\routes.py", line 393, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Users\wmcha\.conda\envs\pythonProject\lib\site-packages\gradio\blocks.py", line 1108, in process_api
    result = await self.call_function(
  File "C:\Users\wmcha\.conda\envs\pythonProject\lib\site-packages\gradio\blocks.py", line 929, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\wmcha\.conda\envs\pythonProject\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\wmcha\.conda\envs\pythonProject\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "C:\Users\wmcha\.conda\envs\pythonProject\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "C:\Users\wmcha\.conda\envs\pythonProject\lib\site-packages\gradio\utils.py", line 490, in async_iteration
    return next(iterator)
  File "D:\Users\wmcha\PycharmProjects\pythonProject\ChuanhuChatGPT-main\modules\chat_func.py", line 296, in predict
    service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor, prompt_helper=prompt_helper)
NameError: name 'ServiceContext' is not defined

运行环境

- OS: 
- Browser: 
- Gradio version: 
- Python version:

补充说明

No response

bloomin1 avatar Mar 31 '23 18:03 bloomin1