MeUtils 2024.3.4.13.4.45__py3-none-any.whl → 2025.1.16.17.15.52__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.3.4.13.4.45.dist-info → MeUtils-2025.1.16.17.15.52.dist-info}/METADATA +38 -32
- MeUtils-2025.1.16.17.15.52.dist-info/RECORD +864 -0
- {MeUtils-2024.3.4.13.4.45.dist-info → MeUtils-2025.1.16.17.15.52.dist-info}/WHEEL +1 -1
- {MeUtils-2024.3.4.13.4.45.dist-info → MeUtils-2025.1.16.17.15.52.dist-info}/entry_points.txt +1 -0
- apps/spider.py +24 -8
- examples/_openaisdk/4v.py +110 -0
- examples/_openaisdk/__init__.py +11 -0
- examples/_openaisdk/baichuan.py +38 -0
- examples/_openaisdk/bpo.py +138 -0
- examples/_openaisdk/chat_latex.py +95 -0
- examples/_openaisdk/chattts.py +85 -0
- examples/_openaisdk/copilot.py +48 -0
- examples/_openaisdk/dalle3.py +48 -0
- examples/_openaisdk/deeplx.py +31 -0
- examples/_openaisdk/demo.py +77 -0
- examples/_openaisdk/embeddings.py +34 -0
- examples/_openaisdk/gpt4all.py +69 -0
- examples/_openaisdk/gpt_fc.py +23 -0
- examples/_openaisdk/gr_vl.py +46 -0
- examples/_openaisdk/json_mode.py +12 -0
- examples/_openaisdk/kimi.py +91 -0
- examples/_openaisdk/kimi_qa.py +57 -0
- examples/_openaisdk/minimax.py +75 -0
- examples/_openaisdk/open_router.py +48 -0
- examples/_openaisdk/openai_aiplus.py +54 -0
- examples/_openaisdk/openai_audio.py +20 -0
- examples/_openaisdk/openai_baichuan.py +59 -0
- examples/_openaisdk/openai_cache.py +37 -0
- examples/_openaisdk/openai_chatfire.py +228 -0
- examples/_openaisdk/openai_chatfire_all.py +166 -0
- examples/_openaisdk/openai_deepinfra.py +55 -0
- examples/_openaisdk/openai_deepseek.py +29 -0
- examples/_openaisdk/openai_doubao.py +43 -0
- examples/_openaisdk/openai_embeddings.py +36 -0
- examples/_openaisdk/openai_files.py +57 -0
- examples/_openaisdk/openai_gitee.py +33 -0
- examples/_openaisdk/openai_god.py +45 -0
- examples/_openaisdk/openai_groq.py +240 -0
- examples/_openaisdk/openai_images.py +203 -0
- examples/_openaisdk/openai_json.py +78 -0
- examples/_openaisdk/openai_lingyi.py +59 -0
- examples/_openaisdk/openai_modelscope.py +54 -0
- examples/_openaisdk/openai_moon.py +55 -0
- examples/_openaisdk/openai_oi.py +61 -0
- examples/_openaisdk/openai_ppu.py +47 -0
- examples/_openaisdk/openai_qwen.py +58 -0
- examples/_openaisdk/openai_search.py +42 -0
- examples/_openaisdk/openai_sensenova.py +81 -0
- examples/_openaisdk/openai_siliconflow.py +52 -0
- examples/_openaisdk/openai_step.py +45 -0
- examples/_openaisdk/openai_test.py +66 -0
- examples/_openaisdk/openai_together.py +57 -0
- examples/_openaisdk/openai_tune.py +38 -0
- examples/_openaisdk/openai_zhipu.py +59 -0
- examples/_openaisdk/ppu.py +28 -0
- examples/_openaisdk/rag.py +54 -0
- examples/_openaisdk/rag_.py +26 -0
- examples/_openaisdk/test.py +52 -0
- examples/_openaisdk/x.py +32 -0
- examples/_openaisdk/xx.py +29 -0
- examples/_openaisdk/zhipu_files.py +47 -0
- examples/_openaisdk/zhipu_/346/231/272/350/203/275/344/275/223.py +45 -0
- examples/_openaisdk//345/205/234/345/272/225/346/265/213/350/257/225.py +50 -0
- examples/_openaisdk//345/244/232/346/250/241/346/200/201/346/265/213/350/257/225.py +76 -0
- examples/_openaisdk//345/244/232/346/250/241/346/200/201/346/265/213/350/257/225_.py +56 -0
- examples/_openaisdk//346/226/207/344/273/266/351/227/256/347/255/224.py +36 -0
- examples/_openaisdk//346/226/207/346/241/243/350/247/243/346/236/220.py +34 -0
- examples/_openaisdk//346/250/241/345/236/213/346/265/213/350/257/225.py +53 -0
- examples/_openaisdk//351/230/277/351/207/214.py +80 -0
- {meutils/serving/jina/__demo → examples/ann}/__init__.py +1 -1
- examples/ann/main.py +31 -0
- examples/apis/kl.py +28 -0
- examples/apis/x.py +17 -0
- examples/apis/xx.py +17 -0
- examples/arq_demo/demo.py +3 -0
- examples/backgroundtasks.py +25 -0
- examples/bserver.py +513 -21
- examples/cache_demo/HermesCache_demo.py +81 -0
- examples/cache_demo/acacge.py +26 -0
- examples/cache_demo/x.py +31 -0
- {meutils/docarray_utils → examples/caches}/__init__.py +1 -1
- examples/caches/llmcache.py +18 -0
- examples/celery_demo/product_task.py +2 -0
- examples/demo.py +17 -1
- examples/fastapi_caching.py +59 -0
- {meutils/dependencies → examples/gr}/__init__.py +1 -1
- examples/gr/d.py +22 -0
- examples/gr/demo.py +30 -0
- examples/ip2/345/234/260/345/214/272.py +16 -0
- examples/jinja2_demo/j2_demo.py +20 -1
- examples/json/346/240/207/345/207/206/345/214/226.py +54 -0
- examples/md.py +29 -0
- {meutils/serving/jina → examples/nesc}/__init__.py +1 -1
- examples/nesc/main.py +76 -0
- examples/orm/mysql_orm.py +113 -0
- examples/orm/sql_creater.py +57 -0
- examples/orm/sqlm.py +134 -0
- examples/rq_demo/fns.py +18 -0
- examples/rq_demo/redis/351/230/237/345/210/227.py +14 -7
- examples/rq_demo/redis/351/230/237/345/210/227_add_chatfire.py +30 -0
- examples/size_map.py +43 -0
- examples/test.py +59 -0
- examples/webs/__init__.py +11 -0
- examples/webs/main.py +34 -0
- examples/x.py +13 -0
- examples//345/216/273/346/260/264/345/215/260.py +20 -0
- examples//346/226/207/346/241/243/346/231/272/350/203/275/__init__.py +11 -0
- meutils/_utils.py +15 -6
- meutils/ai_audio/asr/__init__.py +3 -2
- meutils/ai_audio/asr/cf_asr.py +53 -0
- meutils/ai_audio/asr/de.py +11 -0
- meutils/ai_audio/asr/fast_asr.py +15 -7
- meutils/ai_audio/asr/openai_asr.py +83 -6
- meutils/ai_audio/fast_asr.py +8 -4
- meutils/ai_audio/tts/EdgeTTS.py +33 -7
- meutils/ai_audio/tts/openai_tts.py +24 -20
- meutils/ai_audio/tts/tts_ui.py +1 -0
- meutils/ai_audio/utils.py +9 -0
- meutils/ai_cv/__init__.py +0 -1
- meutils/ai_cv/ocr.py +3 -2
- meutils/ai_cv/utils.py +154 -0
- meutils/ai_video/avmerge.py +6 -0
- meutils/ai_video/video.py +11 -2
- meutils/{api → apis}/__init__.py +1 -1
- meutils/apis/ali_apis.py +60 -0
- meutils/apis/audio/__init__.py +10 -0
- meutils/apis/audio/deepinfra.py +59 -0
- meutils/apis/audio/fish.py +248 -0
- meutils/apis/baidu/__init__.py +9 -0
- meutils/apis/baidu/bdaitpzs.py +229 -0
- meutils/apis/baidu/test.py +78 -0
- meutils/apis/chatglm/__init__.py +11 -0
- meutils/apis/chatglm/glm_video.py +273 -0
- meutils/apis/chatglm/glm_video_api.py +116 -0
- meutils/apis/chatglm/images.py +63 -0
- meutils/apis/chatglm/temp.py +259 -0
- meutils/apis/chatglm/x.py +31 -0
- meutils/{api → apis}/common.py +10 -6
- meutils/apis/fal/__init__.py +11 -0
- meutils/apis/fal/files.py +53 -0
- meutils/apis/fal/images.py +57 -0
- meutils/apis/fal/images_.py +72 -0
- meutils/apis/fal/videos.py +77 -0
- meutils/apis/firecrawl.py +45 -0
- meutils/apis/gitee/__init__.py +11 -0
- meutils/apis/gitee/images/__init__.py +9 -0
- meutils/apis/gitee/images/kolors.py +99 -0
- meutils/apis/hailuoai/__init__.py +11 -0
- meutils/apis/hailuoai/demo.py +34 -0
- meutils/apis/hailuoai/hasha_new.py +248 -0
- meutils/apis/hailuoai/music.py +11 -0
- meutils/apis/hailuoai/upload.py +116 -0
- meutils/apis/hailuoai/videos.py +460 -0
- meutils/apis/hailuoai/yy.py +242 -0
- meutils/apis/hf/__init__.py +11 -0
- meutils/apis/hf/got_ocr.py +64 -0
- meutils/apis/hf/gradio.py +34 -0
- meutils/apis/hf/hivisionidphotos.py +80 -0
- meutils/apis/hf/kolors.py +68 -0
- meutils/apis/hf/kolors_virtual_try_on.py +107 -0
- meutils/apis/hf/r.py +53 -0
- meutils/apis/hf/x.py +26 -0
- meutils/apis/hf//350/257/201/344/273/266/347/205/247.py +41 -0
- meutils/apis/hunyuan/__init__.py +11 -0
- meutils/apis/hunyuan/image_tools.py +84 -0
- meutils/apis/images/__init__.py +11 -0
- meutils/apis/images/deepinfra.py +92 -0
- meutils/apis/images/demo.py +150 -0
- meutils/apis/images/eidt.py +36 -0
- meutils/apis/images/flux/__init__.py +11 -0
- meutils/apis/images/flux/fluxpro.py +108 -0
- meutils/apis/images/flux/mystic.py +116 -0
- meutils/apis/images/ideogram/__init__.py +10 -0
- meutils/apis/images/ideogram/ideogram_images.py +193 -0
- meutils/apis/images/prodia/__init__.py +12 -0
- meutils/apis/images/prodia/faceswap.py +76 -0
- meutils/apis/images/recraft.py +152 -0
- meutils/apis/images/virtual_try_on/__init__.py +11 -0
- meutils/apis/images/virtual_try_on/images.py +65 -0
- meutils/apis/jiema/24mail.py +96 -0
- meutils/apis/jiema/__init__.py +11 -0
- meutils/apis/jiema/yezi.py +97 -0
- meutils/apis/jimeng/__init__.py +11 -0
- meutils/apis/jimeng/common.py +328 -0
- meutils/apis/jimeng/doubao.py +68 -0
- meutils/apis/jimeng/doubao_utils.py +175 -0
- meutils/apis/jimeng/files.py +263 -0
- meutils/apis/jimeng/images.py +140 -0
- meutils/apis/jimeng/lip_sync.py +11 -0
- meutils/apis/jina.py +55 -0
- meutils/apis/kling/__init__.py +11 -0
- meutils/apis/kling/api.py +60 -0
- meutils/apis/kling/images.py +174 -0
- meutils/apis/kling/kolors_virtual_try_on.py +111 -0
- meutils/apis/kling/kolors_virtual_try_on_web.py +126 -0
- meutils/apis/kling/videos.py +67 -0
- meutils/apis/kling//351/211/264/346/235/203.py +34 -0
- meutils/apis/kuaidi.py +32 -0
- meutils/apis/kuaishou/__init__.py +10 -0
- meutils/apis/kuaishou/klingai.py +523 -0
- meutils/apis/kuaishou/klingai_video.py +197 -0
- meutils/apis/kuaishou/kolors.py +189 -0
- meutils/apis/llm_qa.py +55 -0
- meutils/apis/luma/__init__.py +11 -0
- meutils/apis/luma/luma.py +123 -0
- meutils/apis/minicpm/__init__.py +9 -0
- meutils/apis/minicpm/luca.py +137 -0
- meutils/apis/monica/__init__.py +11 -0
- meutils/apis/monica/llm.py +11 -0
- meutils/apis/napkin/__init__.py +11 -0
- meutils/apis/napkin/icons.py +42 -0
- meutils/apis/niutrans.py +73 -0
- meutils/apis/oneapi/__init__.py +11 -0
- meutils/apis/oneapi/channel.py +68 -0
- meutils/apis/oneapi/common.py +135 -0
- meutils/apis/oneapi/log.py +47 -0
- meutils/apis/oneapi/token.py +48 -0
- meutils/apis/oneapi/token_.py +112 -0
- meutils/apis/oneapi/user.py +100 -0
- meutils/apis/oneapi/utils.py +47 -0
- meutils/apis/pixverse/__init__.py +11 -0
- meutils/apis/pixverse/pixverse.py +150 -0
- meutils/apis/proxy/__init__.py +11 -0
- meutils/apis/proxy/ips.py +178 -0
- meutils/apis/remini/__init__.py +11 -0
- meutils/apis/remini/remini.py +89 -0
- meutils/apis/replicateai/__init__.py +11 -0
- meutils/apis/replicateai/images.py +79 -0
- meutils/apis/replicateai/raw.py +53 -0
- meutils/apis/runwayml/__init__.py +10 -0
- meutils/apis/runwayml/gen.py +143 -0
- meutils/apis/search/__init__.py +11 -0
- meutils/apis/search/baichuan.py +11 -0
- meutils/apis/search/metaso.py +218 -0
- meutils/apis/search/metaso_.py +77 -0
- meutils/apis/search/n.py +99 -0
- meutils/apis/search/searxng.py +42 -0
- meutils/apis/search_music.py +39 -0
- meutils/apis/siliconflow/__init__.py +9 -0
- meutils/apis/siliconflow/audio.py +63 -0
- meutils/apis/siliconflow/image_to_image.py +116 -0
- meutils/apis/siliconflow/images.py +154 -0
- meutils/apis/siliconflow/rerankers.py +40 -0
- meutils/apis/siliconflow/text_to_image.py +132 -0
- meutils/apis/siliconflow/utils.py +66 -0
- meutils/apis/siliconflow/videos.py +102 -0
- meutils/apis/sunoai/__init__.py +10 -0
- meutils/apis/sunoai/haimian.py +135 -0
- meutils/apis/sunoai/suno.py +373 -0
- meutils/apis/textcard/__init__.py +11 -0
- meutils/apis/textcard/demo.py +25 -0
- meutils/apis/textcard/hanyuxinjie.py +81 -0
- meutils/apis/textin.py +159 -0
- meutils/apis/to_image/__init__.py +11 -0
- meutils/apis/to_image/html2image.py +29 -0
- meutils/apis/to_image/md.py +29 -0
- meutils/apis/to_image/url2image.py +41 -0
- meutils/apis/together/__init__.py +11 -0
- meutils/apis/together/images.py +80 -0
- meutils/apis/translator/__init__.py +9 -0
- meutils/apis/translator/deeplx.py +55 -0
- meutils/apis/tripo3d/__init__.py +11 -0
- meutils/apis/tripo3d/images.py +106 -0
- meutils/apis/ts.py +60 -0
- meutils/apis/uptime_kuma/__init__.py +11 -0
- meutils/apis/uptime_kuma/common.py +56 -0
- meutils/apis/uptime_kuma//345/233/275/344/272/247/345/210/206/347/273/204.py +68 -0
- meutils/apis/utils.py +47 -0
- meutils/apis/videos/__init__.py +11 -0
- meutils/apis/videos/sora.py +16 -0
- meutils/apis/vidu/__init__.py +9 -0
- meutils/apis/vidu/vidu_video.py +254 -0
- meutils/apis/vidu/x.py +14 -0
- meutils/apis/voice_clone/__init__.py +10 -0
- meutils/apis/voice_clone/fish.py +236 -0
- meutils/apis/voice_clone/fish_api.py +16 -0
- meutils/apis/web_search.py +31 -0
- meutils/apis/yezi.py +97 -0
- meutils/async_task/__init__.py +13 -0
- meutils/async_task/celery_config.py +106 -0
- meutils/async_task/common.py +37 -0
- meutils/async_task/demo_create_tasks.py +73 -0
- meutils/async_task/tasks/__init__.py +11 -0
- meutils/async_task/tasks/_all.py +20 -0
- meutils/async_task/tasks/hailuo.py +24 -0
- meutils/async_task/tasks/kling.py +30 -0
- meutils/async_task/tasks/replicateai.py +24 -0
- meutils/async_task/tasks/test.py +124 -0
- meutils/async_task/tasks/vidu.py +28 -0
- meutils/async_task/utils.py +191 -0
- meutils/async_task//351/200/232/347/224/250/350/256/276/350/256/241.py +119 -0
- meutils/async_utils/asyncer_.py +37 -0
- meutils/async_utils/background.py +68 -0
- meutils/async_utils/common.py +136 -16
- meutils/async_utils/test.py +47 -0
- meutils/cache_utils.py +29 -23
- meutils/caches/__init__.py +9 -0
- meutils/caches/acache.py +45 -0
- meutils/caches/redis_cache.py +63 -0
- meutils/clis/check_api.py +66 -0
- meutils/clis/cli.py +1 -1
- meutils/common.py +56 -17
- meutils/config_utils/__init__.py +11 -0
- meutils/config_utils/lark_utils/__init__.py +11 -0
- meutils/config_utils/lark_utils/common.py +385 -0
- meutils/config_utils/lark_utils/demo.py +13 -0
- meutils/config_utils/lark_utils/x.py +50 -0
- meutils/config_utils/manager.py +108 -0
- meutils/crawlers/__init__.py +11 -0
- meutils/data/VERSION +1 -1
- meutils/data/cowboy-hat-face.webp +0 -0
- meutils/data/oneapi/FOOTER.md +7 -0
- meutils/data/oneapi/NOTICE.md +138 -0
- meutils/data/oneapi/__init__.py +15 -0
- meutils/db/orm.py +179 -0
- meutils/db/redis_db.py +87 -0
- meutils/decorators/cache.py +1 -1
- meutils/decorators/common.py +84 -5
- meutils/decorators/contextmanagers.py +17 -6
- meutils/decorators/fastapi_decorator.py +77 -3
- meutils/decorators/polling.py +46 -0
- meutils/decorators/retry.py +150 -26
- meutils/fastapi_utils/__init__.py +11 -0
- meutils/fastapi_utils/exceptions/http_error.py +72 -0
- meutils/fastapi_utils/exceptions/validation_error.py +44 -0
- meutils/hash_utils.py +9 -4
- meutils/hooks/__init__.py +11 -0
- meutils/hooks/hook_test.py +174 -0
- meutils/hooks/wechat.py +162 -0
- meutils/hooks/wechat_channel.py +303 -0
- meutils/init/evn.py +1 -1
- meutils/io/files_utils.py +232 -0
- meutils/io/image.py +148 -10
- meutils/io/x.py +75 -0
- meutils/llm/__init__.py +10 -0
- meutils/llm/check_api.py +109 -0
- meutils/llm/check_utils.py +106 -0
- meutils/llm/clients.py +38 -0
- meutils/llm/completions/__init__.py +11 -0
- meutils/llm/completions/agents/__init__.py +11 -0
- meutils/llm/completions/agents/file.py +125 -0
- meutils/llm/completions/cp.py +112 -0
- meutils/llm/completions/delilegal.py +135 -0
- meutils/llm/completions/dify.py +81 -0
- meutils/llm/completions/kimi.py +47 -0
- meutils/llm/completions/modelscope.py +11 -0
- meutils/{fileparser/filetype.py → llm/completions/oi.py} +5 -3
- meutils/llm/completions/rag/__init__.py +11 -0
- meutils/llm/completions/rag/fire.py +157 -0
- meutils/llm/completions/rag/qwen.py +11 -0
- meutils/llm/completions/rag/rag.py +41 -0
- meutils/llm/completions/rag.py +38 -0
- meutils/llm/completions/tryblend.py +201 -0
- meutils/llm/completions/tune.py +284 -0
- meutils/llm/completions/x.py +26 -0
- meutils/llm/completions/xx.py +61 -0
- meutils/llm/completions/yuanbao.py +176 -0
- meutils/llm/demo.py +114 -0
- meutils/llm/functions/__init__.py +11 -0
- meutils/llm/mappers.py +15 -0
- meutils/llm/openai_utils/__init__.py +11 -0
- meutils/llm/openai_utils/common.py +284 -0
- meutils/llm/openai_utils/tool_outputs.py +45 -0
- meutils/llm/output_parsers/__init__.py +80 -0
- meutils/llm/prompts/__init__.py +244 -0
- meutils/llm/prompts/demo.py +155 -0
- meutils/llm/prompts/html2image_test.py +19 -0
- meutils/llm/utils.py +133 -0
- meutils/llm/x.py +75 -0
- meutils/notice/feishu.py +40 -9
- meutils/notice/wechat.py +23 -21
- meutils/np_utils.py +10 -1
- meutils/office_automation/pdf.py +6 -1
- meutils/oss/__init__.py +20 -0
- meutils/oss/minio_oss.py +184 -0
- meutils/oss/minio_utils.py +48 -0
- meutils/other/__demo.py +6 -4
- meutils/pandas_utils/__init__.py +1 -0
- meutils/pandas_utils/common.py +31 -0
- meutils/pandas_utils/pd_utils.py +10 -6
- meutils/parsers/__init__.py +10 -0
- meutils/parsers/file_parsers.py +110 -0
- meutils/parsers/fileparser/demo.py +41 -0
- meutils/parsers/fileparser/filetype.py +41 -0
- meutils/pay.py +37 -0
- meutils/pipe.py +37 -4
- meutils/playwright_utils/common.py +20 -12
- meutils/plots/common.py +35 -34
- meutils/queues/demo.py +56 -0
- meutils/queues/smooth_queue.py +120 -0
- meutils/queues/uniform_queue.py +3 -1
- meutils/request_utils/__init__.py +26 -2
- meutils/request_utils/ark.py +47 -0
- meutils/request_utils/crawler.py +34 -5
- meutils/request_utils/jwt_utils/__init__.py +11 -0
- meutils/request_utils/jwt_utils/common.py +42 -0
- meutils/request_utils/volc.py +160 -0
- meutils/schemas/__init__.py +0 -1
- meutils/schemas/baidu_types.py +70 -0
- meutils/schemas/batch_types.py +450 -0
- meutils/schemas/celery_types.py +64 -0
- meutils/schemas/chatfire_types.py +15 -0
- meutils/schemas/chatglm_types.py +197 -0
- meutils/schemas/db/__init__.py +11 -0
- meutils/schemas/db/oneapi_types.py +117 -0
- meutils/schemas/dify_types.py +40 -0
- meutils/schemas/embedding.py +31 -0
- meutils/schemas/fal_types.py +13 -0
- meutils/schemas/fish_types.py +11 -0
- meutils/schemas/hailuo_types.py +208 -0
- meutils/schemas/haimian_types.py +51 -0
- meutils/schemas/idphoto_types.py +43 -0
- meutils/schemas/image_types.py +476 -0
- meutils/schemas/jimeng_types.py +28 -0
- meutils/schemas/jina_types.py +67 -0
- meutils/schemas/kimi_types.py +86 -0
- meutils/schemas/kling_types.py +235 -0
- meutils/schemas/kuaishou_types.py +328 -0
- meutils/schemas/luma_types.py +59 -0
- meutils/schemas/message_types.py +165 -0
- meutils/schemas/message_types_.py +219 -0
- meutils/schemas/metaso_types.py +64 -0
- meutils/schemas/napkin_types.py +85 -0
- meutils/schemas/ocr_types.py +37 -0
- meutils/schemas/oneapi/__init__.py +11 -0
- meutils/schemas/oneapi/_types.py +49 -0
- meutils/schemas/oneapi/common.py +883 -0
- meutils/schemas/oneapi/icons.py +30 -0
- meutils/schemas/oneapi/model_group_info.py +48 -0
- meutils/schemas/oneapi/model_info.py +34 -0
- meutils/schemas/oneapi/models.py +26 -0
- meutils/schemas/oneapi/x.py +26 -0
- meutils/schemas/oneapi//351/207/215/345/256/232/345/220/221.py +132 -0
- meutils/schemas/openai_api_protocol.py +411 -0
- meutils/schemas/openai_types.py +366 -0
- meutils/schemas/pixverse_types.py +88 -0
- meutils/schemas/playwright_types.py +57 -0
- meutils/schemas/prodia_types.py +19 -0
- meutils/schemas/replicate_types.py +112 -0
- meutils/schemas/request_types.py +20 -0
- meutils/schemas/runwayml_types.py +190 -0
- meutils/schemas/siliconflow_types.py +80 -0
- meutils/schemas/step_types.py +19 -0
- meutils/schemas/suno_types.py +319 -0
- meutils/schemas/task_types.py +192 -0
- meutils/schemas/translator_types.py +29 -0
- meutils/schemas/tripo3d_types.py +57 -0
- meutils/schemas/tryblend_types.py +51 -0
- meutils/schemas/video_types.py +62 -0
- meutils/schemas/vidu_types.py +350 -0
- meutils/schemas/wechat_types.py +316 -0
- meutils/schemas/yuanbao_types.py +260 -0
- meutils/serving/celery/__init__.py +8 -0
- meutils/serving/celery/config.py +115 -0
- meutils/serving/celery/router.py +4 -6
- meutils/serving/celery/tasks.py +6 -4
- meutils/serving/celery//351/200/232/347/224/250/350/256/276/350/256/241.py +119 -0
- meutils/serving/fastapi/common.py +27 -31
- meutils/serving/fastapi/dependencies/__init__.py +0 -1
- meutils/serving/fastapi/dependencies/auth.py +55 -2
- meutils/serving/fastapi/exceptions/http_error.py +67 -2
- meutils/serving/fastapi/exceptions/validation_error.py +18 -2
- meutils/serving/fastapi/lifespans.py +73 -0
- meutils/serving/fastapi/routers/scheduler.py +12 -0
- meutils/serving/fastapi/routers/screenshot.py +47 -0
- meutils/serving/fastapi/routers/spider.py +8 -3
- meutils/serving/fastapi/routers/task.py +48 -0
- meutils/serving/fastapi/utils.py +48 -1
- meutils/serving/streamlit/common.py +1 -1
- meutils/smooth_utils.py +3 -0
- meutils/str_utils/__init__.py +22 -3
- meutils/str_utils/json_utils.py +7 -0
- meutils/str_utils/regular_expression.py +102 -10
- meutils/templates/xx.html +21 -0
- meutils/templates/xxx.html +117 -0
- meutils/todo.py +12 -0
- meutils/tools/token_monitor.py +33 -0
- MeUtils-2024.3.4.13.4.45.dist-info/RECORD +0 -540
- meutils/ai_audio/asr/subtitle.srt +0 -40
- meutils/ai_audio/demo.ipynb +0 -1215
- meutils/ai_audio/example.srt +0 -348
- meutils/ai_audio/new.srt +0 -179
- meutils/ai_audio/subtitles.srt +0 -696
- meutils/ai_audio/tts/new.srt +0 -179
- meutils/ai_audio//350/247/206/351/242/221/345/220/210/345/271/266.sh +0 -32
- meutils/ai_cv/1.jpg +0 -0
- meutils/ai_cv/197.jpg +0 -0
- meutils/ai_cv/2.jpg +0 -0
- meutils/ai_cv/img.png +0 -0
- meutils/ai_cv/invoice.jpg +0 -0
- meutils/ai_cv/tbl.png +0 -0
- meutils/ai_cv/test.png +0 -0
- meutils/ann/README.md +0 -33
- meutils/ann/README_gensim.md +0 -47
- meutils/ann/examples/client.py +0 -59
- meutils/ann/examples/demo.py +0 -24
- meutils/api/deeplx.py +0 -29
- meutils/api/qr.png +0 -0
- meutils/clis/README.md +0 -29
- meutils/clis/__test.sh +0 -17
- meutils/clis/deepseek.txt +0 -8
- meutils/clis/deepseek_13003330042.json +0 -1
- meutils/clis/deepseek_13003872192.json +0 -1
- meutils/clis/deepseek_13852263862.json +0 -1
- meutils/clis/deepseek_13913898681.json +0 -1
- meutils/clis/deepseek_13962978617.json +0 -1
- meutils/clis/deepseek_15251801790.json +0 -1
- meutils/clis/deepseek_15720826383.json +0 -1
- meutils/clis/deepseek_18395563611.json +0 -1
- meutils/clis/deepseek_313303303@qq.com.json +0 -1
- meutils/clis/kimi_state.json +0 -1
- meutils/cmds/README.md +0 -55
- meutils/coding/__init__.py +0 -11
- meutils/coding/find132.py +0 -40
- meutils/db/README.md +0 -51
- meutils/decorators/README.md +0 -17
- meutils/docarray_utils/demo_es.py +0 -34
- meutils/docarray_utils/demo_hnsw.py +0 -55
- meutils/docarray_utils/in_memory.py +0 -38
- meutils/docarray_utils//346/224/271/351/200/240/344/270/213hnsw.py +0 -43
- meutils/io/file.py +0 -20
- meutils/io/img.png +0 -0
- meutils/io/x.yml +0 -1
- meutils/notice/img.png +0 -0
- meutils/notice/todo.md +0 -10
- meutils/office_automation//346/212/225/350/265/204/347/256/241/347/220/206/347/263/273/347/273/237O3.2_/344/272/244/346/230/223/347/273/204.pdm +0 -22469
- meutils/playwright_utils/__test.sh +0 -2
- meutils/playwright_utils/kimi1_cookies.json +0 -1
- meutils/playwright_utils/kimi2_cookies.json +0 -1
- meutils/playwright_utils/kimi_cookies.json +0 -93
- meutils/serving/README.md +0 -1
- meutils/serving/celery/_run.sh +0 -10
- meutils/serving/gui/run.sh +0 -9
- meutils/serving/jina/__demo/client.py +0 -42
- meutils/serving/jina/__demo/flow.svg +0 -1
- meutils/serving/jina/__demo/s.py +0 -34
- meutils/serving/jina/__demo/s2.py +0 -37
- meutils/serving/jina/__demo/server.py +0 -83
- meutils/serving/jina/__demo/test.py +0 -40
- meutils/serving/jina/executors/SentenceEncoder.py +0 -62
- meutils/serving/jina/executors/SentenceEncoder_.py +0 -63
- meutils/serving/jina/executors/__init__.py +0 -46
- meutils/serving/jina/executors/base.py +0 -40
- meutils/serving/jina/nlp_serving/__init__.py +0 -11
- meutils/serving/jina/nlp_serving/word_segmentation.py +0 -40
- meutils/serving/streamlit/conf.yaml +0 -5
- meutils/serving/streamlit/ocr.png +0 -0
- meutils/serving/streamlit/run.sh +0 -17
- meutils/serving/webui/.streamlit/_config.toml +0 -186
- meutils/serving/webui/.streamlit/config.toml +0 -26
- meutils/serving/webui/pages/_1_/345/210/206/350/257/215.py +0 -56
- meutils/serving/webui/pages/_2_/350/257/215/346/200/247/346/240/207/346/263/250/344/270/216/345/256/236/344/275/223/350/257/206/345/210/253.py +0 -54
- meutils/serving/webui/pages/_3_/346/226/207/346/234/254/345/214/271/351/205/215.py +0 -64
- meutils/serving/webui/run.sh +0 -9
- meutils/spark/__init__.py +0 -26
- meutils/tools/monitor.yml +0 -29
- {MeUtils-2024.3.4.13.4.45.dist-info → MeUtils-2025.1.16.17.15.52.dist-info}/LICENSE +0 -0
- {MeUtils-2024.3.4.13.4.45.dist-info → MeUtils-2025.1.16.17.15.52.dist-info}/top_level.txt +0 -0
- {meutils → examples}/comp_utils/__init__.py +0 -0
- {meutils → examples}/comp_utils/reverse_metric.py +0 -0
- /meutils/{fileparser/README.md → fastapi_utils/exceptions/__init__.py} +0 -0
- /meutils/{fileparser → parsers/fileparser}/PDF/346/212/275/345/217/226.py" +0 -0
- /meutils/{fileparser → parsers/fileparser}/__init__.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/common.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/__init__.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/__main__.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/filetype.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/helpers.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/match.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/types/__init__.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/types/application.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/types/archive.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/types/audio.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/types/base.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/types/document.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/types/font.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/types/image.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/types/isobmff.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/types/video.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/filetype/utils.py +0 -0
- /meutils/{fileparser → parsers/fileparser}/pdf.py +0 -0
- /meutils/{fileparser → parsers/fileparser}//350/241/250/346/240/274/346/212/275/345/217/226.py" +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
{"cookies": [{"name": "HMACCOUNT_BFESS", "value": "5FEF946BBD8BB410", "domain": ".hm.baidu.com", "path": "/", "expires": 1737016374.107596, "httpOnly": false, "secure": true, "sameSite": "None"}, {"name": "Hm_lvt_358cae4815e85d48f7e8ab7f3680a74b", "value": "1702456374", "domain": ".kimi.moonshot.cn", "path": "/", "expires": 1735729737, "httpOnly": false, "secure": false, "sameSite": "Lax"}, {"name": "_ga", "value": "GA1.1.1240485054.1702456374", "domain": ".moonshot.cn", "path": "/", "expires": 1738753737.624431, "httpOnly": false, "secure": false, "sameSite": "Lax"}, {"name": "_ga_YXD8W70SZP", "value": "GS1.1.1704192493.14.1.1704193737.0.0.0", "domain": ".moonshot.cn", "path": "/", "expires": 1738753737.628481, "httpOnly": false, "secure": false, "sameSite": "Lax"}, {"name": "Hm_lpvt_358cae4815e85d48f7e8ab7f3680a74b", "value": "1704193738", "domain": ".kimi.moonshot.cn", "path": "/", "expires": -1, "httpOnly": false, "secure": false, "sameSite": "Lax"}], "origins": [{"origin": "https://kimi.moonshot.cn", "localStorage": [{"name": "refresh_token", "value": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlY2hvbWluZC1hcGktYXBpIiwiZXhwIjoxNzA2Nzg1NjQxLCJpYXQiOjE3MDQxOTM2NDEsImp0aSI6ImNtOXVzcTgzcjA3ZDIxOGx1aDYwIiwidHlwIjoicmVmcmVzaCIsInNwYWNlX2lkIjoiY2tpMDk0YjNhZXNsZ2xqNmZvMmciLCJzdWIiOiJja2kwOTRiM2Flc2xnbGo2Zm8zMCIsIngiOiIyZTYyN2Y0ZDQ2MzRiZmFmYWUyOTYxMThlNjgyNTQ3NCJ9.AKXM2ATSoGIxifd6C3OD7cEJE_kcGZkjDAVUL3f3Nd_PXOZN2XcfZkrAejV7AgSTO0SI_k6pyZIq8Jx5nzl_Dg"}, {"name": "CUSTOM_THEME", "value": "\"dark\""}, {"name": "__tea_cache_refer_20001731", "value": "{\"refer_key\":\"\",\"refer_title\":\"Kimi Chat - \u5e2e\u4f60\u770b\u66f4\u5927\u7684\u4e16\u754c\",\"refer_manual_key\":\"\",\"routeChange\":false}"}, {"name": "__tea_cache_first_20001731", "value": "1"}, {"name": "access_token", "value": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlY2hvbWluZC1hcGktYXBpIiwiZXhwIjoxNzA0MTk0NTQxLCJpYXQiOjE3MDQxOTM2NDEsImp0aSI6ImNtOXVzcTgzcjA3ZDIxOGx1aDVnIiwidHlwIjoiYWNjZXNzIiwic3BhY2VfaWQiOiJja2kwOTRiM2Flc2xnbGo2Zm8yZyIsInN1YiI6ImNraTA5NGIzYWVzbGdsajZmbzMwIn0.VQ9pD2nmEzlMufLcHq8T4AQw2EM8YAjlOLU_p1irLEDPHDgARvLYIJfxjyGyiu_xP6BSyG6dW7lhdPfaqDs-dQ"}, {"name": "__tea_cache_tokens_20001731", "value": "{\"web_id\":\"7311994396176975375\",\"user_unique_id\":\"cki094b3aeslglj6fo30\",\"timestamp\":1704193737611,\"_type_\":\"default\"}"}, {"name": "Hm_lvt_358cae4815e85d48f7e8ab7f3680a74b", "value": "1735729737798|1702456374"}]}]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"cookies": [{"name": "HMACCOUNT_BFESS", "value": "5FEF946BBD8BB410", "domain": ".hm.baidu.com", "path": "/", "expires": 1737016374.107596, "httpOnly": false, "secure": true, "sameSite": "None"}, {"name": "Hm_lvt_358cae4815e85d48f7e8ab7f3680a74b", "value": "1702456374", "domain": ".kimi.moonshot.cn", "path": "/", "expires": 1735729737, "httpOnly": false, "secure": false, "sameSite": "Lax"}, {"name": "_ga", "value": "GA1.1.1240485054.1702456374", "domain": ".moonshot.cn", "path": "/", "expires": 1738753737.473199, "httpOnly": false, "secure": false, "sameSite": "Lax"}, {"name": "_ga_YXD8W70SZP", "value": "GS1.1.1704192492.14.1.1704193737.0.0.0", "domain": ".moonshot.cn", "path": "/", "expires": 1738753737.48832, "httpOnly": false, "secure": false, "sameSite": "Lax"}, {"name": "Hm_lpvt_358cae4815e85d48f7e8ab7f3680a74b", "value": "1704193738", "domain": ".kimi.moonshot.cn", "path": "/", "expires": -1, "httpOnly": false, "secure": false, "sameSite": "Lax"}], "origins": [{"origin": "https://kimi.moonshot.cn", "localStorage": [{"name": "refresh_token", "value": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlY2hvbWluZC1hcGktYXBpIiwiZXhwIjoxNzA2Nzg1NjQxLCJpYXQiOjE3MDQxOTM2NDEsImp0aSI6ImNtOXVzcWVjcDdmY2NuOWY5NjVnIiwidHlwIjoicmVmcmVzaCIsInNwYWNlX2lkIjoiY2tpMDk0YjNhZXNsZ2xqNmZvMmciLCJzdWIiOiJja2kwOTRiM2Flc2xnbGo2Zm8zMCIsIngiOiIyZTYyN2Y0ZDQ2MzRiZmFmYWUyOTYxMThlNjgyNTQ3NCJ9.rNL8_7YKo4z4ZAyJjWZymLOcqePG0E4X_kW6IaGdomwdgZBbzqsVZ229JSebja2dK5x-AeuVa-UbML5mIZy6AQ"}, {"name": "CUSTOM_THEME", "value": "\"dark\""}, {"name": "__tea_cache_refer_20001731", "value": "{\"refer_key\":\"\",\"refer_title\":\"Kimi Chat - \u5e2e\u4f60\u770b\u66f4\u5927\u7684\u4e16\u754c\",\"refer_manual_key\":\"\",\"routeChange\":false}"}, {"name": "__tea_cache_first_20001731", "value": "1"}, {"name": "access_token", "value": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlY2hvbWluZC1hcGktYXBpIiwiZXhwIjoxNzA0MTk0NTQxLCJpYXQiOjE3MDQxOTM2NDEsImp0aSI6ImNtOXVzcWVjcDdmY2NuOWY5NjUwIiwidHlwIjoiYWNjZXNzIiwic3BhY2VfaWQiOiJja2kwOTRiM2Flc2xnbGo2Zm8yZyIsInN1YiI6ImNraTA5NGIzYWVzbGdsajZmbzMwIn0.fK_3u5hBnTx38GugbQ657NbHW1V0KfJXyu3Iad9nCEXvwOQlWGIvWNEJJx-5n07Jhqy0UwO0cPp_dXjeebAn5w"}, {"name": "__tea_cache_tokens_20001731", "value": "{\"web_id\":\"7311994396176975375\",\"user_unique_id\":\"cki094b3aeslglj6fo30\",\"timestamp\":1704193737476,\"_type_\":\"default\"}"}, {"name": "Hm_lvt_358cae4815e85d48f7e8ab7f3680a74b", "value": "1735729737511|1702456374"}]}]}
|
@@ -1,93 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cookies": [
|
3
|
-
{
|
4
|
-
"name": "HMACCOUNT_BFESS",
|
5
|
-
"value": "5FEF946BBD8BB410",
|
6
|
-
"domain": ".hm.baidu.com",
|
7
|
-
"path": "/",
|
8
|
-
"expires": 1737016374.107596,
|
9
|
-
"httpOnly": false,
|
10
|
-
"secure": true,
|
11
|
-
"sameSite": "None"
|
12
|
-
},
|
13
|
-
{
|
14
|
-
"name": "Hm_lvt_358cae4815e85d48f7e8ab7f3680a74b",
|
15
|
-
"value": "1702456374",
|
16
|
-
"domain": ".kimi.moonshot.cn",
|
17
|
-
"path": "/",
|
18
|
-
"expires": 1735962397,
|
19
|
-
"httpOnly": false,
|
20
|
-
"secure": false,
|
21
|
-
"sameSite": "Lax"
|
22
|
-
},
|
23
|
-
{
|
24
|
-
"name": "_ga",
|
25
|
-
"value": "GA1.1.1240485054.1702456374",
|
26
|
-
"domain": ".moonshot.cn",
|
27
|
-
"path": "/",
|
28
|
-
"expires": 1738986397.630528,
|
29
|
-
"httpOnly": false,
|
30
|
-
"secure": false,
|
31
|
-
"sameSite": "Lax"
|
32
|
-
},
|
33
|
-
{
|
34
|
-
"name": "_ga_YXD8W70SZP",
|
35
|
-
"value": "GS1.1.1704426016.15.1.1704426397.0.0.0",
|
36
|
-
"domain": ".moonshot.cn",
|
37
|
-
"path": "/",
|
38
|
-
"expires": 1738986397.636582,
|
39
|
-
"httpOnly": false,
|
40
|
-
"secure": false,
|
41
|
-
"sameSite": "Lax"
|
42
|
-
},
|
43
|
-
{
|
44
|
-
"name": "Hm_lpvt_358cae4815e85d48f7e8ab7f3680a74b",
|
45
|
-
"value": "1704426398",
|
46
|
-
"domain": ".kimi.moonshot.cn",
|
47
|
-
"path": "/",
|
48
|
-
"expires": -1,
|
49
|
-
"httpOnly": false,
|
50
|
-
"secure": false,
|
51
|
-
"sameSite": "Lax"
|
52
|
-
}
|
53
|
-
],
|
54
|
-
"origins": [
|
55
|
-
{
|
56
|
-
"origin": "https://kimi.moonshot.cn",
|
57
|
-
"localStorage": [
|
58
|
-
{
|
59
|
-
"name": "refresh_token",
|
60
|
-
"value": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlY2hvbWluZC1hcGktYXBpIiwiZXhwIjoxNzA3MDE4MDE3LCJpYXQiOjE3MDQ0MjYwMTcsImp0aSI6ImNtYm5rODgzcWZmZmFkOWtzbDYwIiwidHlwIjoicmVmcmVzaCIsInNwYWNlX2lkIjoiY2tpMDk0YjNhZXNsZ2xqNmZvMmciLCJzdWIiOiJja2kwOTRiM2Flc2xnbGo2Zm8zMCIsIngiOiIyZTYyN2Y0ZDQ2MzRiZmFmYWUyOTYxMThlNjgyNTQ3NCJ9.kABDlIcRTLJUDgLZCW-54Z7xgxYFcsu41plozikVM9Rrm0JKivA4d6xPvp_HNICOck1caUEfOav0C21oNjimnQ"
|
61
|
-
},
|
62
|
-
{
|
63
|
-
"name": "__tea_cache_refer_20001731",
|
64
|
-
"value": "{\"refer_key\":\"\",\"refer_title\":\"Kimi Chat - \u5e2e\u4f60\u770b\u66f4\u5927\u7684\u4e16\u754c\",\"refer_manual_key\":\"\",\"routeChange\":false}"
|
65
|
-
},
|
66
|
-
{
|
67
|
-
"name": "CUSTOM_THEME",
|
68
|
-
"value": "\"dark\""
|
69
|
-
},
|
70
|
-
{
|
71
|
-
"name": "__tea_cache_first_20001731",
|
72
|
-
"value": "1"
|
73
|
-
},
|
74
|
-
{
|
75
|
-
"name": "APMPLUS566559",
|
76
|
-
"value": "JTdCJTIydXNlcklkJTIyOiUyMmNraTA5NGIzYWVzbGdsajZmbzMwJTIyLCUyMmRldmljZUlkJTIyOiUyMjM0NTAxMWQyLWZiNWItNGNhZS05NTlhLTJmNzZkMTY5N2QzMCUyMiwlMjJyJTIyOjAuNzc2MjI2MTYwODc3ODM1NiwlMjJleHBpcmVzJTIyOjE3MTIyMDIzOTc3NzglN0Q="
|
77
|
-
},
|
78
|
-
{
|
79
|
-
"name": "access_token",
|
80
|
-
"value": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlY2hvbWluZC1hcGktYXBpIiwiZXhwIjoxNzA0NDI2OTE3LCJpYXQiOjE3MDQ0MjYwMTcsImp0aSI6ImNtYm5rODgzcWZmZmFkOWtzbDVnIiwidHlwIjoiYWNjZXNzIiwic3BhY2VfaWQiOiJja2kwOTRiM2Flc2xnbGo2Zm8yZyIsInN1YiI6ImNraTA5NGIzYWVzbGdsajZmbzMwIn0.YhChjPaY8eXHzJSb5S_VeuTbTY6EeBARULUIp3duN7fg_iYGlT4SfRM4ClL9uWNyCfdS7hKmfRmRMeia2mUMRg"
|
81
|
-
},
|
82
|
-
{
|
83
|
-
"name": "__tea_cache_tokens_20001731",
|
84
|
-
"value": "{\"web_id\":\"7311994396176975375\",\"user_unique_id\":\"cki094b3aeslglj6fo30\",\"timestamp\":1704426397618,\"_type_\":\"default\"}"
|
85
|
-
},
|
86
|
-
{
|
87
|
-
"name": "Hm_lvt_358cae4815e85d48f7e8ab7f3680a74b",
|
88
|
-
"value": "1735962397784|1702456374"
|
89
|
-
}
|
90
|
-
]
|
91
|
-
}
|
92
|
-
]
|
93
|
-
}
|
meutils/serving/README.md
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Docarray 重写 appzoo
|
meutils/serving/celery/_run.sh
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
# @Project : AI @by PyCharm
|
3
|
-
# @Time : 2023/8/4 11:21
|
4
|
-
# @Author : betterme
|
5
|
-
# @Email : 313303303@qq.com
|
6
|
-
# @Software : PyCharm
|
7
|
-
# @Description :
|
8
|
-
|
9
|
-
celery -A meutils.serving.celery.tasks worker -l info
|
10
|
-
#celery -A tasks worker -l info
|
meutils/serving/gui/run.sh
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
# @Project : AppZoo.
|
4
|
-
# @File : client
|
5
|
-
# @Time : 2022/9/9 下午5:02
|
6
|
-
# @Author : yuanjie
|
7
|
-
# @WeChat : meutils
|
8
|
-
# @Software : PyCharm
|
9
|
-
# @Description :
|
10
|
-
|
11
|
-
|
12
|
-
from jina import Client, Document, DocumentArray
|
13
|
-
|
14
|
-
# c = Client(host='grpc://0.0.0.0:8504')
|
15
|
-
#
|
16
|
-
#
|
17
|
-
# print(c.post('/', DocumentArray.empty(1)).texts)
|
18
|
-
# print(c.post('/e1', DocumentArray.empty(2)).texts)
|
19
|
-
# print(c.post('/e2', DocumentArray.empty(3)).texts)
|
20
|
-
#
|
21
|
-
|
22
|
-
|
23
|
-
# r = c.post(
|
24
|
-
# '/',
|
25
|
-
# inputs=DocumentArray([
|
26
|
-
# Document(text='如何更换花呗绑定银行卡'),
|
27
|
-
# Document(text='花呗更改绑定银行卡')
|
28
|
-
# ])
|
29
|
-
# )
|
30
|
-
# print(r.embeddings)
|
31
|
-
|
32
|
-
#
|
33
|
-
# {
|
34
|
-
# "data": [
|
35
|
-
# {
|
36
|
-
# "text": "我在南京"
|
37
|
-
# }
|
38
|
-
# ]
|
39
|
-
# }
|
40
|
-
|
41
|
-
|
42
|
-
r = Client(host='grpc://0.0.0.0:8501').post('/encode', [Document(text='我是中国人')] * 5)
|
@@ -1 +0,0 @@
|
|
1
|
-
<svg id="mermaid-svg" width="100%" xmlns="http://www.w3.org/2000/svg" style="max-width: 603.125px;" viewBox="-8 -8 603.125 274" role="graphics-document document" aria-roledescription="flowchart-v2" xmlns:xlink="http://www.w3.org/1999/xlink"><style>#mermaid-svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg .error-icon{fill:hsl(180, 0%, 100%);}#mermaid-svg .error-text{fill:rgb(0, 0, 0);stroke:rgb(0, 0, 0);}#mermaid-svg .edge-thickness-normal{stroke-width:2px;}#mermaid-svg .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg .marker{fill:#a6d8da;stroke:#a6d8da;}#mermaid-svg .marker.cross{stroke:#a6d8da;}#mermaid-svg svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg .cluster-label text{fill:rgb(0, 0, 0);}#mermaid-svg .cluster-label span,#mermaid-svg p{color:rgb(0, 0, 0);}#mermaid-svg .label text,#mermaid-svg span,#mermaid-svg p{fill:#333;color:#333;}#mermaid-svg .node rect,#mermaid-svg .node circle,#mermaid-svg .node ellipse,#mermaid-svg .node polygon,#mermaid-svg .node path{fill:#32C8CD;stroke:#fff;stroke-width:1px;}#mermaid-svg .flowchart-label text{text-anchor:middle;}#mermaid-svg .node .label{text-align:center;}#mermaid-svg .node.clickable{cursor:pointer;}#mermaid-svg .arrowheadPath{fill:#0b0b0b;}#mermaid-svg .edgePath .path{stroke:#a6d8da;stroke-width:2.0px;}#mermaid-svg .flowchart-link{stroke:#a6d8da;fill:none;}#mermaid-svg .edgeLabel{background-color:hsl(-120, 0%, 100%);text-align:center;}#mermaid-svg .edgeLabel rect{opacity:0.5;background-color:hsl(-120, 0%, 100%);fill:hsl(-120, 0%, 100%);}#mermaid-svg .labelBkg{background-color:rgba(255, 255, 255, 0.5);}#mermaid-svg .cluster rect{fill:#EEEDE78C;stroke:none;stroke-width:1px;}#mermaid-svg .cluster text{fill:rgb(0, 0, 0);}#mermaid-svg .cluster span,#mermaid-svg p{color:rgb(0, 0, 0);}#mermaid-svg div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(180, 0%, 100%);border:1px solid none;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg .INSPECT>*{stroke:#F29C9F!important;}#mermaid-svg .INSPECT span{stroke:#F29C9F!important;}#mermaid-svg .JOIN_INSPECT>*{stroke:#F29C9F!important;}#mermaid-svg .JOIN_INSPECT span{stroke:#F29C9F!important;}#mermaid-svg .GATEWAY>*{fill:none!important;color:#000!important;stroke:none!important;}#mermaid-svg .GATEWAY span{fill:none!important;color:#000!important;stroke:none!important;}#mermaid-svg .GATEWAY tspan{fill:#000!important;}#mermaid-svg .INSPECT_AUX_PASS>*{stroke-dasharray:2 2!important;}#mermaid-svg .INSPECT_AUX_PASS span{stroke-dasharray:2 2!important;}#mermaid-svg .HEADTAIL>*{fill:#32C8CD1D!important;}#mermaid-svg .HEADTAIL span{fill:#32C8CD1D!important;}#mermaid-svg .EXTERNAL>*{fill:#fff!important;stroke:#32C8CD!important;}#mermaid-svg .EXTERNAL span{fill:#fff!important;stroke:#32C8CD!important;}</style><g><marker id="flowchart-pointEnd" class="marker flowchart" viewBox="0 0 10 10" refX="10" refY="5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker><marker id="flowchart-pointStart" class="marker flowchart" viewBox="0 0 10 10" refX="0" refY="5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"><path d="M 0 5 L 10 10 L 10 0 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker><marker id="flowchart-circleEnd" class="marker flowchart" viewBox="0 0 10 10" refX="11" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></circle></marker><marker id="flowchart-circleStart" class="marker flowchart" viewBox="0 0 10 10" refX="-1" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></circle></marker><marker id="flowchart-crossEnd" class="marker cross flowchart" viewBox="0 0 11 11" refX="12" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"></path></marker><marker id="flowchart-crossStart" class="marker cross flowchart" viewBox="0 0 11 11" refX="-1" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"><path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"></path></marker><g class="root"><g class="clusters"></g><g class="edgePaths"><path d="M74.71875,129L78.88541666666667,129C83.05208333333333,129,91.38541666666667,129,99.71875,129C108.05208333333333,129,116.38541666666667,129,120.55208333333333,129L124.71875,129" id="L-gatewaystart-E-0" class=" edge-thickness-normal edge-pattern-solid flowchart-link LS-gatewaystart LE-E" style="fill:none;" marker-end="url(#flowchart-pointEnd)"></path><path d="M198.296875,174.84561891515995L202.46354166666666,180.0380157626333C206.63020833333334,185.23041261010664,214.96354166666666,195.61520630505333,223.296875,200.80760315252667C231.63020833333334,206,239.96354166666666,206,244.13020833333334,206L248.296875,206" id="L-E-EE-0" class=" edge-thickness-normal edge-pattern-solid flowchart-link LS-E LE-EE" style="fill:none;" marker-end="url(#flowchart-pointEnd)"></path><path d="M198.296875,83.15438108484005L202.46354166666666,77.9619842373667C206.63020833333334,72.76958738989337,214.96354166666666,62.38479369494669,223.31119791666666,57.19239684747334C231.65885416666666,52,240.02083333333334,52,244.20182291666666,52L248.3828125,52" id="L-E-executor2-0" class=" edge-thickness-normal edge-pattern-solid flowchart-link LS-E LE-executor2" style="fill:none;" marker-end="url(#flowchart-pointEnd)"></path><path d="M330.4375,206L334.6041666666667,206C338.7708333333333,206,347.1041666666667,206,355.4375,206C363.7708333333333,206,372.1041666666667,206,376.2708333333333,206L380.4375,206" id="L-EE-executor3-0" class=" edge-thickness-normal edge-pattern-solid flowchart-link LS-EE LE-executor3" style="fill:none;" marker-end="url(#flowchart-pointEnd)"></path><path d="M462.40625,206L466.5729166666667,206C470.7395833333333,206,479.0729166666667,206,487.40625,206C495.7395833333333,206,504.0729166666667,206,508.2395833333333,206L512.40625,206" id="L-executor3-gatewayend-0" class=" edge-thickness-normal edge-pattern-solid flowchart-link LS-executor3 LE-gatewayend" style="fill:none;" marker-end="url(#flowchart-pointEnd)"></path></g><g class="edgeLabels"><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g><g class="edgeLabel"><g class="label" transform="translate(0, 0)"><foreignObject width="0" height="0"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel"></span></div></foreignObject></g></g></g><g class="nodes"><g class="root" transform="translate(372.9375, 146)"><g class="clusters"><g class="cluster DEPLOYMENT DEPLOYMENT DEPLOYMENT DEPLOYMENT flowchart-label" id="executor3"><rect style="" rx="0" ry="0" x="8" y="8" width="81.96875" height="104"></rect><g class="cluster-label" transform="translate(13.1484375, 8)"><foreignObject width="71.671875" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">executor3</span></div></foreignObject></g></g></g><g class="edgePaths"></g><g class="edgeLabels"></g><g class="nodes"><g class="node default pod flowchart-label" id="flowchart-executor3/rep-0-31" transform="translate(48.984375, 60)"><rect class="basic label-container" style="" rx="0" ry="0" x="-15.984375" y="-17" width="31.96875" height="34"></rect><g class="label" style="" transform="translate(-8.484375, -9.5)"><rect></rect><foreignObject width="16.96875" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">E2</span></div></foreignObject></g></g></g></g><g class="root" transform="translate(240.8828125, -8)"><g class="clusters"><g class="cluster DEPLOYMENT DEPLOYMENT flowchart-label" id="executor2"><rect style="" rx="0" ry="0" x="8" y="8" width="81.96875" height="104"></rect><g class="cluster-label" transform="translate(13.1484375, 8)"><foreignObject width="71.671875" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">executor2</span></div></foreignObject></g></g></g><g class="edgePaths"></g><g class="edgeLabels"></g><g class="nodes"><g class="node default pod flowchart-label" id="flowchart-executor2/rep-0-30" transform="translate(48.984375, 60)"><rect class="basic label-container" style="" rx="0" ry="0" x="-15.984375" y="-17" width="31.96875" height="34"></rect><g class="label" style="" transform="translate(-8.484375, -9.5)"><rect></rect><foreignObject width="16.96875" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">E1</span></div></foreignObject></g></g></g></g><g class="root" transform="translate(240.796875, 146)"><g class="clusters"><g class="cluster DEPLOYMENT DEPLOYMENT DEPLOYMENT DEPLOYMENT flowchart-label" id="EE"><rect style="" rx="0" ry="0" x="8" y="8" width="82.140625" height="104"></rect><g class="cluster-label" transform="translate(40.5, 8)"><foreignObject width="17.140625" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">EE</span></div></foreignObject></g></g></g><g class="edgePaths"></g><g class="edgeLabels"></g><g class="nodes"><g class="node default pod flowchart-label" id="flowchart-EE/rep-0-29" transform="translate(49.0703125, 60)"><rect class="basic label-container" style="" rx="0" ry="0" x="-16.0703125" y="-17" width="32.140625" height="34"></rect><g class="label" style="" transform="translate(-8.5703125, -9.5)"><rect></rect><foreignObject width="17.140625" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">EE</span></div></foreignObject></g></g></g></g><g class="root" transform="translate(117.21875, 69)"><g class="clusters"><g class="cluster DEPLOYMENT DEPLOYMENT DEPLOYMENT DEPLOYMENT DEPLOYMENT DEPLOYMENT flowchart-label" id="E"><rect style="" rx="0" ry="0" x="8" y="8" width="73.578125" height="104"></rect><g class="cluster-label" transform="translate(40.5, 8)"><foreignObject width="8.578125" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">E</span></div></foreignObject></g></g></g><g class="edgePaths"></g><g class="edgeLabels"></g><g class="nodes"><g class="node default pod flowchart-label" id="flowchart-E/rep-0-28" transform="translate(44.7890625, 60)"><rect class="basic label-container" style="" rx="0" ry="0" x="-11.7890625" y="-17" width="23.578125" height="34"></rect><g class="label" style="" transform="translate(-4.2890625, -9.5)"><rect></rect><foreignObject width="8.578125" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">E</span></div></foreignObject></g></g></g></g><g class="node default GATEWAY flowchart-label" id="flowchart-gatewaystart-32" transform="translate(37.359375, 129)"><rect class="basic label-container" style="" rx="0" ry="0" x="-37.359375" y="-17" width="74.71875" height="34"></rect><g class="label" style="" transform="translate(-29.859375, -9.5)"><rect></rect><foreignObject width="59.71875" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">gateway</span></div></foreignObject></g></g><g class="node default GATEWAY flowchart-label" id="flowchart-gatewayend-41" transform="translate(549.765625, 206)"><rect class="basic label-container" style="" rx="0" ry="0" x="-37.359375" y="-17" width="74.71875" height="34"></rect><g class="label" style="" transform="translate(-29.859375, -9.5)"><rect></rect><foreignObject width="59.71875" height="19"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="nodeLabel">gateway</span></div></foreignObject></g></g></g></g></g><style>@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css");</style></svg>
|
meutils/serving/jina/__demo/s.py
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
# @Project : AI. @by PyCharm
|
4
|
-
# @File : s
|
5
|
-
# @Time : 2023/7/24 14:12
|
6
|
-
# @Author : betterme
|
7
|
-
# @WeChat : meutils
|
8
|
-
# @Software : PyCharm
|
9
|
-
# @Description :
|
10
|
-
|
11
|
-
from meutils.pipe import *
|
12
|
-
from jina import Executor, requests, Deployment
|
13
|
-
from docarray import DocList
|
14
|
-
from docarray.documents import TextDoc
|
15
|
-
|
16
|
-
|
17
|
-
class MyExecutor(Executor):
|
18
|
-
@requests
|
19
|
-
def foo(self, docs: DocList[TextDoc], **kwargs) -> DocList[TextDoc]:
|
20
|
-
for d in docs:
|
21
|
-
d.text = 'hello world'
|
22
|
-
return docs
|
23
|
-
|
24
|
-
|
25
|
-
from jina import requests, dynamic_batching, Document, DocumentArray, Executor, Deployment, Flow, Client
|
26
|
-
|
27
|
-
dep = Deployment(port=9966, uses=MyExecutor)
|
28
|
-
with dep:
|
29
|
-
response_docs = dep.post(
|
30
|
-
on='/',
|
31
|
-
inputs=DocList[TextDoc]([TextDoc(text='hello')]),
|
32
|
-
return_type=DocList[TextDoc]
|
33
|
-
)
|
34
|
-
print(f'Text: {response_docs[0].text}')
|
@@ -1,37 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
# @Project : AI. @by PyCharm
|
4
|
-
# @File : s2
|
5
|
-
# @Time : 2023/7/24 14:16
|
6
|
-
# @Author : betterme
|
7
|
-
# @WeChat : meutils
|
8
|
-
# @Software : PyCharm
|
9
|
-
# @Description :
|
10
|
-
|
11
|
-
from meutils.pipe import *
|
12
|
-
from meutils.pipe import *
|
13
|
-
from jina import Executor, requests, Deployment
|
14
|
-
from docarray import DocList
|
15
|
-
from docarray.documents import TextDoc
|
16
|
-
|
17
|
-
|
18
|
-
class MyExecutor(Executor):
|
19
|
-
@requests
|
20
|
-
def foo(self, docs: DocList[TextDoc], **kwargs) -> DocList[TextDoc]:
|
21
|
-
for d in docs:
|
22
|
-
d.text = 'hello world'
|
23
|
-
# return docs
|
24
|
-
|
25
|
-
|
26
|
-
from jina import requests, dynamic_batching, Document, DocumentArray, Executor, Deployment, Flow, Client
|
27
|
-
|
28
|
-
f1 = Flow(port=8501).add(uses=MyExecutor)
|
29
|
-
|
30
|
-
with f1:
|
31
|
-
response_docs = f1.post(
|
32
|
-
on='/',
|
33
|
-
inputs=DocList[TextDoc]([TextDoc(text='hello')]),
|
34
|
-
return_type=DocList[TextDoc]
|
35
|
-
)
|
36
|
-
print(f'Text: {response_docs[0].text}')
|
37
|
-
|
@@ -1,83 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
# @Project : AppZoo.
|
4
|
-
# @File : server
|
5
|
-
# @Time : 2022/9/9 下午4:59
|
6
|
-
# @Author : yuanjie
|
7
|
-
# @WeChat : meutils
|
8
|
-
# @Software : PyCharm
|
9
|
-
# @Description :
|
10
|
-
|
11
|
-
from jina import Document, DocumentArray, Executor, Flow, requests, Deployment
|
12
|
-
|
13
|
-
|
14
|
-
class E(Executor):
|
15
|
-
@requests # 默认串起来
|
16
|
-
def func(self, docs: DocumentArray, **kwargs):
|
17
|
-
for d in docs:
|
18
|
-
d.text += 'None'
|
19
|
-
|
20
|
-
|
21
|
-
class EE(Executor):
|
22
|
-
@requests
|
23
|
-
def func(self, docs: DocumentArray, **kwargs):
|
24
|
-
for d in docs:
|
25
|
-
d.text += 'Null'
|
26
|
-
|
27
|
-
|
28
|
-
class E1(Executor):
|
29
|
-
@requests(on='/e1')
|
30
|
-
def func(self, docs: DocumentArray, **kwargs):
|
31
|
-
for d in docs:
|
32
|
-
d.text += '1'
|
33
|
-
|
34
|
-
|
35
|
-
class E2(Executor):
|
36
|
-
@requests(on='/e2')
|
37
|
-
def func(self, docs: DocumentArray, **kwargs):
|
38
|
-
for d in docs:
|
39
|
-
d.text += '2'
|
40
|
-
|
41
|
-
|
42
|
-
f1 = Flow(port=8501).add(uses=E)
|
43
|
-
f2 = Flow(port=8502).add(uses=E1)
|
44
|
-
f12 = Flow(port=8503).add(uses=E).add(uses=E1)
|
45
|
-
f123 = (
|
46
|
-
Flow(port=8504)
|
47
|
-
.add(uses=E, name='E').add(uses=EE, name='EE')
|
48
|
-
.add(uses=E1, needs='E')
|
49
|
-
.add(uses=E2, needs='EE')
|
50
|
-
)
|
51
|
-
# f123 = (
|
52
|
-
# Flow(port=8506)
|
53
|
-
# .add(uses=E, name='E').add(uses=EE, name='EE')
|
54
|
-
# .add(uses=E1, name='E1')
|
55
|
-
# .add(uses=E2, needs=['E1'])
|
56
|
-
# )
|
57
|
-
|
58
|
-
# f = Flow(port=8501, protocol=['GRPC']).add(uses=MyExec).add(uses=Cut)
|
59
|
-
# f = Flow(port=[8500, 8501], protocol=['GRPC', 'HTTP']).add(uses=MyExec) # .add(uses=Cut).add(uses=Read)
|
60
|
-
f123.plot('flow.svg')
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
if __name__ == '__main__':
|
65
|
-
|
66
|
-
with f1, f2, f12, f123:
|
67
|
-
# 测试
|
68
|
-
r = f1.post('/', DocumentArray.empty(1))
|
69
|
-
print(r.texts)
|
70
|
-
r = f2.post('/e1', DocumentArray.empty(2))
|
71
|
-
print(r.texts)
|
72
|
-
# r = f12.post('/e2', DocumentArray.empty(12))
|
73
|
-
# print(r.texts)
|
74
|
-
# r = f123.post('/', DocumentArray.empty(3))
|
75
|
-
# print(r.texts)
|
76
|
-
# r = f123.post('/', [1,2,3])
|
77
|
-
# backend server forever
|
78
|
-
# f123.block()
|
79
|
-
|
80
|
-
# with Deployment(name='myexec1', uses=MyExec) as dep:
|
81
|
-
# dep.post(on='/bar', inputs=Document(), on_done=print)
|
82
|
-
|
83
|
-
|
@@ -1,40 +0,0 @@
|
|
1
|
-
import socket
|
2
|
-
import os
|
3
|
-
import random
|
4
|
-
|
5
|
-
unassigned_ports = []
|
6
|
-
DEFAULT_MIN_PORT = 49153
|
7
|
-
MAX_PORT = 65535
|
8
|
-
|
9
|
-
|
10
|
-
def reset_ports():
|
11
|
-
def _get_unassigned_ports():
|
12
|
-
# if we are running out of ports, lower default minimum port
|
13
|
-
min_port = int(
|
14
|
-
os.environ.get('JINA_RANDOM_PORT_MIN', str(DEFAULT_MIN_PORT))
|
15
|
-
)
|
16
|
-
max_port = int(os.environ.get('JINA_RANDOM_PORT_MAX', str(MAX_PORT)))
|
17
|
-
return set(range(min_port, max_port + 1))
|
18
|
-
|
19
|
-
unassigned_ports.clear()
|
20
|
-
unassigned_ports.extend(_get_unassigned_ports())
|
21
|
-
random.shuffle(unassigned_ports)
|
22
|
-
|
23
|
-
|
24
|
-
def _check_bind(port):
|
25
|
-
with socket.socket() as s:
|
26
|
-
try:
|
27
|
-
s.bind(('', port))
|
28
|
-
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
29
|
-
return port
|
30
|
-
except OSError as exc:
|
31
|
-
print(f'OSError Exception to skip: {exc}. Try next port')
|
32
|
-
return None
|
33
|
-
|
34
|
-
reset_ports()
|
35
|
-
for idx, _port in enumerate(unassigned_ports):
|
36
|
-
if _check_bind(_port) is not None:
|
37
|
-
break
|
38
|
-
raise OSError(
|
39
|
-
f'can not find an available port in {len(unassigned_ports)} unassigned ports, assigned already {len(unassigned_ports)} ports'
|
40
|
-
)
|
@@ -1,62 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
# @Project : AI. @by PyCharm
|
4
|
-
# @File : SentenceEncoder
|
5
|
-
# @Time : 2023/6/7 09:09
|
6
|
-
# @Author : betterme
|
7
|
-
# @WeChat : meutils
|
8
|
-
# @Software : PyCharm
|
9
|
-
# @Description :
|
10
|
-
|
11
|
-
from meutils.pipe import *
|
12
|
-
from jina import requests, dynamic_batching, Document, DocumentArray, Executor, Deployment, Flow, Client
|
13
|
-
from sentence_transformers import SentenceTransformer
|
14
|
-
import torch
|
15
|
-
|
16
|
-
|
17
|
-
class DummyExecutor(Executor):
|
18
|
-
c = Client(host='grpc://0.0.0.0:51234', asyncio=True)
|
19
|
-
|
20
|
-
@requests
|
21
|
-
async def process(self, docs: DocumentArray, **kwargs):
|
22
|
-
self.c.post('/', docs)
|
23
|
-
|
24
|
-
|
25
|
-
class SentenceEncoder(Executor):
|
26
|
-
"""A simple sentence encoder that can be run on a CPU or a GPU
|
27
|
-
|
28
|
-
:param device: The pytorch device that the model is on, e.g. 'cpu', 'cuda', 'cuda:1'
|
29
|
-
"""
|
30
|
-
|
31
|
-
def __init__(self, device: str = 'cpu', *args, **kwargs):
|
32
|
-
super().__init__(*args, **kwargs)
|
33
|
-
self.model = SentenceTransformer('all-MiniLM-L6-v2', device=device)
|
34
|
-
self.model.to(device) # Move the model to device
|
35
|
-
|
36
|
-
@requests
|
37
|
-
@dynamic_batching(preferred_batch_size=10, timeout=1_000) # 默认10s
|
38
|
-
def encode(self, docs: DocumentArray, **kwargs):
|
39
|
-
"""Add text-based embeddings to all documents"""
|
40
|
-
with torch.inference_mode():
|
41
|
-
embeddings = self.model.encode(docs.texts, batch_size=32)
|
42
|
-
docs.embeddings = embeddings
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
def main(inputs=['x']):
|
47
|
-
dep = Deployment(uses=SentenceEncoder, uses_with={'device': 'cpu'})
|
48
|
-
|
49
|
-
with dep:
|
50
|
-
dep.post(on='/encode', inputs=inputs)
|
51
|
-
|
52
|
-
|
53
|
-
if __name__ == '__main__':
|
54
|
-
|
55
|
-
def generate_docs():
|
56
|
-
for _ in range(2):
|
57
|
-
yield Document(
|
58
|
-
text='Using a GPU allows you to significantly speed up encoding.'
|
59
|
-
)
|
60
|
-
|
61
|
-
|
62
|
-
main()
|
@@ -1,63 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
# @Project : AI. @by PyCharm
|
4
|
-
# @File : SentenceEncoder
|
5
|
-
# @Time : 2023/6/7 09:09
|
6
|
-
# @Author : betterme
|
7
|
-
# @WeChat : meutils
|
8
|
-
# @Software : PyCharm
|
9
|
-
# @Description :
|
10
|
-
|
11
|
-
from meutils.pipe import *
|
12
|
-
from jina import requests, dynamic_batching, Document, DocumentArray, Executor, Deployment, Flow, Client
|
13
|
-
from sentence_transformers import SentenceTransformer
|
14
|
-
import torch
|
15
|
-
|
16
|
-
|
17
|
-
class DummyExecutor(Executor):
|
18
|
-
c = Client(host='grpc://0.0.0.0:51234', asyncio=True)
|
19
|
-
|
20
|
-
@requests
|
21
|
-
async def process(self, docs: DocumentArray, **kwargs):
|
22
|
-
self.c.post('/', docs)
|
23
|
-
|
24
|
-
|
25
|
-
class SentenceEncoder(Executor):
|
26
|
-
"""A simple sentence encoder that can be run on a CPU or a GPU
|
27
|
-
|
28
|
-
:param device: The pytorch device that the model is on, e.g. 'cpu', 'cuda', 'cuda:1'
|
29
|
-
"""
|
30
|
-
|
31
|
-
def __init__(self, device: str = 'cpu', *args, **kwargs):
|
32
|
-
super().__init__(*args, **kwargs)
|
33
|
-
self.model = SentenceTransformer('all-MiniLM-L6-v2', device=device)
|
34
|
-
self.model.to(device) # Move the model to device
|
35
|
-
|
36
|
-
@requests
|
37
|
-
@dynamic_batching(preferred_batch_size=10, timeout=1_000) # 默认10s
|
38
|
-
def encode(self, docs: DocumentArray, **kwargs):
|
39
|
-
"""Add text-based embeddings to all documents"""
|
40
|
-
print(docs.texts)
|
41
|
-
with torch.inference_mode():
|
42
|
-
embeddings = self.model.encode(docs.texts, batch_size=32)
|
43
|
-
docs.embeddings = embeddings
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
def main(inputs=['x']):
|
48
|
-
dep = Deployment(uses=SentenceEncoder, uses_with={'device': 'cpu'})
|
49
|
-
|
50
|
-
with dep:
|
51
|
-
dep.post(on='/encode', inputs=inputs)
|
52
|
-
|
53
|
-
|
54
|
-
if __name__ == '__main__':
|
55
|
-
|
56
|
-
def generate_docs():
|
57
|
-
for _ in range(2):
|
58
|
-
yield Document(
|
59
|
-
text='Using a GPU allows you to significantly speed up encoding.'
|
60
|
-
)
|
61
|
-
|
62
|
-
|
63
|
-
main()
|
@@ -1,46 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
# @Project : AI. @by PyCharm
|
4
|
-
# @File : executors
|
5
|
-
# @Time : 2023/6/6 15:53
|
6
|
-
# @Author : betterme
|
7
|
-
# @WeChat : meutils
|
8
|
-
# @Software : PyCharm
|
9
|
-
# @Description :
|
10
|
-
|
11
|
-
from meutils.pipe import *
|
12
|
-
|
13
|
-
from jina import Document, DocumentArray, Executor, Flow, requests, Deployment
|
14
|
-
from sentence_transformers import SentenceTransformer
|
15
|
-
|
16
|
-
model_name_or_path = 'intfloat/multilingual-e5-base'
|
17
|
-
|
18
|
-
model = SentenceTransformer(model_name_or_path)
|
19
|
-
|
20
|
-
encode = lru_cache()(model.encode)
|
21
|
-
class Parameters(BaseModel):
|
22
|
-
model: str
|
23
|
-
batch_size: int
|
24
|
-
|
25
|
-
class E(Executor):
|
26
|
-
@requests(on='/encode')
|
27
|
-
def func(self, docs: DocumentArray, parameters, **kwargs): # 客户端参数
|
28
|
-
embeddings = encode(docs.texts, batch_size=32, normalize_embeddings=True)
|
29
|
-
for doc, embedding in zip(docs, embeddings):
|
30
|
-
doc.embedding = embedding
|
31
|
-
# background_tasks.add_task(encode(doc.text, normalize_embeddings=True))
|
32
|
-
|
33
|
-
|
34
|
-
f1 = Flow(port=8501).add(uses=E)
|
35
|
-
|
36
|
-
with f1:
|
37
|
-
# 测试
|
38
|
-
# r = f1.post('/', DocumentArray([Document(text='我是中国人')] * 5))
|
39
|
-
# print(r[:, 'tags'])
|
40
|
-
# r = f1.post('/', [Document(text='我是中国人')]*5)
|
41
|
-
# print(r.texts)
|
42
|
-
|
43
|
-
# r = f1.post('/encode', DocumentArray([Document(text='我是中国人')] * 5))
|
44
|
-
# print(r.texts)
|
45
|
-
# print(r.embeddings)
|
46
|
-
f1.block()
|
@@ -1,40 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
# @Project : AI. @by PyCharm
|
4
|
-
# @File : base
|
5
|
-
# @Time : 2023/7/24 14:17
|
6
|
-
# @Author : betterme
|
7
|
-
# @WeChat : meutils
|
8
|
-
# @Software : PyCharm
|
9
|
-
# @Description :
|
10
|
-
|
11
|
-
from meutils.pipe import *
|
12
|
-
from jina import Executor, Deployment, Flow, Client
|
13
|
-
from jina import requests, dynamic_batching
|
14
|
-
from docarray import DocList
|
15
|
-
from docarray.documents import TextDoc, ImageDoc
|
16
|
-
|
17
|
-
|
18
|
-
class MyExecutor(Executor):
|
19
|
-
@requests
|
20
|
-
# @dynamic_batching()
|
21
|
-
def foo(self, docs: list, **kwargs):
|
22
|
-
for d in docs:
|
23
|
-
d.text = 'hello world'
|
24
|
-
return docs
|
25
|
-
|
26
|
-
|
27
|
-
if __name__ == '__main__':
|
28
|
-
# f1 = Flow(port=8501).add(uses=MyExecutor)
|
29
|
-
#
|
30
|
-
# with f1:
|
31
|
-
# response_docs = f1.post(
|
32
|
-
# on='/',
|
33
|
-
# inputs=DocList[TextDoc]([TextDoc(text='hello')]),
|
34
|
-
# return_type=DocList[TextDoc]
|
35
|
-
# )
|
36
|
-
# print(f'Text: {response_docs[0].text}')
|
37
|
-
|
38
|
-
e = MyExecutor()
|
39
|
-
# print(e.foo(DocList[TextDoc]([TextDoc(text='hello')]))[0].text)
|
40
|
-
print(e.foo([TextDoc(text='hello')])[0].text)
|