Closed amirreza1307 closed 10 months ago
hi i use basic_generation in google colab but i get this error
RuntimeError Traceback (most recent call last) in <cell line: 22>() 24 try: ---> 25 loop.run_until_complete(amain()) 26 finally:
4 frames RuntimeError: This event loop is already running
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last) /usr/lib/python3.10/asyncio/selector_events.py in close(self) 82 def close(self): 83 if self.is_running(): ---> 84 raise RuntimeError("Cannot close a running event loop") 85 if self.is_closed(): 86 return
RuntimeError: Cannot close a running event loop
why?
You don't need to create a new event loop, instead of https://github.com/rany2/edge-tts/blob/master/examples/basic_generation.py#L23C1-L27 just do await amain()
await amain()
hi i use basic_generation in google colab but i get this error
RuntimeError Traceback (most recent call last) in <cell line: 22>()
24 try:
---> 25 loop.run_until_complete(amain())
26 finally:
4 frames RuntimeError: This event loop is already running
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last) /usr/lib/python3.10/asyncio/selector_events.py in close(self) 82 def close(self): 83 if self.is_running(): ---> 84 raise RuntimeError("Cannot close a running event loop") 85 if self.is_closed(): 86 return
RuntimeError: Cannot close a running event loop
why?