MeUtils 2024.11.28.19.34.18__py3-none-any.whl → 2024.11.29.10.18.27__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.
- {MeUtils-2024.11.28.19.34.18.dist-info → MeUtils-2024.11.29.10.18.27.dist-info}/METADATA +27 -27
- {MeUtils-2024.11.28.19.34.18.dist-info → MeUtils-2024.11.29.10.18.27.dist-info}/RECORD +16 -16
- examples/_openaisdk/openai_embeddings.py +4 -2
- meutils/async_task/celery_config.py +7 -7
- meutils/async_task/demo_create_tasks.py +9 -3
- meutils/async_task/tasks/kling.py +1 -0
- meutils/async_task/tasks/test.py +19 -5
- meutils/async_utils/asyncer_.py +12 -3
- meutils/async_utils/common.py +9 -0
- meutils/data/VERSION +1 -1
- meutils/data/oneapi/NOTICE.md +6 -0
- meutils/schemas/oneapi/common.py +4 -0
- {MeUtils-2024.11.28.19.34.18.dist-info → MeUtils-2024.11.29.10.18.27.dist-info}/LICENSE +0 -0
- {MeUtils-2024.11.28.19.34.18.dist-info → MeUtils-2024.11.29.10.18.27.dist-info}/WHEEL +0 -0
- {MeUtils-2024.11.28.19.34.18.dist-info → MeUtils-2024.11.29.10.18.27.dist-info}/entry_points.txt +0 -0
- {MeUtils-2024.11.28.19.34.18.dist-info → MeUtils-2024.11.29.10.18.27.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: MeUtils
|
3
|
-
Version: 2024.11.
|
3
|
+
Version: 2024.11.29.10.18.27
|
4
4
|
Summary: description
|
5
5
|
Home-page: https://github.com/yuanjie-ai/MeUtils
|
6
6
|
Author: yuanjie
|
@@ -61,42 +61,42 @@ Requires-Dist: sse-starlette ; extra == 'ai'
|
|
61
61
|
Requires-Dist: openai ; extra == 'ai'
|
62
62
|
Requires-Dist: langchain ; extra == 'ai'
|
63
63
|
Provides-Extra: all
|
64
|
-
Requires-Dist:
|
65
|
-
Requires-Dist: polars ; extra == 'all'
|
66
|
-
Requires-Dist: fastapi ; extra == 'all'
|
67
|
-
Requires-Dist: pymysql ; extra == 'all'
|
68
|
-
Requires-Dist: jinja2 ; extra == 'all'
|
64
|
+
Requires-Dist: sqlalchemy ; extra == 'all'
|
69
65
|
Requires-Dist: streamlit ; extra == 'all'
|
70
|
-
Requires-Dist:
|
71
|
-
Requires-Dist:
|
72
|
-
Requires-Dist:
|
66
|
+
Requires-Dist: openai ; extra == 'all'
|
67
|
+
Requires-Dist: uvicorn ; extra == 'all'
|
68
|
+
Requires-Dist: fastapi[all] ; extra == 'all'
|
69
|
+
Requires-Dist: thriftpy2 ; extra == 'all'
|
73
70
|
Requires-Dist: asyncmy ; extra == 'all'
|
74
|
-
Requires-Dist: jmespath ; extra == 'all'
|
75
|
-
Requires-Dist: pandas-profiling[notebook] ; extra == 'all'
|
76
|
-
Requires-Dist: jieba ; extra == 'all'
|
77
71
|
Requires-Dist: iteration-utilities ; extra == 'all'
|
78
|
-
Requires-Dist:
|
72
|
+
Requires-Dist: pandas-summary ; extra == 'all'
|
79
73
|
Requires-Dist: pymilvus ; extra == 'all'
|
80
|
-
Requires-Dist: pyarrow ; extra == 'all'
|
81
|
-
Requires-Dist: uvicorn ; extra == 'all'
|
82
|
-
Requires-Dist: seaborn ; extra == 'all'
|
83
|
-
Requires-Dist: pretty-errors ; extra == 'all'
|
84
74
|
Requires-Dist: dataframe-image ; extra == 'all'
|
85
|
-
Requires-Dist:
|
86
|
-
Requires-Dist:
|
75
|
+
Requires-Dist: seaborn ; extra == 'all'
|
76
|
+
Requires-Dist: polars ; extra == 'all'
|
77
|
+
Requires-Dist: pandas-profiling[notebook] ; extra == 'all'
|
78
|
+
Requires-Dist: simplejson ; extra == 'all'
|
79
|
+
Requires-Dist: jieba ; extra == 'all'
|
80
|
+
Requires-Dist: jinja2 ; extra == 'all'
|
81
|
+
Requires-Dist: thefuck ; extra == 'all'
|
82
|
+
Requires-Dist: filetype ; extra == 'all'
|
83
|
+
Requires-Dist: redis-py-cluster ; extra == 'all'
|
84
|
+
Requires-Dist: pyarrow ; extra == 'all'
|
85
|
+
Requires-Dist: fastapi ; extra == 'all'
|
87
86
|
Requires-Dist: reportlab ; extra == 'all'
|
88
|
-
Requires-Dist: langchain ; extra == 'all'
|
89
87
|
Requires-Dist: sse-starlette ; extra == 'all'
|
90
|
-
Requires-Dist:
|
91
|
-
Requires-Dist:
|
92
|
-
Requires-Dist:
|
88
|
+
Requires-Dist: schedule ; extra == 'all'
|
89
|
+
Requires-Dist: jmespath ; extra == 'all'
|
90
|
+
Requires-Dist: geopy ; extra == 'all'
|
93
91
|
Requires-Dist: faiss-cpu ; extra == 'all'
|
92
|
+
Requires-Dist: langchain ; extra == 'all'
|
93
|
+
Requires-Dist: pymysql ; extra == 'all'
|
94
|
+
Requires-Dist: missingno ; extra == 'all'
|
94
95
|
Requires-Dist: gunicorn ; extra == 'all'
|
95
|
-
Requires-Dist:
|
96
|
-
Requires-Dist: filetype ; extra == 'all'
|
97
|
-
Requires-Dist: thriftpy2 ; extra == 'all'
|
96
|
+
Requires-Dist: cachetools ; extra == 'all'
|
98
97
|
Requires-Dist: pymupd ; extra == 'all'
|
99
|
-
Requires-Dist:
|
98
|
+
Requires-Dist: pymongo ; extra == 'all'
|
99
|
+
Requires-Dist: pretty-errors ; extra == 'all'
|
100
100
|
Provides-Extra: ann
|
101
101
|
Requires-Dist: pymilvus ; extra == 'ann'
|
102
102
|
Requires-Dist: faiss-cpu ; extra == 'ann'
|
@@ -94,7 +94,7 @@ examples/_openaisdk/openai_chatfire.py,sha256=x_YYgf3tYclickltbpdygTteZDYV55iPmw
|
|
94
94
|
examples/_openaisdk/openai_chatfire_all.py,sha256=DaiI1NfDeK655QvXyczkgXK9Awxp7NBe71LHA7trxGE,4831
|
95
95
|
examples/_openaisdk/openai_deepseek.py,sha256=-1WyTX5EfB8bdVhZ-y2yZQ04fVzujp4OPmOQR6i3QxI,660
|
96
96
|
examples/_openaisdk/openai_doubao.py,sha256=dp0SLvDBYpIJPNs_vnV2GBIEFa9FglNtYvfGKtJ9Bqk,1053
|
97
|
-
examples/_openaisdk/openai_embeddings.py,sha256=
|
97
|
+
examples/_openaisdk/openai_embeddings.py,sha256=jQLDB8IkmYiwhMi6OznoxXsIs-aYxQOfBZmj78NwKyc,952
|
98
98
|
examples/_openaisdk/openai_files.py,sha256=gfUbKGZg5P7c3kSMfwalIThi_SEs8O-JTqx49bYFtyM,1505
|
99
99
|
examples/_openaisdk/openai_god.py,sha256=O8fbhyxiIlVR7pTvBTXgQ2QTwfcZ2MkEIyDe_jp797A,1056
|
100
100
|
examples/_openaisdk/openai_groq.py,sha256=_5Ue1yEx0Gp6theFioB_D8kepR0UlqMU96PVGH-LkVY,7363
|
@@ -416,19 +416,19 @@ meutils/apis/voice_clone/__init__.py,sha256=y7Rpn90LocHhA0ywrDP_fT4QAK7sr4JsIX5w
|
|
416
416
|
meutils/apis/voice_clone/fish.py,sha256=6m8zcS2KEqmalKy2ArnOaNovyxsQp_sw4d_O1kVZR2s,7146
|
417
417
|
meutils/apis/voice_clone/fish_api.py,sha256=pDpE-B8HFiGIOV3NVd1HmFrCC2GQc3wH-81oNbTS0mY,307
|
418
418
|
meutils/async_task/__init__.py,sha256=QpkvoT6u-IBAlVgIevDkvEe_kVfW96UkS7i3NQHG63Y,303
|
419
|
-
meutils/async_task/celery_config.py,sha256=
|
419
|
+
meutils/async_task/celery_config.py,sha256=Mv8YjLQlHsWbVHw3wkauMw2H1g46KNnJa4EPehFj6dw,3308
|
420
420
|
meutils/async_task/common.py,sha256=LDoHKK8ouiN06NrwRn5vtmIyfGGH76iodtiS8Qjz-rM,1218
|
421
|
-
meutils/async_task/demo_create_tasks.py,sha256=
|
421
|
+
meutils/async_task/demo_create_tasks.py,sha256=Udj4cj_MriD90gJ5wrZunP0KtfZIsetlIo_VYZltstA,1598
|
422
422
|
meutils/async_task/通用设计.py,sha256=kGdrJHJu9VoOkyGHREn0KUtBTibAaLIcG0O6hEJNhLA,3232
|
423
423
|
meutils/async_task/tasks/__init__.py,sha256=2ilRdLq7JNpFU_xFc54r5JGOuNhx5r-zoyXqxC4WWIg,244
|
424
424
|
meutils/async_task/tasks/_all.py,sha256=Vz63k9yvgj-IBGjekm0u2t571TTT0nMRMqcPvPqJAbY,533
|
425
|
-
meutils/async_task/tasks/kling.py,sha256=
|
426
|
-
meutils/async_task/tasks/test.py,sha256=
|
425
|
+
meutils/async_task/tasks/kling.py,sha256=2_3Qve2VizWCfIWuJFUCG08_LuRCk4Q1Zzg15hXCmas,517
|
426
|
+
meutils/async_task/tasks/test.py,sha256=_-G8j0UQuL7mrTTvef_sBR2OhcK7NvLVhXzxEvgLtLE,1385
|
427
427
|
meutils/async_task/tasks/vidu.py,sha256=obBG4_bf1oPIlLxeca1s1dGOnlyam2xYRy-8TrH3ZTk,620
|
428
428
|
meutils/async_utils/__init__.py,sha256=IiJLRm258jkM4xAjUKOD7tVwHIemj7_1CuzXCu3TuQU,284
|
429
|
-
meutils/async_utils/asyncer_.py,sha256=
|
429
|
+
meutils/async_utils/asyncer_.py,sha256=S1Sp5WZx_uKM7kJyRVYU8QhmbjOh61JmfN2IN_PJNX4,736
|
430
430
|
meutils/async_utils/background.py,sha256=dl6UaMIFBZDB1uxSZzGFJdSnpt3Xo0flK7gwsokVy78,1464
|
431
|
-
meutils/async_utils/common.py,sha256=
|
431
|
+
meutils/async_utils/common.py,sha256=WIQ7CVaZiaUeFA3IInM_4uaehJQiTdr_g3Q_8_yQrgc,4899
|
432
432
|
meutils/async_utils/test.py,sha256=lkZdgSzzgVg8hYVcaBNEJ3KBvFTEfjbXZVvtknQZsRQ,1155
|
433
433
|
meutils/cache/__init__.py,sha256=7ke7BKRUkp1raYrsgOIojHHdeHYNstw9APIdBNDNRzc,2129
|
434
434
|
meutils/clis/__init__.py,sha256=2Fhn43X8kFP6FpAnnAMiPcdnjUwQaukiIr2uGB6mGAY,279
|
@@ -458,14 +458,14 @@ meutils/config_utils/lark_utils/demo.py,sha256=3g0Fs7oLaeW75T60gYWMLgyNg1OnfOjfH
|
|
458
458
|
meutils/config_utils/lark_utils/x.py,sha256=MlMQGhehP9xMEgetxVCX68XFaosfKoW1JA5cZ3JqN2w,1857
|
459
459
|
meutils/crawlers/__init__.py,sha256=TBU4xA-IOsHV-0yIkW7YXxn_QT7TT8NncqxO7IykEfs,271
|
460
460
|
meutils/data/SimHei.ttf,sha256=-XEnekS5yHP_URkT4XBI2w22ylV-KxudhkeIYFbrILA,10062565
|
461
|
-
meutils/data/VERSION,sha256=
|
461
|
+
meutils/data/VERSION,sha256=f0L6dn2h3nknjvKHdelnUUNe6yf8LbTsQh0R5DAGEzE,19
|
462
462
|
meutils/data/_FLAG,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
463
463
|
meutils/data/_SUCCESS,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
464
464
|
meutils/data/__init__.py,sha256=Hfwkkxs4zHqKhxht0YrhS566a9P5axtmgNvM5wF8ceQ,243
|
465
465
|
meutils/data/coordinate.py,sha256=VbFtcdho0XG4j-rZD0DgqcIf2_LR2LlbLtfhLXbxiDY,600
|
466
466
|
meutils/data/cowboy-hat-face.webp,sha256=AHi2t-WclDVKWgGEe-oZzI4xKACNlgGWUgd622y0K-E,24814
|
467
467
|
meutils/data/oneapi/FOOTER.md,sha256=UHv39ey2ICocxPoCj-UI_PWyyWxZYLS8zG1inqtWNQ4,448
|
468
|
-
meutils/data/oneapi/NOTICE.md,sha256=
|
468
|
+
meutils/data/oneapi/NOTICE.md,sha256=7yF5djeqq0MBUTtcYZxcYzeSGzPLdeJTceEldxS2eUA,1751
|
469
469
|
meutils/data/oneapi/__init__.py,sha256=cm2Kq2RDXPfdVMWcoBB77bu00zJpTDd21Rgc6bTlhws,398
|
470
470
|
meutils/db/__init__.py,sha256=HR99rqxoFTWXUHDhLVl33tzIn8M86gigHLmEzOKH1Ec,7637
|
471
471
|
meutils/db/mongo.py,sha256=B-B_t939rxtnNGt0PxhivjIUwinmHPzLUpXsjUIaTkQ,2337
|
@@ -665,7 +665,7 @@ meutils/schemas/db/__init__.py,sha256=m1maURVoM6dIW0yt6ELZrZTzULtkHybVOSXtHNJRVI
|
|
665
665
|
meutils/schemas/db/oneapi_types.py,sha256=yQEpaoOY-YWl9PP4INqapX9TENUVqfY7rjGFgBGKIT8,3459
|
666
666
|
meutils/schemas/oneapi/__init__.py,sha256=uevbi3QAvFzN9WPbx9bYKTDyKt7P2ueZO6W0nSiD0sk,289
|
667
667
|
meutils/schemas/oneapi/_types.py,sha256=ClvAaNy3SahEN8lL8KEErHTD6HANelXUeKc_3iLfosQ,1488
|
668
|
-
meutils/schemas/oneapi/common.py,sha256=
|
668
|
+
meutils/schemas/oneapi/common.py,sha256=Q6l0LuqvtdJTs3IqpxXRRIwGW89RYrEwKwZEwgnkPYM,22573
|
669
669
|
meutils/schemas/oneapi/icons.py,sha256=T7W5gInBJoHe62wzMimbG_UI-wn3_-rmQ1O4O2z-CQY,1089
|
670
670
|
meutils/schemas/oneapi/model_group_info.py,sha256=rGtflYJuFIjk5MsVEvK9JUR4IciX8jfErqeLqf8DIlQ,1586
|
671
671
|
meutils/schemas/oneapi/model_info.py,sha256=_uwKEPIIqm7ZYfhmpxtXB2QNsS83SpJY-OaBzvogC9w,772
|
@@ -791,9 +791,9 @@ meutils/tools/seize.py,sha256=nOKAS63w-Lbi48I0m2MPhdsokUTwxco0laPxYVmW4Mw,1064
|
|
791
791
|
meutils/tools/service_monitor.py,sha256=ibsLtBN2g2DL7ZnLJ8vhiZOiOcqTAyx711djDdBK-3M,1255
|
792
792
|
meutils/tools/sys_monitor.py,sha256=6MoyzrItqDUOSjfHcMJmMofQkEPTW36CT_aKui0rg84,429
|
793
793
|
meutils/tools/token_monitor.py,sha256=Np-YK-R4P4IPAXyZvMxwvXI4sFmNJQAQK1lSegNaYpA,997
|
794
|
-
MeUtils-2024.11.
|
795
|
-
MeUtils-2024.11.
|
796
|
-
MeUtils-2024.11.
|
797
|
-
MeUtils-2024.11.
|
798
|
-
MeUtils-2024.11.
|
799
|
-
MeUtils-2024.11.
|
794
|
+
MeUtils-2024.11.29.10.18.27.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
795
|
+
MeUtils-2024.11.29.10.18.27.dist-info/METADATA,sha256=LAOtygn5z2uvd5-OEiukCoFkBFeRjd1jVOCrWGSSzog,6144
|
796
|
+
MeUtils-2024.11.29.10.18.27.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
797
|
+
MeUtils-2024.11.29.10.18.27.dist-info/entry_points.txt,sha256=lufZlBHRqqZKdY-ZQJ4CSZb0qhV5hQC37egZna9M7ug,357
|
798
|
+
MeUtils-2024.11.29.10.18.27.dist-info/top_level.txt,sha256=cInfxMmkgNOskurdjwP5unau4rA7Uw48nu07tYhS7KY,22
|
799
|
+
MeUtils-2024.11.29.10.18.27.dist-info/RECORD,,
|
@@ -13,18 +13,20 @@ from meutils.pipe import *
|
|
13
13
|
from openai import OpenAI
|
14
14
|
|
15
15
|
client = OpenAI(
|
16
|
-
|
16
|
+
api_key="sk-iPNbgHSRkQ9VUb6iAcCa7a4539D74255A6462d29619d6519",
|
17
|
+
# api_key='sk-Gqbp2zoc71gWBVxvBd23D89f469e4e78A823357e2e625455',
|
17
18
|
|
18
19
|
# api_key=os.getenv("SILICONFLOW_API_KEY"),
|
19
20
|
# # api_key="sk-gcxjtocodgggxwnhqqsaqznpkpxndktwlgmgkmzljyajjsfp",
|
20
21
|
# base_url="https://api.siliconflow.cn/v1",
|
21
22
|
|
22
|
-
base_url="https://api.bltcy.ai/v1"
|
23
|
+
# base_url="https://api.bltcy.ai/v1"
|
23
24
|
)
|
24
25
|
|
25
26
|
model = "BAAI/bge-large-zh-v1.5"
|
26
27
|
model = "bge-large-zh-v1.5"
|
27
28
|
model = "text-embedding-3-small"
|
29
|
+
model = "text-embedding-ada-002"
|
28
30
|
#
|
29
31
|
# model = "BAAI/bge-m3"
|
30
32
|
|
@@ -18,12 +18,12 @@ result_backend = 'redis://localhost:6379/1' # 结果存储
|
|
18
18
|
|
19
19
|
# 添加以下配置增加可靠性
|
20
20
|
broker_connection_retry = True
|
21
|
-
broker_connection_max_retries =
|
21
|
+
broker_connection_max_retries = 5
|
22
22
|
broker_connection_retry_on_startup = True
|
23
23
|
|
24
24
|
# 时区设置
|
25
|
-
timezone = 'Asia/Shanghai'
|
26
25
|
enable_utc = False
|
26
|
+
timezone = 'Asia/Shanghai'
|
27
27
|
|
28
28
|
# 任务序列化与反序列化配置
|
29
29
|
task_serializer = 'json'
|
@@ -34,7 +34,7 @@ accept_content = ['json']
|
|
34
34
|
# worker_pool = 'solo' # 工作进程池类型,可选:'prefork'、'eventlet'、'gevent'
|
35
35
|
worker_pool_restarts = True
|
36
36
|
worker_concurrency = 8 # worker并发数,一般设置为CPU核心数
|
37
|
-
worker_prefetch_multiplier =
|
37
|
+
worker_prefetch_multiplier = 3 # 预取任务数
|
38
38
|
worker_max_tasks_per_child = 256 # 每个worker执行多少个任务后自动重启
|
39
39
|
|
40
40
|
# 任务队列配置
|
@@ -47,15 +47,15 @@ task_queues = (
|
|
47
47
|
|
48
48
|
# 任务执行设置
|
49
49
|
task_soft_time_limit = 10 * 60 # 任务软超时时间(秒)
|
50
|
-
task_time_limit =
|
50
|
+
task_time_limit = 2 * task_soft_time_limit # 任务硬超时时间(秒)
|
51
51
|
|
52
52
|
# 任务重试配置
|
53
53
|
task_publish_retry = True # 发布任务失败时重试
|
54
54
|
task_publish_retry_policy = {
|
55
|
-
'max_retries':
|
55
|
+
'max_retries': 5, # 最大重试次数
|
56
56
|
'interval_start': 0, # 初始重试等待时间
|
57
|
-
'interval_step':
|
58
|
-
'interval_max':
|
57
|
+
'interval_step': 2, # 重试间隔递增步长
|
58
|
+
'interval_max': 16, # 最大重试间隔
|
59
59
|
}
|
60
60
|
|
61
61
|
# # 任务路由配置
|
@@ -40,8 +40,14 @@ from celery.result import AsyncResult
|
|
40
40
|
if __name__ == '__main__':
|
41
41
|
# r = test.do_sync_task.apply_async(kwargs={'a': 1, 'b': 2})
|
42
42
|
# logger.debug(r.backend)
|
43
|
-
test.ado_sync_task.apply_async(kwargs={'a': 1, 'b': 2})
|
44
|
-
|
45
|
-
# print(AsyncResult(
|
43
|
+
# test.ado_sync_task.apply_async(kwargs={'a': 1, 'b': 2})
|
44
|
+
# test.ado_sync_task.apply_async(kwargs={'a': 1, 'b': 3})
|
45
|
+
# print(AsyncResult("42e191a0-6099-419e-b61d-07bf7e2df2fc").result)
|
46
46
|
# result.backend
|
47
47
|
|
48
|
+
# AsyncResult(r.id).result
|
49
|
+
|
50
|
+
|
51
|
+
# test.do_pydantic_task.apply_async(kwargs={'request': test.Request()})
|
52
|
+
|
53
|
+
test.do_pydantic_task.apply_async(kwargs={"request": {"method": "xx"}})
|
meutils/async_task/tasks/test.py
CHANGED
@@ -9,9 +9,8 @@
|
|
9
9
|
# @Description :
|
10
10
|
|
11
11
|
from meutils.pipe import *
|
12
|
-
from meutils.async_utils import async_to_sync
|
13
12
|
from meutils.decorators.retry import retrying
|
14
|
-
|
13
|
+
from meutils.async_utils import async_to_sync_pro
|
15
14
|
from meutils.async_task import worker, shared_task
|
16
15
|
|
17
16
|
|
@@ -22,15 +21,29 @@ def do_sync_task(sleep=10, **kwargs):
|
|
22
21
|
|
23
22
|
return kwargs
|
24
23
|
|
24
|
+
|
25
25
|
# AttributeError: 'AsyncToSync' object has no attribute '__name__'. Did you mean: '__ne__'?
|
26
|
-
|
27
|
-
|
26
|
+
|
27
|
+
|
28
|
+
# @shared_task(name='meutils.async_task.tasks.test.proxy_task')
|
29
|
+
@shared_task
|
30
|
+
@async_to_sync_pro
|
28
31
|
async def ado_sync_task(**kwargs):
|
29
32
|
logger.debug("同步任务+协程")
|
30
33
|
await asyncio.sleep(10)
|
31
34
|
return kwargs
|
32
35
|
|
33
36
|
|
37
|
+
class Request(BaseModel):
|
38
|
+
method: str = "GET"
|
39
|
+
url: str = "https://api.chatfire.cn/"
|
40
|
+
|
41
|
+
|
42
|
+
@worker.task(pydantic=True)
|
43
|
+
def do_pydantic_task(request: Request):
|
44
|
+
return request
|
45
|
+
|
46
|
+
|
34
47
|
@shared_task
|
35
48
|
@retrying(3)
|
36
49
|
def proxy_task(**kwargs):
|
@@ -45,4 +58,5 @@ def proxy_task(**kwargs):
|
|
45
58
|
|
46
59
|
|
47
60
|
if __name__ == '__main__':
|
48
|
-
print(do_sync_task.apply_async(kwargs={'a': 1, 'b': 2}))
|
61
|
+
# print(do_sync_task.apply_async(kwargs={'a': 1, 'b': 2}))
|
62
|
+
print(AsyncToSync)
|
meutils/async_utils/asyncer_.py
CHANGED
@@ -12,17 +12,26 @@ from meutils.pipe import *
|
|
12
12
|
import time
|
13
13
|
|
14
14
|
import anyio
|
15
|
-
from asyncer import asyncify
|
16
|
-
|
15
|
+
from asyncer import asyncify, syncify
|
17
16
|
|
17
|
+
@asyncify
|
18
18
|
def do_sync_work(name: str):
|
19
19
|
time.sleep(1)
|
20
20
|
return f"Hello, {name}"
|
21
21
|
|
22
22
|
|
23
|
+
@syncify
|
24
|
+
async def do_async_work(name: str):
|
25
|
+
await asyncio.sleep(1)
|
26
|
+
return f"Hello, a{name}"
|
27
|
+
|
23
28
|
async def main():
|
24
29
|
message = await asyncify(do_sync_work)(name="World")
|
25
30
|
print(message)
|
26
31
|
|
27
32
|
|
28
|
-
|
33
|
+
if __name__ == '__main__':
|
34
|
+
|
35
|
+
|
36
|
+
# arun(do_sync_work('xx'))
|
37
|
+
arun(do_async_work('xxx'))
|
meutils/async_utils/common.py
CHANGED
@@ -20,6 +20,15 @@ from httpx import Client, AsyncClient
|
|
20
20
|
from loguru import logger
|
21
21
|
from pprint import pprint
|
22
22
|
from aiostream import stream
|
23
|
+
from functools import wraps
|
24
|
+
|
25
|
+
|
26
|
+
def async_to_sync_pro(func):
|
27
|
+
@wraps(func) # 添加这行来保留原函数的属性
|
28
|
+
def wrapper(*args, **kwargs):
|
29
|
+
return async_to_sync(func)(*args, **kwargs)
|
30
|
+
|
31
|
+
return wrapper
|
23
32
|
|
24
33
|
|
25
34
|
async def achain(*iterables: Union[Iterator[Any], AsyncIterator[Any]], delay: int = 0) -> AsyncIterator[Any]:
|
meutils/data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2024.11.
|
1
|
+
2024.11.29.10.18.27
|
meutils/data/oneapi/NOTICE.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
<h1 align = "center">🔥公告🚀</h1>
|
2
2
|
|
3
3
|
---
|
4
|
+
|
5
|
+
## 2024-11-29
|
6
|
+
- 新增推理模型
|
7
|
+
- Qwen/QwQ-32B-Preview
|
8
|
+
> 强大的数学问题解决能力,在AIME、MATH-500数学评测上,超过了OpenAI o1-preview优秀的编码能力,LiveCodeBench接近OpenAI o1-preview
|
9
|
+
|
4
10
|
## 2024-11-25
|
5
11
|
- 新增虚拟换衣接口
|
6
12
|
- [可灵官方api格式](https://api.chatfire.cn/docs/api-237182295) 0.8/次
|
meutils/schemas/oneapi/common.py
CHANGED
@@ -293,6 +293,8 @@ MODEL_RATIO = {
|
|
293
293
|
"qwen2.5-72b-instruct": 4.13 / 2,
|
294
294
|
"qwen2.5-math-72b-instruct": 4.13 / 2,
|
295
295
|
"qwen2.5-coder-32b-instruct": 0.5,
|
296
|
+
"qwen/qwq-32b-preview": 1,
|
297
|
+
"QWEN/QWQ-32B-PREVIEW": 1,
|
296
298
|
|
297
299
|
"qwen1.5-7b-chat": 0.05, # 特价
|
298
300
|
"qwen1.5-14b-chat": 0.7,
|
@@ -603,6 +605,8 @@ COMPLETION_RATIO = {
|
|
603
605
|
"qwen2.5-coder-32b-instruct": 2,
|
604
606
|
|
605
607
|
"qwen-turbo-2024-11-01": 3,
|
608
|
+
"qwen/qwq-32b-preview": 2,
|
609
|
+
"QWEN/QWQ-32B-PREVIEW": 2,
|
606
610
|
|
607
611
|
}
|
608
612
|
|
File without changes
|
File without changes
|
{MeUtils-2024.11.28.19.34.18.dist-info → MeUtils-2024.11.29.10.18.27.dist-info}/entry_points.txt
RENAMED
File without changes
|
{MeUtils-2024.11.28.19.34.18.dist-info → MeUtils-2024.11.29.10.18.27.dist-info}/top_level.txt
RENAMED
File without changes
|