hjxdl 0.3.27__py3-none-any.whl → 0.3.28__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.
- hdl/_version.py +2 -2
- hdl/utils/decorators/llm.py +6 -0
- {hjxdl-0.3.27.dist-info → hjxdl-0.3.28.dist-info}/METADATA +1 -1
- {hjxdl-0.3.27.dist-info → hjxdl-0.3.28.dist-info}/RECORD +7 -7
- {hjxdl-0.3.27.dist-info → hjxdl-0.3.28.dist-info}/LICENSE +0 -0
- {hjxdl-0.3.27.dist-info → hjxdl-0.3.28.dist-info}/WHEEL +0 -0
- {hjxdl-0.3.27.dist-info → hjxdl-0.3.28.dist-info}/top_level.txt +0 -0
hdl/_version.py
CHANGED
hdl/utils/decorators/llm.py
CHANGED
@@ -13,8 +13,10 @@ def measure_stream_performance(func):
|
|
13
13
|
# 初始化计时和统计变量
|
14
14
|
first_char_time = None
|
15
15
|
total_chars = 0
|
16
|
+
total_tokens = 0
|
16
17
|
|
17
18
|
for i in stream:
|
19
|
+
total_tokens += 1
|
18
20
|
if i['type'] == 'text' and i['content']:
|
19
21
|
if first_char_time is None:
|
20
22
|
# 第一次输出字符的时间
|
@@ -31,12 +33,16 @@ def measure_stream_performance(func):
|
|
31
33
|
|
32
34
|
# 每秒输出的字符数
|
33
35
|
chars_per_second = total_chars / total_time if total_time > 0 else 0
|
36
|
+
tokens_per_second = total_tokens / total_time if total_time > 0 else 0
|
34
37
|
|
35
38
|
# 打印统计信息
|
36
39
|
print("\n--- Statistics ---")
|
37
40
|
print(f"Time to first character: {time_to_first_char:.2f} seconds")
|
38
41
|
print(f"Total time: {total_time:.2f} seconds")
|
42
|
+
print(f"Total characters: {total_chars}")
|
43
|
+
print(f"Total tokens: {total_tokens}")
|
39
44
|
print(f"Characters per second: {chars_per_second:.2f}")
|
45
|
+
print(f"Tokens per second: {tokens_per_second:.2f}")
|
40
46
|
|
41
47
|
return wrapper
|
42
48
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
hdl/__init__.py,sha256=GffnD0jLJdhkd-vo989v40N90sQbofkayRBwxc6TVhQ,72
|
2
|
-
hdl/_version.py,sha256=
|
2
|
+
hdl/_version.py,sha256=UN5ualVWmw8HnAwzrBSVto-hh1hWU3cwc0AuXsdYiWI,413
|
3
3
|
hdl/args/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
hdl/args/loss_args.py,sha256=s7YzSdd7IjD24rZvvOrxLLFqMZQb9YylxKeyelSdrTk,70
|
5
5
|
hdl/controllers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -122,7 +122,7 @@ hdl/utils/database_tools/connect.py,sha256=xCacGucKxlQUXs6AsNddpeECvdqT1180V1ZWq
|
|
122
122
|
hdl/utils/database_tools/datetime.py,sha256=xqE2xNiOpADzX-R8_bM0bioJRF3Ay9Jp1CAG6dy6uVI,1202
|
123
123
|
hdl/utils/database_tools/web.py,sha256=awJ8lafL-2KRjf3V1uuij8JIvX9U5fI8fLZKOkOvqtk,5771
|
124
124
|
hdl/utils/decorators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
125
|
-
hdl/utils/decorators/llm.py,sha256=
|
125
|
+
hdl/utils/decorators/llm.py,sha256=QCinGJ6eFlG-xMtfH6I2C5OI5-Vm0mJU8BVJ3UQCvz0,1851
|
126
126
|
hdl/utils/desc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
127
127
|
hdl/utils/desc/func_desc.py,sha256=sHmVZZmV7Zgii--gnHqMs6fTb7HVkqTOf8Pl_0F6qlI,3808
|
128
128
|
hdl/utils/desc/template.py,sha256=Kf_tbL-XkDCKNQ3UncbCuYEeUgXEa7kRVCf9TD2b8og,2526
|
@@ -143,8 +143,8 @@ hdl/utils/schedulers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
|
|
143
143
|
hdl/utils/schedulers/norm_lr.py,sha256=bDwCmdEK-WkgxQMFBiMuchv8Mm7C0-GZJ6usm-PQk14,4461
|
144
144
|
hdl/utils/weather/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
145
145
|
hdl/utils/weather/weather.py,sha256=k11o6wM15kF8b9NMlEfrg68ak-SfSYLN3nOOflFUv-I,4381
|
146
|
-
hjxdl-0.3.
|
147
|
-
hjxdl-0.3.
|
148
|
-
hjxdl-0.3.
|
149
|
-
hjxdl-0.3.
|
150
|
-
hjxdl-0.3.
|
146
|
+
hjxdl-0.3.28.dist-info/LICENSE,sha256=lkMiSbeZHBQLB9LJEkS9-L3Z-LBC4yGnKrzHSG8RkPM,2599
|
147
|
+
hjxdl-0.3.28.dist-info/METADATA,sha256=1XGiJCOBRzJdzAhry_kGvDLvyLeXdr37Ri_4Y7VvDFc,1336
|
148
|
+
hjxdl-0.3.28.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
149
|
+
hjxdl-0.3.28.dist-info/top_level.txt,sha256=-kxwTM5JPhylp06z3zAVO3w6_h7wtBfBo2zgM6YZoTk,4
|
150
|
+
hjxdl-0.3.28.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|