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

Error message is logged: RuntimeError: Event loop is closed #128

Open
hy18284 opened this issue Mar 27, 2024 · 1 comment
Open

Error message is logged: RuntimeError: Event loop is closed #128

hy18284 opened this issue Mar 27, 2024 · 1 comment

Comments

@hy18284
Copy link

hy18284 commented Mar 27, 2024

Hi,
Thank you for this great repository.

I have run into the following error message when running the code on the FED dataset.
The code continues to execute despite the logged error message and I can't seem to find the root cause.

It would be great if you could help me find answers to the following questions:

  1. What could be the cause of the error message?
  2. Does the error have any impact on the model's performance? (In other words, can it be ignored?)

Thank you.


Details:

  • Python 3.9.0
  • Ubuntu 20.04.5 LTS
  • Kernel version: 5.15.0-83-generic
  • Commit: 6e6dff6

Command:

agentverse-benchmark --task tasksolving/responsegen/gpt-3.5 --dataset_path data/responsegen/fed_data.jsonl --debug

Log:

===assistant===                                                                                                                                                                                  [124/1936]
  [a psychologist with expertise in behavior analysis]: While the response provided by the cybersecurity expert is relevant and important for data protection, it lacks empathy and engagement with the use
r's current situation. It would be beneficial to acknowledge the user's need for privacy and offer support or understanding in a more user-friendly manner.                                                
===assistant===                                                                                                                                                                                            
  [a cybersecurity expert specializing in data protection]: System: Remember to be cautious about discussing sensitive information in public chats to protect data privacy. If you need any advice on data 
protection, feel free to ask.Task exception was never retrieved                                                                                                                                            
future: <Task finished name='Task-30' coro=<AsyncClient.aclose() done, defined at /root/anaconda3/envs/agent_verse/lib/python3.9/site-packages/httpx/_client.py:1967> exception=RuntimeError('Event loop is
 closed')>                                                                                                                                                                                                 
Traceback (most recent call last):                                                                                                                                                                         
  File "/root/anaconda3/envs/agent_verse/lib/python3.9/site-packages/httpx/_client.py", line 1974, in aclose                                                                                               
    await self._transport.aclose()                                                                                                                                                                         
  File "/root/anaconda3/envs/agent_verse/lib/python3.9/site-packages/httpx/_transports/default.py", line 378, in aclose                                                                                    
    await self._pool.aclose()                                                                                                                                                                              
  File "/root/anaconda3/envs/agent_verse/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 314, in aclose                                                                              
    await connection.aclose()                                                                                                                                                                              
  File "/root/anaconda3/envs/agent_verse/lib/python3.9/site-packages/httpcore/_async/connection.py", line 173, in aclose                                                                                   
    await self._connection.aclose()                                                                                                                                                                        
  File "/root/anaconda3/envs/agent_verse/lib/python3.9/site-packages/httpcore/_async/http11.py", line 253, in aclose                                                                                       
    await self._network_stream.aclose()                                                                                                                                                                    
  File "/root/anaconda3/envs/agent_verse/lib/python3.9/site-packages/httpcore/_backends/anyio.py", line 54, in aclose                                                                                      
    await self._stream.aclose()                                                                                                                                                                            
  File "/root/anaconda3/envs/agent_verse/lib/python3.9/site-packages/anyio/streams/tls.py", line 202, in aclose                                                                                            
    await self.transport_stream.aclose()                                                                                                                                                                   
  File "/root/anaconda3/envs/agent_verse/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 1191, in aclose                                                                                    
    self._transport.close()                                                                                                                                                                                
  File "/root/anaconda3/envs/agent_verse/lib/python3.9/asyncio/selector_events.py", line 700, in close                                                                                                     
    self._loop.call_soon(self._call_connection_lost, None)                                                                                                                                                 
  File "/root/anaconda3/envs/agent_verse/lib/python3.9/asyncio/base_events.py", line 746, in call_soon                                                                                                     
    self._check_closed()
  File "/root/anaconda3/envs/agent_verse/lib/python3.9/asyncio/base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

===assistant===
  [a psychologist with expertise in behavior analysis]: While the response provided by the cybersecurity expert is important for data protection, it lacks empathy and engagement with the user's current s
ituation. It would be more beneficial to acknowledge the user's need for privacy and offer support or understanding in a more user-friendly manner.
===assistant===
  [a cybersecurity expert specializing in data protection]: System: I understand the need for privacy in certain situations. If you ever need advice on protecting sensitive information, feel free to reac
h out.                                            
===user===
  # Response Format Guidance
- If you thinks the latest response given above is perfect, respond using the following format:
Decision: (set it to "Agree")
Response: (your response on why you think it is perfect)

- If you think it is flawed, give your advice use the following output format:
Decision: (set it to "Disagree")
@1ring2rta
Copy link
Contributor

The issue was likely due to improper management of asynchronous resources, specifically the asynchronous client not being closed properly, which attempted operations on a closed event loop.

Solution: Implement the use of the async with statement to manage the lifecycle of the AsyncOpenAI client.

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