We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6028900 commit 436c4ceCopy full SHA for 436c4ce
2 files changed
i2_client/client.py
@@ -13,6 +13,7 @@
13
14
import archipel_utils as utils
15
import msgpack
16
+import nest_asyncio
17
import websockets
18
19
log = logging.getLogger(__name__)
@@ -204,4 +205,12 @@ async def _inference(self, inputs):
204
205
await self.__aexit__(exc_type=None, exc_value=None, traceback=None)
206
return outputs
207
208
+ try:
209
+ loop = asyncio.get_running_loop()
210
+ if loop.is_running():
211
+ # when executed in jupyter notebook or something
212
+ nest_asyncio.apply(loop)
213
+ except RuntimeError:
214
+ pass
215
+
216
return asyncio.run(_inference(self, inputs))
setup.py
@@ -25,6 +25,7 @@
25
"imutils>=0.5.4",
26
"msgpack>=1.0",
27
"numpy>=1.19",
28
+ "nest-asyncio>=1.5",
29
"rich>=10.13",
30
"websockets>=8.1",
31
"opencv-python==4.6.0.66",
0 commit comments