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

why fail to run? #1218

Closed
taozhiyuai opened this issue Apr 23, 2024 · 2 comments
Closed

why fail to run? #1218

taozhiyuai opened this issue Apr 23, 2024 · 2 comments

Comments

@taozhiyuai
Copy link

taozhiyuai commented Apr 23, 2024

Bug description
just install and run by following the instruction of GitHub. may I know what should I do not?

Bug solved method

Environment information

Full Example: https://github.com/geekan/MetaGPT/blob/main/config/config2.example.yaml

Reflected Code: https://github.com/geekan/MetaGPT/blob/main/metagpt/config2.py

llm:
api_type: "ollama" # or azure / ollama / open_llm etc. Check LLMType for more options
model: "llama3:70b-instruct-q6_K" # or gpt-3.5-turbo-1106 / gpt-4-1106-preview
base_url: "http://localhost:11434/v1" # or forward url / other llm url
api_key: "ollama"

  • LLM type and model name:
  • System version: my laptop is apple m3 max 128gb
  • Python version:3.12
  • MetaGPT version or branch: up to date
  • packages version:
  • installation method:

Screenshots or logs

2024-04-23 08:42:05.234 | INFO | metagpt.const:get_metagpt_package_root:29 - Package root set to /Users/taozhiyu
Configuration file initialized at /Users/taozhiyu/.metagpt/config2.yaml
(metagpt) taozhiyu@603e5f4a42f1 ~ % metagpt "taozhiyu"
2024-04-23 08:44:11.696 | INFO | metagpt.const:get_metagpt_package_root:29 - Package root set to /Users/taozhiyu
2024-04-23 08:44:27.534 | INFO | metagpt.team:invest:90 - Investment: $3.0.
2024-04-23 08:44:27.534 | INFO | metagpt.roles.role:_act:391 - Alice(Product Manager): to do PrepareDocuments(PrepareDocuments)
2024-04-23 08:44:27.587 | INFO | metagpt.utils.file_repository:save:57 - save to: /Users/taozhiyu/workspace/20240423084427/docs/requirement.txt
2024-04-23 08:44:27.588 | INFO | metagpt.roles.role:_act:391 - Alice(Product Manager): to do WritePRD(WritePRD)
2024-04-23 08:44:27.589 | INFO | metagpt.actions.write_prd:run:86 - New requirement detected: taozhiyu
2024-04-23 08:44:27.604 | ERROR | metagpt.utils.common:log_it:554 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 0.015(s), this was the 1st time calling it. exp: 'async for' requires an object with aiter method, got bytes
2024-04-23 08:44:28.504 | ERROR | metagpt.utils.common:log_it:554 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 0.914(s), this was the 2nd time calling it. exp: 'async for' requires an object with aiter method, got bytes
2024-04-23 08:44:29.595 | ERROR | metagpt.utils.common:log_it:554 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 2.006(s), this was the 3rd time calling it. exp: 'async for' requires an object with aiter method, got bytes
2024-04-23 08:44:31.304 | ERROR | metagpt.utils.common:log_it:554 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 3.715(s), this was the 4th time calling it. exp: 'async for' requires an object with aiter method, got bytes
2024-04-23 08:44:32.905 | ERROR | metagpt.utils.common:log_it:554 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 5.316(s), this was the 5th time calling it. exp: 'async for' requires an object with aiter method, got bytes
2024-04-23 08:44:45.998 | ERROR | metagpt.utils.common:log_it:554 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 18.409(s), this was the 6th time calling it. exp: 'async for' requires an object with aiter method, got bytes
2024-04-23 08:44:45.999 | WARNING | metagpt.utils.common:wrapper:649 - There is a exception in role's execution, in order to resume, we delete the newest role communication message in the role's memory.
2024-04-23 08:44:46.001 | ERROR | metagpt.utils.common:wrapper:631 - Exception occurs, start to serialize the project, exp:
Traceback (most recent call last):
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 50, in call
result = await fn(*args, **kwargs)
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/actions/action_node.py", line 420, in _aask_v1
content = await self.llm.aask(prompt, system_msgs, images=images, timeout=timeout)
TypeError: 'async for' requires an object with aiter method, got bytes

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/utils/common.py", line 640, in wrapper
return await func(self, *args, **kwargs)
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/roles/role.py", line 550, in run
rsp = await self.react()
tenacity.RetryError: RetryError[<Future at 0x35ab05fa0 state=finished raised TypeError>]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/utils/common.py", line 626, in wrapper
result = await func(self, *args, **kwargs)
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/team.py", line 134, in run
await self.env.run()
Exception: Traceback (most recent call last):
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 50, in call
result = await fn(*args, **kwargs)
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/actions/action_node.py", line 420, in _aask_v1
content = await self.llm.aask(prompt, system_msgs, images=images, timeout=timeout)
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/provider/base_llm.py", line 150, in aask
rsp = await self.acompletion_text(message, stream=stream, timeout=self.get_timeout(timeout))
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped
return await fn(*args, **kwargs)
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 47, in call
do = self.iter(retry_state=retry_state)
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/init.py", line 314, in iter
return fut.result()
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/concurrent/futures/_base.py", line 439, in result
return self.__get_result()
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
raise self._exception
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 50, in call
result = await fn(*args, **kwargs)
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/provider/base_llm.py", line 200, in acompletion_text
return await self._achat_completion_stream(messages, timeout=self.get_timeout(timeout))
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/provider/ollama_api.py", line 79, in _achat_completion_stream
async for raw_chunk in stream_resp:
TypeError: 'async for' requires an object with aiter method, got bytes

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/utils/common.py", line 640, in wrapper
return await func(self, *args, **kwargs)
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/roles/role.py", line 550, in run
rsp = await self.react()
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/roles/role.py", line 517, in react
rsp = await self._react()
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/roles/role.py", line 463, in _react
rsp = await self._act()
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/roles/role.py", line 392, in _act
response = await self.rc.todo.run(self.rc.history)
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/actions/write_prd.py", line 87, in run
return await self._handle_new_requirement(req)
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/actions/write_prd.py", line 108, in _handle_new_requirement
node = await WRITE_PRD_NODE.fill(context=context, llm=self.llm, exclude=exclude) # schema=schema
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/actions/action_node.py", line 505, in fill
return await self.simple_fill(schema=schema, mode=mode, images=images, timeout=timeout, exclude=exclude)
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/metagpt/actions/action_node.py", line 457, in simple_fill
content, scontent = await self._aask_v1(
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped
return await fn(*args, **kwargs)
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/_asyncio.py", line 47, in call
do = self.iter(retry_state=retry_state)
File "/Users/taozhiyu/miniconda3/envs/metagpt/lib/python3.9/site-packages/tenacity/init.py", line 326, in iter
raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x35ab05fa0 state=finished raised TypeError>]

@seehi
Copy link
Contributor

seehi commented Apr 23, 2024

Try base_url: "http://localhost:11434/api", or you can look at llm_api_configuration

@taozhiyuai
Copy link
Author

Try base_url: "http://localhost:11434/api", or you can look at llm_api_configuration

thanks.

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