Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2530909 opened this issue Sep 10, 2024 · 10 comments
Open

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

2530909 opened this issue Sep 10, 2024 · 10 comments

Comments

@2530909
Copy link

2530909 commented Sep 10, 2024

将文档进行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

@seehi
Copy link
Contributor

seehi commented Sep 10, 2024

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

@2530909
Copy link
Author

2530909 commented Sep 10, 2024

In version 0.8, I'm using the main branch

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

@seehi
Copy link
Contributor

seehi commented Sep 10, 2024

Is the output normal when executing the following code?

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

@2530909
Copy link
Author

2530909 commented Sep 11, 2024

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
Copy link
Author

2530909 commented Sep 11, 2024

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

@seehi
Copy link
Contributor

seehi commented Sep 11, 2024

Need to use main branch

@2530909
Copy link
Author

2530909 commented Sep 11, 2024

What does that mean? What am I supposed to do

Need to use main branch

@seehi
Copy link
Contributor

seehi commented Sep 11, 2024

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

@2530909
Copy link
Author

2530909 commented Sep 11, 2024

I'll try

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

@2530909
Copy link
Author

2530909 commented Sep 11, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants