Skip to content

Commit 2527a83

Browse files
committed
Updated the openai.py
1 parent 5151b3f commit 2527a83

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

openevolve/llm/openai.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
"""
22
OpenAI API interface for LLMs
33
"""
4-
54
import asyncio
5+
6+
try:
7+
asyncio.get_running_loop()
8+
except RuntimeError:
9+
10+
loop = asyncio.new_event_loop()
11+
asyncio.set_event_loop(loop)
12+
613
import logging
714
import time
815
from typing import Any, Dict, List, Optional, Union

0 commit comments

Comments
 (0)