Coder Social home page Coder Social logo

Comments (6)

CapitalWilliam avatar CapitalWilliam commented on August 14, 2024 1

你再确认一下llamaindex的版本(pip list |grep llama),clone一个原版的 试一下直接使用cmdline而不是ide(vscode, pycharm...etc)

尝试了一下使用windows11自带的terminal,成功实现了调用。

看来应该是我自己电脑上ide配置的问题,后续如果我解决了我再继续更新办法

from history_rag.

wxywb avatar wxywb commented on August 14, 2024

from llama_index.llms import OpenAI

from llama_index.prompts import ChatPromptTemplate, ChatMessage, MessageRole, PromptTemplate

我先确认一下你遇到的问题,你的意思是说executor.py中的这几行无法运行吗,并且在llama-index 0.9.39的情况下。

from history_rag.

CapitalWilliam avatar CapitalWilliam commented on August 14, 2024

from llama_index.llms import OpenAI

from llama_index.prompts import ChatPromptTemplate, ChatMessage, MessageRole, PromptTemplate

我先确认一下你遇到的问题,你的意思是说executor.py中的这几行无法运行吗,并且在llama-index 0.9.39的情况下。

我遇到的情况应该是两部分,一个是 项目在vscode下遇到的"模块名和py文件名相同时的冲突",这部分可能是vscode的python extension或者是其他部分有关系,我准备稍后用pycharm试试,如果没有问题,我再更新.
【更新】在pycharm尝试了一次,两部分情况又都遇到了

第二个就是我修改了以下几处的,替换同名 或者是参考llama-index仓库里其他版本的类似写法(global_handler)

from llama_index.core.query_pipeline.components import (...) (components模块下的components.py无法识别)

from llama_index.core.llms.llm import LLM(llm 模块下的llm.py无法识别)

from llama_index.core.llms.llm import ChatMessage, MessageRole

from llama_index.core import global_handler(llama_index.core模块下没有global_handler)

以上操作后,可以顺利执行:
1 cmd窗口执行python cli.py
2 项目窗口执行milvus
3 项目窗口执行build *.txt
4 项目窗口输入ask -dask
5 项目窗口输入华雄是被谁杀死的

上述步骤后,我就会遇到标题里的ValueError报错.

我也尝试通过给以上逐行代码添加断点,来尝试捕捉,但我在vscode 里面打开debug模式后,第一次触发断点会是在
Raised Exceptions情况下,出现在 executor.py文件中

具体的Exception位置如下:

response = self.query_engine.query(question)

Exception has occurred: ValueError
Cannot use llm_chat_callback on an instance without a callback_manager attribute.
  File "C:\Users\A\VscodeProjects\history_rag\executor.py", line 237, in query
    response = self.query_engine.query(question)
  File "C:\Users\A\VscodeProjects\history_rag\cli.py", line 86, in query
    ans = self._executor.query(question)
  File "C:\Users\A\VscodeProjects\history_rag\cli.py", line 109, in question_answer
    self.query(question)
  File "C:\Users\A\VscodeProjects\history_rag\cli.py", line 74, in parse_input
    self.question_answer()
  File "C:\Users\A\VscodeProjects\history_rag\cli.py", line 53, in run
    self.parse_input(command_text)
  File "C:\Users\A\VscodeProjects\history_rag\cli.py", line 120, in <module>
    cli.run()
ValueError: Cannot use llm_chat_callback on an instance without a callback_manager attribute.

from history_rag.

wxywb avatar wxywb commented on August 14, 2024

你再确认一下llamaindex的版本(pip list |grep llama),clone一个原版
试一下直接使用cmdline而不是ide(vscode, pycharm...etc)

from history_rag.

IshitaArora-246 avatar IshitaArora-246 commented on August 14, 2024

I am using llama-index version 0.10.0 and getting the same error. The command pip list | grep llama also didn't work.

from history_rag.

CapitalWilliam avatar CapitalWilliam commented on August 14, 2024

I am using llama-index version 0.10.0 and getting the same error. The command pip list | grep llama also didn't work.

Hi Ishita. About this, I have searched answer and
it seems like that the llama-index library have been rewritten after version 0.10.x.

I believe llama-index works good at version>=0.9.4x

You can run pip install llama-index==0.9.39 --upgrade and (if you are facing same problems I mentioned,) run history_rag via cmd instead of some IDEs .

from history_rag.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.