speedy-utils 1.1.7__py3-none-any.whl → 1.1.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- llm_utils/lm/async_lm/async_llm_task.py +7 -0
- llm_utils/lm/async_lm/async_lm_base.py +2 -0
- {speedy_utils-1.1.7.dist-info → speedy_utils-1.1.8.dist-info}/METADATA +1 -1
- {speedy_utils-1.1.7.dist-info → speedy_utils-1.1.8.dist-info}/RECORD +6 -6
- {speedy_utils-1.1.7.dist-info → speedy_utils-1.1.8.dist-info}/WHEEL +0 -0
- {speedy_utils-1.1.7.dist-info → speedy_utils-1.1.8.dist-info}/entry_points.txt +0 -0
|
@@ -507,3 +507,10 @@ class AsyncLLMTask(ABC, Generic[InputModelType, OutputModelType]):
|
|
|
507
507
|
|
|
508
508
|
# Compatibility alias for other LLMTask implementations
|
|
509
509
|
arun = __call__
|
|
510
|
+
|
|
511
|
+
async def __aenter__(self):
|
|
512
|
+
return self
|
|
513
|
+
|
|
514
|
+
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
|
515
|
+
if self._lm and hasattr(self._lm, "aclose"): # Or self._lm.client
|
|
516
|
+
await self._lm._last_client._client.aclose()
|
|
@@ -54,6 +54,7 @@ class AsyncLMBase:
|
|
|
54
54
|
self._cache = cache
|
|
55
55
|
self.ports = ports
|
|
56
56
|
self._init_port = port # <-- store the port provided at init
|
|
57
|
+
self._last_client:AsyncOpenAI = None
|
|
57
58
|
|
|
58
59
|
@property
|
|
59
60
|
def client(self) -> AsyncOpenAI:
|
|
@@ -70,6 +71,7 @@ class AsyncLMBase:
|
|
|
70
71
|
api_key=self.api_key,
|
|
71
72
|
base_url=api_base,
|
|
72
73
|
)
|
|
74
|
+
self._last_client = client
|
|
73
75
|
return client
|
|
74
76
|
|
|
75
77
|
# ------------------------------------------------------------------ #
|
|
@@ -7,9 +7,9 @@ llm_utils/group_messages.py,sha256=Oe2tlhg-zRodG1-hodYebddrR77j9UdE05LzJw0EvYI,3
|
|
|
7
7
|
llm_utils/lm/__init__.py,sha256=rX36_MsnekM5GHwWS56XELbm4W5x2TDwnPERDTfo0eU,194
|
|
8
8
|
llm_utils/lm/async_lm/__init__.py,sha256=PUBbCuf5u6-0GBUu-2PI6YAguzsyXj-LPkU6vccqT6E,121
|
|
9
9
|
llm_utils/lm/async_lm/_utils.py,sha256=P1-pUDf_0pDmo8WTIi43t5ARlyGA1RIJfpAhz-gfA5g,6105
|
|
10
|
-
llm_utils/lm/async_lm/async_llm_task.py,sha256=
|
|
10
|
+
llm_utils/lm/async_lm/async_llm_task.py,sha256=ts0CoXRgqmKnC16qkPp7cA_PVY0sVAeo_RFrA7upVmg,18892
|
|
11
11
|
llm_utils/lm/async_lm/async_lm.py,sha256=J1KC7qCpG_CyJMWca4q71la7JHoANiLLSNQrQH44-z0,14045
|
|
12
|
-
llm_utils/lm/async_lm/async_lm_base.py,sha256=
|
|
12
|
+
llm_utils/lm/async_lm/async_lm_base.py,sha256=KNf7BoB69cGPaqwo9DjFKOcsGkxwr6e66D7cd92Gm2c,14919
|
|
13
13
|
llm_utils/lm/async_lm/lm_specific.py,sha256=KmqdCm3SJ5MqN-dRJd6S5tq5-ve1X2eNWf2CMFtc_3s,3926
|
|
14
14
|
llm_utils/lm/utils.py,sha256=a0KJj8vjT2fHKb7GKGNJjJHhKLThwpxIL7vnV9Fr3ZY,4584
|
|
15
15
|
llm_utils/scripts/README.md,sha256=yuOLnLa2od2jp4wVy3rV0rESeiV3o8zol5MNMsZx0DY,999
|
|
@@ -33,7 +33,7 @@ speedy_utils/multi_worker/thread.py,sha256=u_hTwXh7_FciMa5EukdEA1fDCY_vUC4moDceB
|
|
|
33
33
|
speedy_utils/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
34
|
speedy_utils/scripts/mpython.py,sha256=IvywP7Y0_V6tWfMP-4MjPvN5_KfxWF21xaLJsCIayCk,3821
|
|
35
35
|
speedy_utils/scripts/openapi_client_codegen.py,sha256=f2125S_q0PILgH5dyzoKRz7pIvNEjCkzpi4Q4pPFRZE,9683
|
|
36
|
-
speedy_utils-1.1.
|
|
37
|
-
speedy_utils-1.1.
|
|
38
|
-
speedy_utils-1.1.
|
|
39
|
-
speedy_utils-1.1.
|
|
36
|
+
speedy_utils-1.1.8.dist-info/METADATA,sha256=6QI2Y4BBZbNTn_gTZobOZdlqwY3x2EHFabMYPf9gv2Y,7441
|
|
37
|
+
speedy_utils-1.1.8.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
38
|
+
speedy_utils-1.1.8.dist-info/entry_points.txt,sha256=T1t85jwx8fK6m5msdkBGIXH5R5Kd0zSL0S6erXERPzg,237
|
|
39
|
+
speedy_utils-1.1.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|