mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-09-12 08:29:30 -04:00
Fix: There is no current event loop in thread.
This commit is contained in:
parent
945f2feee4
commit
f89fa75176
@ -305,7 +305,8 @@ async def stream_generate(prompt: str, mode: optionsSets.optionSet = optionsSets
|
||||
|
||||
|
||||
def run(generator):
|
||||
loop = asyncio.get_event_loop()
|
||||
loop = asyncio.new_event_loop()
|
||||
asyncio.set_event_loop(loop)
|
||||
gen = generator.__aiter__()
|
||||
|
||||
while True:
|
||||
@ -315,10 +316,10 @@ def run(generator):
|
||||
|
||||
except StopAsyncIteration:
|
||||
break
|
||||
|
||||
#print('Done')
|
||||
|
||||
|
||||
|
||||
def convert(messages):
|
||||
context = ""
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user