MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

RAG后不能用GPT-4o进行query

Open 2530909 opened this issue 1 year ago • 10 comments

将文档进行rag后 engine = SimpleEngine.from_docs(input_dir=DOC_PATH, retriever_configs=[FAISSRetrieverConfig()]).persist(persist_dir) answer = await engine.aqvery(‘查询内容’) 在/.metagpt/config2.yaml 配置文件中model使用gpt-4-1106-preview  gpt-4-turbo-preview gpt-3.5-turbo-1106都可以正常aquery,GPT-4o不能正常进行

报错如下: Traceback (most recent call last): File "C:\Users\xxxxxxx\Desktop\MetaGPT\MetaGPT\metagpt\utils\common.py", line 640, in wrapper return await func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\xxxxxxx\Desktop\MetaGPT\MetaGPT\metagpt\roles\role.py", line 555, in run rsp = await self.react() ^^^^^^^^^^^^^^^^^^ ValueError: Calculated available context size -320 was not non-negative.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\xxxxxxx\Desktop\MetaGPT\MetaGPT\metagpt\utils\common.py", line 626, in wrapper result = await func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\xxxxxxx\Desktop\MetaGPT\MetaGPT\metagpt\team.py", line 131, in run await self.env.run() Exception: Traceback (most recent call last): File "C:\Users\xxxxxxx\Desktop\MetaGPT\MetaGPT\metagpt\utils\common.py", line 640, in wrapper return await func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\xxxxxxx\Desktop\MetaGPT\MetaGPT\metagpt\roles\role.py", line 555, in run rsp = await self.react() ^^^^^^^^^^^^^^^^^^ File "C:\Users\xxxxxxx\Desktop\MetaGPT\MetaGPT\metagpt\roles\role.py", line 522, in react rsp = await self._react() ^^^^^^^^^^^^^^^^^^^ File "C:\Users\xxxxxxx\Desktop\MetaGPT\MetaGPT\metagpt\roles\role.py", line 468, in _react rsp = await self._act() ^^^^^^^^^^^^^^^^^ File "C:\Users\xxxxxxx\Desktop\MetaGPT\MetaGPT\metagpt\roles\role.py", line 397, in _act response = await self.rc.todo.run(self.rc.history) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\xxxxxxx\Desktop\MetaGPT\MetaGPT\auto_pentest\pentest_rag\pentest_rag.py", line 71, in run answer = await engine.aquery( ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\xxxxxxx\Desktop\MetaGPT\MetaGPT.venv\Lib\site-packages\llama_index\core\instrume

2530909 avatar Sep 10 '24 07:09 2530909

Which version are you using, have you tried the main branch?

seehi avatar Sep 10 '24 08:09 seehi

In version 0.8, I'm using the main branch

Which version are you using, have you tried the main branch?

2530909 avatar Sep 10 '24 08:09 2530909

Is the output normal when executing the following code?

>>> from metagpt.utils.token_counter import TOKEN_MAX
>>> print(TOKEN_MAX["gpt-4o"])
128000

seehi avatar Sep 10 '24 09:09 seehi

from metagpt.utils.token_counter import TOKEN_MAX print(TOKEN_MAX["gpt-4o"]) Traceback (most recent call last): File "C:\Users\xxxxxx\Desktop\MetaGPT\MetaGPT.venv\Lib\site-packages\IPython\core\interactiveshell.py", line 3548, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in print(TOKEN_MAX["gpt-4o"]) ~~~~~~~~~^^^^^^^^^^ KeyError: 'gpt-4o'

执行以下代码时,输出是否正常?

>>> from metagpt.utils.token_counter import TOKEN_MAX
>>> print(TOKEN_MAX["gpt-4o"])
128000

2530909 avatar Sep 11 '24 00:09 2530909

from metagpt.utils.token_counter import TOKEN_MAX print(TOKEN_MAX[“gpt-4o”]) 回溯(最近调用最后一次):文件“C:\Users\liuqihui\Desktop\MetaGPT\MetaGPT.venv\Lib\site-packages\IPython\core\interactiveshell.py”,第 3548 行,run_code exec(code_obj, self.user_global_ns, self.user_ns) 文件“”,第 1 行,在 print(TOKEN_MAX[“gpt-4o”]) ~~~~~~~~~^^^^^^^^^^ KeyError: 'gpt-4o'

执行以下代码时,输出是否正常?

>>> from metagpt.utils.token_counter import TOKEN_MAX
>>> print(TOKEN_MAX["gpt-4o"])
128000

What kind of question is that

2530909 avatar Sep 11 '24 00:09 2530909

Need to use main branch

seehi avatar Sep 11 '24 06:09 seehi

What does that mean? What am I supposed to do

Need to use main branch

2530909 avatar Sep 11 '24 06:09 2530909

“Install latest development version” or “Install in development mode”: https://docs.deepwisdom.ai/main/en/guide/get_started/installation.html

seehi avatar Sep 11 '24 06:09 seehi

I'll try

“Install latest development version” or “Install in development mode”: https://docs.deepwisdom.ai/main/en/guide/get_started/installation.html

2530909 avatar Sep 11 '24 06:09 2530909

I can't install the latest version of metagpt 0.81, and I'm not sure why.

“Install latest development version” 或 “Install in development mode” (安装最新开发版本) 或 “Install in development mode(以开发模式安装)”:https://docs.deepwisdom.ai/main/en/guide/get_started/installation.html

2530909 avatar Sep 11 '24 11:09 2530909

@2530909 Can you provide the installation error log with v0.8.1?

better629 avatar Oct 09 '24 16:10 better629

To install the latest development version, use the following command.

pip install git+https://github.com/geekan/MetaGPT 

Due to the lack of updates or replies by the user for a long time, we will close it. Please reopen it if necessary.

seehi avatar Oct 11 '24 02:10 seehi