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

Problem with module 'fake_useragent' #3

Open
azarijafari opened this issue Aug 13, 2023 · 12 comments
Open

Problem with module 'fake_useragent' #3

azarijafari opened this issue Aug 13, 2023 · 12 comments

Comments

@azarijafari
Copy link

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'

@HotDrify
Copy link
Owner

@azarijafari hello, try this: pip3 install fake-useragent

please put a star on the repository to promote the project<3

@azarijafari
Copy link
Author

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?

@HotDrify
Copy link
Owner

@azarijafari can you please send me the whole code of your google calab

@azarijafari
Copy link
Author

azarijafari commented Aug 13, 2023

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.

@HotDrify
Copy link
Owner

@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())

@azarijafari
Copy link
Author

Again error in the last line:
code: loop.run_until_complete(main())
error: RuntimeError: This event loop is already running

@HotDrify
Copy link
Owner

@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.

@azarijafari
Copy link
Author

RuntimeError: asyncio.run() cannot be called from a running event loop

@Devanaath
Copy link

Devanaath commented Aug 13, 2023

Man i get the same error when i try to run it on colab

Code:

!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())

Error:

---------------------------------------------------------------------------
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

@HotDrify
Copy link
Owner

@Devanaath the problem is most likely on the side of google calab

@Devanaath
Copy link

Ok @HotDrify, thanks for spending your time for me 😊

@HotDrify
Copy link
Owner

@Devanaath goodbye)

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

3 participants