Open azarijafari opened 1 year ago
@azarijafari hello, try this: pip3 install fake-useragent
please put a star on the repository to promote the project<3
Sure. Putting star Done. :)
But now this error occures:
RuntimeError: This event loop is already running
Can you execute a true code in google colab and share with me?
@azarijafari can you please send me the whole code of your google calab
Cell 1:
!pip install fake_useragent
Cell 2:
!git clone https://github.com/HotDrify/freeAI
%cd freeAI
!python3 setup.py install
Cell 3:
from freeAI import lockgpt
import asyncio
async def main():
result = await lockgpt.Completion.acreate("Hello! what language model are you?")
print(result)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
This cell face with an error.
@azarijafari cell 1: !pip install fake-useragent cell2 !pip install git+https://github.com/HotDrify/freeAI cell 3 from freeAI import lockgpt import asyncio
async def main(): result = await lockgpt.Completion.acreate("Hello! what language model are you?") print(result)
loop = asyncio.get_event_loop() loop.run_until_complete(main())
Again error in the last line:
code: loop.run_until_complete(main())
error: RuntimeError: This event loop is already running
@azarijafari from freeAI import lockgpt import asyncio
async def main(): result = await lockgpt.Completion.acreate("Hello! what language model are you?") print(result)
if name == "main": asyncio.run(main())
try like this.
RuntimeError: asyncio.run() cannot be called from a running event loop
Man i get the same error when i try to run it on colab
!pip install git+https://github.com/HotDrify/freeAI
from freeAI import mishalsgpt
import asyncio
async def main():
result = await mishalsgpt.Completion.acreate("Hello! what language model are you?")
print(result)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-3-f15bcb9cdc12> in <cell line: 9>()
7
8 loop = asyncio.get_event_loop()
----> 9 loop.run_until_complete(main())
1 frames
/usr/lib/python3.10/asyncio/base_events.py in run_until_complete(self, future)
623 """
624 self._check_closed()
--> 625 self._check_running()
626
627 new_task = not futures.isfuture(future)
/usr/lib/python3.10/asyncio/base_events.py in _check_running(self)
582 def _check_running(self):
583 if self.is_running():
--> 584 raise RuntimeError('This event loop is already running')
585 if events._get_running_loop() is not None:
586 raise RuntimeError(
RuntimeError: This event loop is already running
Please help us out @HotDrify
@Devanaath the problem is most likely on the side of google calab
Ok @HotDrify, thanks for spending your time for me 😊
@Devanaath goodbye)
When I want to run code in google colab this error occurs:
no module named 'fake_useragent'
I installed the package by:!pip install fake_useragent
but again faced with the error:no module named 'fake_useragent'