lm-deluge 0.0.81__py3-none-any.whl → 0.0.82__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.
- lm_deluge/client.py +5 -0
- lm_deluge/tracker.py +16 -13
- {lm_deluge-0.0.81.dist-info → lm_deluge-0.0.82.dist-info}/METADATA +1 -1
- {lm_deluge-0.0.81.dist-info → lm_deluge-0.0.82.dist-info}/RECORD +7 -7
- {lm_deluge-0.0.81.dist-info → lm_deluge-0.0.82.dist-info}/WHEEL +0 -0
- {lm_deluge-0.0.81.dist-info → lm_deluge-0.0.82.dist-info}/licenses/LICENSE +0 -0
- {lm_deluge-0.0.81.dist-info → lm_deluge-0.0.82.dist-info}/top_level.txt +0 -0
lm_deluge/client.py
CHANGED
|
@@ -103,6 +103,11 @@ class _LLMClient(BaseModel):
|
|
|
103
103
|
_tracker: StatusTracker | None = PrivateAttr(default=None)
|
|
104
104
|
_capacity_lock: asyncio.Lock = PrivateAttr(default_factory=asyncio.Lock)
|
|
105
105
|
|
|
106
|
+
# usage
|
|
107
|
+
def print_usage(self):
|
|
108
|
+
if self._tracker:
|
|
109
|
+
self._tracker.log_usage()
|
|
110
|
+
|
|
106
111
|
# Progress management for queueing API
|
|
107
112
|
def open(self, total: int | None = None, show_progress: bool = True):
|
|
108
113
|
self._tracker = StatusTracker(
|
lm_deluge/tracker.py
CHANGED
|
@@ -157,19 +157,7 @@ class StatusTracker:
|
|
|
157
157
|
if response.usage.cache_write_tokens:
|
|
158
158
|
self.total_cache_write_tokens += response.usage.cache_write_tokens
|
|
159
159
|
|
|
160
|
-
def
|
|
161
|
-
# Close progress bar before printing final status
|
|
162
|
-
self.close_progress_bar()
|
|
163
|
-
|
|
164
|
-
if self.num_tasks_failed > 0:
|
|
165
|
-
print(
|
|
166
|
-
f"{self.num_tasks_failed} / {self.num_tasks_started} requests failed."
|
|
167
|
-
)
|
|
168
|
-
if self.num_rate_limit_errors > 0:
|
|
169
|
-
print(
|
|
170
|
-
f"{self.num_rate_limit_errors} rate limit errors received. Consider running at a lower rate."
|
|
171
|
-
)
|
|
172
|
-
|
|
160
|
+
def log_usage(self):
|
|
173
161
|
# Display cumulative usage stats if available
|
|
174
162
|
if (
|
|
175
163
|
self.total_cost > 0
|
|
@@ -190,6 +178,21 @@ class StatusTracker:
|
|
|
190
178
|
|
|
191
179
|
print(" ", " • ".join(usage_parts))
|
|
192
180
|
|
|
181
|
+
def log_final_status(self):
|
|
182
|
+
# Close progress bar before printing final status
|
|
183
|
+
self.close_progress_bar()
|
|
184
|
+
|
|
185
|
+
if self.num_tasks_failed > 0:
|
|
186
|
+
print(
|
|
187
|
+
f"{self.num_tasks_failed} / {self.num_tasks_started} requests failed."
|
|
188
|
+
)
|
|
189
|
+
if self.num_rate_limit_errors > 0:
|
|
190
|
+
print(
|
|
191
|
+
f"{self.num_rate_limit_errors} rate limit errors received. Consider running at a lower rate."
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
self.log_usage()
|
|
195
|
+
|
|
193
196
|
@property
|
|
194
197
|
def pbar(self) -> tqdm | None:
|
|
195
198
|
"""Backward compatibility property to access progress bar."""
|
|
@@ -2,7 +2,7 @@ lm_deluge/__init__.py,sha256=ye2mm-8r9bveEAMWyV13F6APAu2cNzHROU0LOULyPfY,792
|
|
|
2
2
|
lm_deluge/batches.py,sha256=Km6QM5_7BlF2qEyo4WPlhkaZkpzrLqf50AaveHXQOoY,25127
|
|
3
3
|
lm_deluge/cache.py,sha256=xO2AIYvP3tUpTMKQjwQQYfGRJSRi6e7sMlRhLjsS-u4,4873
|
|
4
4
|
lm_deluge/cli.py,sha256=Ilww5gOw3J5v0NReq_Ra4hhxU4BCIJBl1oTGxJZKedc,12065
|
|
5
|
-
lm_deluge/client.py,sha256=
|
|
5
|
+
lm_deluge/client.py,sha256=cQizLLgtbWdYqgYk-nJ0rZ4iC_oRp8zt6ip0KD1OEhY,44939
|
|
6
6
|
lm_deluge/config.py,sha256=C-_rVwAFL5sivLfKSkaa2ANMqqxKbyDCW86KfQB_Lck,1357
|
|
7
7
|
lm_deluge/embed.py,sha256=CO-TOlC5kOTAM8lcnicoG4u4K664vCBwHF1vHa-nAGg,13382
|
|
8
8
|
lm_deluge/errors.py,sha256=oHjt7YnxWbh-eXMScIzov4NvpJMo0-2r5J6Wh5DQ1tk,209
|
|
@@ -12,7 +12,7 @@ lm_deluge/mock_openai.py,sha256=-u4kxSzwoxDt_2fLh5LaiqETnu0Jg_VDL7TWAAYHGNw,2176
|
|
|
12
12
|
lm_deluge/prompt.py,sha256=vgI4cvk5gl6-x4uLm4X67eSANyrolJbpF5HXTz88550,70365
|
|
13
13
|
lm_deluge/request_context.py,sha256=CX15dT4Jxz77C-w5EKNyJCfYEa69wNKHbfNi47iG8W4,2771
|
|
14
14
|
lm_deluge/rerank.py,sha256=-NBAJdHz9OB-SWWJnHzkFmeVO4wR6lFV7Vw-SxG7aVo,11457
|
|
15
|
-
lm_deluge/tracker.py,sha256=
|
|
15
|
+
lm_deluge/tracker.py,sha256=B53KIsrK10L9L73cYbVB2pNSC0-FdvJGpIfw735CvaA,14808
|
|
16
16
|
lm_deluge/usage.py,sha256=xz9tAw2hqaJvv9aAVhnQ6N1Arn7fS8Shb28VwCW26wI,5136
|
|
17
17
|
lm_deluge/warnings.py,sha256=12RseSa9mYAFkbY783FQTP0x9RapRBErIQt4o7hzVnM,2321
|
|
18
18
|
lm_deluge/api_requests/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
@@ -80,8 +80,8 @@ lm_deluge/util/schema.py,sha256=q6uwhA4s1lM2dHT1Kwc46E7OY1VecMOtTEI0PTFn6tA,1320
|
|
|
80
80
|
lm_deluge/util/spatial.py,sha256=BsF_UKhE-x0xBirc-bV1xSKZRTUhsOBdGqsMKme20C8,4099
|
|
81
81
|
lm_deluge/util/validation.py,sha256=hz5dDb3ebvZrZhnaWxOxbNSVMI6nmaOODBkk0htAUhs,1575
|
|
82
82
|
lm_deluge/util/xml.py,sha256=Ft4zajoYBJR3HHCt2oHwGfymGLdvp_gegVmJ-Wqk4Ck,10547
|
|
83
|
-
lm_deluge-0.0.
|
|
84
|
-
lm_deluge-0.0.
|
|
85
|
-
lm_deluge-0.0.
|
|
86
|
-
lm_deluge-0.0.
|
|
87
|
-
lm_deluge-0.0.
|
|
83
|
+
lm_deluge-0.0.82.dist-info/licenses/LICENSE,sha256=uNNXGXPCw2TC7CUs7SEBkA-Mz6QBQFWUUEWDMgEs1dU,1058
|
|
84
|
+
lm_deluge-0.0.82.dist-info/METADATA,sha256=JWun2ggnWQ_LS5C1Yfi2AZtE84qMpr-TW0E8CeoQwsc,13595
|
|
85
|
+
lm_deluge-0.0.82.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
86
|
+
lm_deluge-0.0.82.dist-info/top_level.txt,sha256=hqU-TJX93yBwpgkDtYcXyLr3t7TLSCCZ_reytJjwBaE,10
|
|
87
|
+
lm_deluge-0.0.82.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|