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,40 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
# @Project : AI. @by PyCharm
|
4
|
-
# @File : word_segmentation
|
5
|
-
# @Time : 2023/4/23 11:22
|
6
|
-
# @Author : betterme
|
7
|
-
# @WeChat : meutils
|
8
|
-
# @Software : PyCharm
|
9
|
-
# @Description :
|
10
|
-
|
11
|
-
from jina import Document, DocumentArray, Executor, Flow, requests, Deployment
|
12
|
-
|
13
|
-
from meutils.ai_nlp.word_segmentation import WordSegmentation
|
14
|
-
|
15
|
-
|
16
|
-
#
|
17
|
-
# class E(Executor):
|
18
|
-
# @requests # 默认串起来
|
19
|
-
# def func(self, docs: DocumentArray, **kwargs):
|
20
|
-
# print(docs.texts)
|
21
|
-
# for d in docs:
|
22
|
-
# d.tags = {'words': WordSegmentation('fast')(d.text)}
|
23
|
-
|
24
|
-
class E(Executor):
|
25
|
-
@requests # 默认串起来
|
26
|
-
def func(self, docs: DocumentArray, **kwargs):
|
27
|
-
print(docs.texts)
|
28
|
-
|
29
|
-
|
30
|
-
f1 = Flow(port=8501).add(uses=E)
|
31
|
-
|
32
|
-
with f1:
|
33
|
-
# 测试
|
34
|
-
# r = f1.post('/', DocumentArray([Document(text='我是中国人')] * 5))
|
35
|
-
# print(r[:, 'tags'])
|
36
|
-
# r = f1.post('/', [Document(text='我是中国人')]*5)
|
37
|
-
# print(r.texts)
|
38
|
-
|
39
|
-
r = f1.post('/', [Document(text='我是中国人')] * 5)
|
40
|
-
print(r.texts)
|
Binary file
|
meutils/serving/streamlit/run.sh
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
# @Project : AI @by PyCharm
|
3
|
-
# @Time : 2023/4/28 15:32
|
4
|
-
# @Author : betterme
|
5
|
-
# @Email : 313303303@qq.com
|
6
|
-
# @Software : PyCharm
|
7
|
-
# @Description :
|
8
|
-
|
9
|
-
|
10
|
-
streamlit run _test.py
|
11
|
-
|
12
|
-
#streamlit run chatbot.py
|
13
|
-
|
14
|
-
#streamlit run demo.py
|
15
|
-
|
16
|
-
|
17
|
-
#streamlit run chat_latex.py
|
@@ -1,186 +0,0 @@
|
|
1
|
-
# Below are all the sections and options you can have in ~/.streamlit/config.toml.
|
2
|
-
|
3
|
-
[global]
|
4
|
-
|
5
|
-
# By default, Streamlit checks if the Python watchdog module is available and, if not, prints a warning asking for you to install it. The watchdog module is not required, but highly recommended. It improves Streamlit's ability to detect changes to files in your filesystem.
|
6
|
-
# If you'd like to turn off this warning, set this to True.
|
7
|
-
# Default: false
|
8
|
-
# disableWatchdogWarning = false
|
9
|
-
|
10
|
-
# If True, will show a warning when you run a Streamlit-enabled script via "python my_script.py".
|
11
|
-
# Default: true
|
12
|
-
# showWarningOnDirectExecution = true
|
13
|
-
|
14
|
-
# DataFrame serialization.
|
15
|
-
# Acceptable values: - 'legacy': Serialize DataFrames using Streamlit's custom format. Slow but battle-tested. - 'arrow': Serialize DataFrames using Apache Arrow. Much faster and versatile.
|
16
|
-
# Default: "arrow"
|
17
|
-
# dataFrameSerialization = "arrow"
|
18
|
-
|
19
|
-
|
20
|
-
[logger]
|
21
|
-
|
22
|
-
# Level of logging: 'error', 'warning', 'info', or 'debug'.
|
23
|
-
# Default: 'info'
|
24
|
-
# level = "info"
|
25
|
-
|
26
|
-
# String format for logging messages. If logger.datetimeFormat is set, logger messages will default to `%(asctime)s.%(msecs)03d %(message)s`. See [Python's documentation](https://docs.python.org/2.6/library/logging.html#formatter-objects) for available attributes.
|
27
|
-
# Default: "%(asctime)s %(message)s"
|
28
|
-
# messageFormat = "%(asctime)s %(message)s"
|
29
|
-
|
30
|
-
|
31
|
-
[client]
|
32
|
-
|
33
|
-
# Whether to enable st.cache.
|
34
|
-
# Default: true
|
35
|
-
# caching = true
|
36
|
-
|
37
|
-
# If false, makes your Streamlit script not draw to a Streamlit app.
|
38
|
-
# Default: true
|
39
|
-
# displayEnabled = true
|
40
|
-
|
41
|
-
# Controls whether uncaught app exceptions are displayed in the browser. By default, this is set to True and Streamlit displays app exceptions and associated tracebacks in the browser.
|
42
|
-
# If set to False, an exception will result in a generic message being shown in the browser, and exceptions and tracebacks will be printed to the console only.
|
43
|
-
# Default: true
|
44
|
-
# showErrorDetails = true
|
45
|
-
|
46
|
-
|
47
|
-
[runner]
|
48
|
-
|
49
|
-
# Allows you to type a variable or string by itself in a single line of Python code to write it to the app.
|
50
|
-
# Default: true
|
51
|
-
# The value below was set in /Users/yuanjie/.streamlit/config.toml
|
52
|
-
magicEnabled = false
|
53
|
-
|
54
|
-
# Install a Python tracer to allow you to stop or pause your script at any point and introspect it. As a side-effect, this slows down your script's execution.
|
55
|
-
# Default: false
|
56
|
-
# installTracer = false
|
57
|
-
|
58
|
-
# Sets the MPLBACKEND environment variable to Agg inside Streamlit to prevent Python crashing.
|
59
|
-
# Default: true
|
60
|
-
# fixMatplotlib = true
|
61
|
-
|
62
|
-
# Run the Python Garbage Collector after each script execution. This can help avoid excess memory use in Streamlit apps, but could introduce delay in rerunning the app script for high-memory-use applications.
|
63
|
-
# Default: true
|
64
|
-
# postScriptGC = true
|
65
|
-
|
66
|
-
# Handle script rerun requests immediately, rather than waiting for script execution to reach a yield point. Enabling this will make Streamlit much more responsive to user interaction, but it can lead to race conditions in apps that mutate session_state data outside of explicit session_state assignment statements.
|
67
|
-
# Default: false
|
68
|
-
# fastReruns = false
|
69
|
-
|
70
|
-
|
71
|
-
[server]
|
72
|
-
|
73
|
-
# List of folders that should not be watched for changes. This impacts both "Run on Save" and @st.cache.
|
74
|
-
# Relative paths will be taken as relative to the current working directory.
|
75
|
-
# Example: ['/home/user1/env', 'relative/path/to/folder']
|
76
|
-
# Default: []
|
77
|
-
# folderWatchBlacklist = []
|
78
|
-
|
79
|
-
# Change the type of file watcher used by Streamlit, or turn it off completely.
|
80
|
-
# Allowed values: * "auto" : Streamlit will attempt to use the watchdog module, and falls back to polling if watchdog is not available. * "watchdog" : Force Streamlit to use the watchdog module. * "poll" : Force Streamlit to always use polling. * "none" : Streamlit will not watch files.
|
81
|
-
# Default: "auto"
|
82
|
-
# fileWatcherType = "auto"
|
83
|
-
|
84
|
-
# Symmetric key used to produce signed cookies. If deploying on multiple replicas, this should be set to the same value across all replicas to ensure they all share the same secret.
|
85
|
-
# Default: randomly generated secret key.
|
86
|
-
# cookieSecret = "fb4103b4f96550d923a2a8178482538b61aa55fd3a76946bdf5dfbb71c518703"
|
87
|
-
|
88
|
-
# If false, will attempt to open a browser window on start.
|
89
|
-
# Default: false unless (1) we are on a Linux box where DISPLAY is unset, or (2) we are running in the Streamlit Atom plugin.
|
90
|
-
# headless = false
|
91
|
-
|
92
|
-
# Automatically rerun script when the file is modified on disk.
|
93
|
-
# Default: false
|
94
|
-
# runOnSave = false
|
95
|
-
|
96
|
-
# The address where the server will listen for client and browser connections. Use this if you want to bind the server to a specific address. If set, the server will only be accessible from this address, and not from any aliases (like localhost).
|
97
|
-
# Default: (unset)
|
98
|
-
# address =
|
99
|
-
|
100
|
-
# The port where the server will listen for browser connections.
|
101
|
-
# Default: 8501
|
102
|
-
# port = 8501
|
103
|
-
|
104
|
-
# The base path for the URL where Streamlit should be served from.
|
105
|
-
# Default: ""
|
106
|
-
# baseUrlPath = ""
|
107
|
-
|
108
|
-
# Enables support for Cross-Origin Request Sharing (CORS) protection, for added security.
|
109
|
-
# Due to conflicts between CORS and XSRF, if `server.enableXsrfProtection` is on and `server.enableCORS` is off at the same time, we will prioritize `server.enableXsrfProtection`.
|
110
|
-
# Default: true
|
111
|
-
# enableCORS = true
|
112
|
-
|
113
|
-
# Enables support for Cross-Site Request Forgery (XSRF) protection, for added security.
|
114
|
-
# Due to conflicts between CORS and XSRF, if `server.enableXsrfProtection` is on and `server.enableCORS` is off at the same time, we will prioritize `server.enableXsrfProtection`.
|
115
|
-
# Default: true
|
116
|
-
# enableXsrfProtection = true
|
117
|
-
|
118
|
-
# Max size, in megabytes, for files uploaded with the file_uploader.
|
119
|
-
# Default: 200
|
120
|
-
# maxUploadSize = 200
|
121
|
-
|
122
|
-
# Max size, in megabytes, of messages that can be sent via the WebSocket connection.
|
123
|
-
# Default: 200
|
124
|
-
# maxMessageSize = 200
|
125
|
-
|
126
|
-
# Enables support for websocket compression.
|
127
|
-
# Default: false
|
128
|
-
# enableWebsocketCompression = false
|
129
|
-
|
130
|
-
|
131
|
-
[browser]
|
132
|
-
|
133
|
-
# Internet address where users should point their browsers in order to connect to the app. Can be IP address or DNS name and path.
|
134
|
-
# This is used to: - Set the correct URL for CORS and XSRF protection purposes. - Show the URL on the terminal - Open the browser
|
135
|
-
# Default: 'localhost'
|
136
|
-
# serverAddress = "localhost"
|
137
|
-
|
138
|
-
# Whether to send usage statistics to Streamlit.
|
139
|
-
# Default: true
|
140
|
-
# gatherUsageStats = true
|
141
|
-
|
142
|
-
# Port where users should point their browsers in order to connect to the app.
|
143
|
-
# This is used to: - Set the correct URL for CORS and XSRF protection purposes. - Show the URL on the terminal - Open the browser
|
144
|
-
# Default: whatever value is set in server.port.
|
145
|
-
# serverPort = 8501
|
146
|
-
|
147
|
-
|
148
|
-
[mapbox]
|
149
|
-
|
150
|
-
# Configure Streamlit to use a custom Mapbox token for elements like st.pydeck_chart and st.map. To get a token for yourself, create an account at https://mapbox.com. It's free (for moderate usage levels)!
|
151
|
-
# Default: ""
|
152
|
-
# token = ""
|
153
|
-
|
154
|
-
|
155
|
-
[deprecation]
|
156
|
-
|
157
|
-
# Set to false to disable the deprecation warning for the file uploader encoding.
|
158
|
-
# Default: true
|
159
|
-
# showfileUploaderEncoding = true
|
160
|
-
|
161
|
-
# Set to false to disable the deprecation warning for using the global pyplot instance.
|
162
|
-
# Default: true
|
163
|
-
# showPyplotGlobalUse = true
|
164
|
-
|
165
|
-
|
166
|
-
[theme]
|
167
|
-
|
168
|
-
# The preset Streamlit theme that your custom theme inherits from. One of "light" or "dark".
|
169
|
-
# base =
|
170
|
-
|
171
|
-
# Primary accent color for interactive elements.
|
172
|
-
# primaryColor =
|
173
|
-
|
174
|
-
# Background color for the main content area.
|
175
|
-
# backgroundColor =
|
176
|
-
|
177
|
-
# Background color used for the sidebar and most interactive widgets.
|
178
|
-
# secondaryBackgroundColor =
|
179
|
-
|
180
|
-
# Color used for almost all text.
|
181
|
-
# textColor =
|
182
|
-
|
183
|
-
# Font family for all text in the app, except code blocks. One of "sans serif", "serif", or "monospace".
|
184
|
-
# font =
|
185
|
-
|
186
|
-
|
@@ -1,26 +0,0 @@
|
|
1
|
-
[theme]
|
2
|
-
font = "monospace" # "sans serif"
|
3
|
-
textColor = "#1F5BAC"
|
4
|
-
primaryColor = "#1F5BAC"
|
5
|
-
backgroundColor = "#FFFFFF"
|
6
|
-
secondaryBackgroundColor = "#F5F7FA"
|
7
|
-
|
8
|
-
[server]
|
9
|
-
#port = 8501
|
10
|
-
headless = true
|
11
|
-
address = "0.0.0.0"
|
12
|
-
#--server.enableXsrfProtection false
|
13
|
-
#--server.enableCORS false
|
14
|
-
#--server.enableWebsocketCompression=false
|
15
|
-
|
16
|
-
[browser]
|
17
|
-
gatherUsageStats = false
|
18
|
-
#--browser.serverAddress 0.0.0.0
|
19
|
-
#--browser.serverPort 8080
|
20
|
-
|
21
|
-
#[global]
|
22
|
-
#developmentMode = false
|
23
|
-
|
24
|
-
#[general] # credentials.toml
|
25
|
-
#email = "313303303@qq.com
|
26
|
-
|
@@ -1,56 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
# @Project : AI. @by PyCharm
|
4
|
-
# @File : 1_分词
|
5
|
-
# @Time : 2023/5/21 17:14
|
6
|
-
# @Author : betterme
|
7
|
-
# @WeChat : meutils
|
8
|
-
# @Software : PyCharm
|
9
|
-
# @Description :
|
10
|
-
|
11
|
-
|
12
|
-
import streamlit as st
|
13
|
-
from annotated_text import annotated_text, annotation
|
14
|
-
from stopwords import filter_stopwords
|
15
|
-
|
16
|
-
from meutils.pipe import *
|
17
|
-
from meutils.ai_nlp.word_segmentation import WordSegmentation
|
18
|
-
from meutils.serving.streamlit import *
|
19
|
-
|
20
|
-
title = Path(__file__).stem.split('_')[-1]
|
21
|
-
st.set_page_config(title, page_icon='🔥', layout='wide', initial_sidebar_state='collapsed')
|
22
|
-
st.title(title)
|
23
|
-
hide_st_style('🔥DevelopedBy@数据科学研发中心-AI团队')
|
24
|
-
|
25
|
-
with st.form(title):
|
26
|
-
text = """
|
27
|
-
东北证券股份有限公司(以下简称“公司”)前身为吉林省证券有限责任公司。2000 年 6 月经中国证监会批准,经过增资扩股成立东北证券有限责任公司。
|
28
|
-
"""
|
29
|
-
cols = st.columns(3)
|
30
|
-
with cols[0]:
|
31
|
-
option = st.selectbox('算法:', ('平衡模式', '快速模式', '精确模式'))
|
32
|
-
with cols[1]:
|
33
|
-
is_filter = st.selectbox('过滤停用词:', ('否', '是')) == '是'
|
34
|
-
mode = {
|
35
|
-
'平衡模式': 'base',
|
36
|
-
'快速模式': 'fast',
|
37
|
-
'精确模式': 'accurate'
|
38
|
-
}.get(option, 'fast')
|
39
|
-
nlp = WordSegmentation(mode)
|
40
|
-
|
41
|
-
text = st.text_area("文本:", text.strip(), height=100)
|
42
|
-
|
43
|
-
if st.form_submit_button('🚀开始计算'):
|
44
|
-
with st.spinner('AI正在计算...'):
|
45
|
-
ws = nlp([text])[0]
|
46
|
-
if is_filter:
|
47
|
-
ws = filter_stopwords(ws)
|
48
|
-
|
49
|
-
annotations = []
|
50
|
-
for i, w in enumerate(ws):
|
51
|
-
if i % 2:
|
52
|
-
annotations.append(annotation(w, label='', color="blue"))
|
53
|
-
else:
|
54
|
-
annotations.append(annotation(w, label='', color="black"))
|
55
|
-
|
56
|
-
annotated_text(*annotations)
|
@@ -1,54 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
# @Project : AI. @by PyCharm
|
4
|
-
# @File : 1_分词
|
5
|
-
# @Time : 2023/5/21 17:14
|
6
|
-
# @Author : betterme
|
7
|
-
# @WeChat : meutils
|
8
|
-
# @Software : PyCharm
|
9
|
-
# @Description :
|
10
|
-
|
11
|
-
|
12
|
-
import streamlit as st
|
13
|
-
from annotated_text import annotated_text, annotation
|
14
|
-
|
15
|
-
from meutils.pipe import *
|
16
|
-
from meutils.pipe import disk_cache
|
17
|
-
|
18
|
-
from meutils.ai_nlp.ner import Ner
|
19
|
-
from meutils.serving.streamlit import *
|
20
|
-
|
21
|
-
title = Path(__file__).stem.split('_')[-1]
|
22
|
-
st.set_page_config(title, page_icon='🔥', layout='wide', initial_sidebar_state='collapsed')
|
23
|
-
st.title(title)
|
24
|
-
|
25
|
-
hide_st_style('🔥DevelopedBy@数据科学研发中心-AI团队')
|
26
|
-
|
27
|
-
with st.form(title):
|
28
|
-
text = """
|
29
|
-
东北证券股份有限公司(以下简称“公司”)前身为吉林省证券有限责任公司。2000年6月中国证监会批准,经过增资扩股成立东北证券有限责任公司。
|
30
|
-
"""
|
31
|
-
container = st.container()
|
32
|
-
cols = st.columns(3)
|
33
|
-
with cols[0]:
|
34
|
-
option = st.selectbox('算法:', ('快速模式', '精确模式'), index=1)
|
35
|
-
with cols[1]:
|
36
|
-
is_filter = st.selectbox('仅保留实体:', ('否', '是')) == '是'
|
37
|
-
|
38
|
-
mode = {
|
39
|
-
'平衡模式': 'base',
|
40
|
-
'精确模式': 'accurate'
|
41
|
-
}.get(option, 'fast')
|
42
|
-
nlp = Ner(mode, entity_only=is_filter)
|
43
|
-
|
44
|
-
text = st.text_area("文本", text.strip(), height=100)
|
45
|
-
|
46
|
-
if st.form_submit_button('🚀开始计算'):
|
47
|
-
with st.spinner('AI正在计算...'):
|
48
|
-
text = nlp([text])[0]
|
49
|
-
|
50
|
-
annotations = []
|
51
|
-
for word, flag in text:
|
52
|
-
annotations.append(annotation(word, label=flag, color="blue"))
|
53
|
-
|
54
|
-
annotated_text(*annotations)
|
@@ -1,64 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
# @Project : AI. @by PyCharm
|
4
|
-
# @File : 1_分词
|
5
|
-
# @Time : 2023/5/21 17:14
|
6
|
-
# @Author : betterme
|
7
|
-
# @WeChat : meutils
|
8
|
-
# @Software : PyCharm
|
9
|
-
# @Description :
|
10
|
-
import os
|
11
|
-
|
12
|
-
import pandas as pd
|
13
|
-
import streamlit
|
14
|
-
from annotated_text import annotated_text, annotation
|
15
|
-
from sentence_transformers import SentenceTransformer
|
16
|
-
|
17
|
-
from meutils.pipe import *
|
18
|
-
from meutils.serving.streamlit import *
|
19
|
-
|
20
|
-
title = Path(__file__).stem.split('_')[-1]
|
21
|
-
st.set_page_config(title, page_icon='🔥', layout='wide', initial_sidebar_state='collapsed')
|
22
|
-
st.title(title)
|
23
|
-
|
24
|
-
hide_st_style('🔥DevelopedBy@数据科学研发中心-AI团队')
|
25
|
-
|
26
|
-
SentenceTransformer = lru_cache(SentenceTransformer)
|
27
|
-
|
28
|
-
|
29
|
-
def nlp(text_pair, model='shibing624/text2vec-base-chinese'):
|
30
|
-
cache_folder = None
|
31
|
-
if Path('/data/MODEL/huggingface').is_dir():
|
32
|
-
cache_folder = '/data/MODEL/huggingface'
|
33
|
-
embeddings = (
|
34
|
-
SentenceTransformer(model, cache_folder=cache_folder)
|
35
|
-
.encode(text_pair, normalize_embeddings=True)
|
36
|
-
)
|
37
|
-
_ = [{'文本1': text_pair[0], '文本2': text_pair[1], '相似度': (embeddings[0] * embeddings[1]).sum()}]
|
38
|
-
return pd.DataFrame(_)
|
39
|
-
|
40
|
-
|
41
|
-
nlp = disk_cache(nlp, 'cachedir_sim')
|
42
|
-
|
43
|
-
with st.form(title):
|
44
|
-
text1 = """
|
45
|
-
《东北证券股份有限公司信息技术管理制度》第六条 公司经理层负责落实信息技术管理目标,对信息技术管理工作承担责任,履行下列职责:
|
46
|
-
(一)组织实施董事会相关决议;
|
47
|
-
(二)建立责任明确、程序清晰的信息技术管理组织架构,明确管理职责、工作程序和协调机制;
|
48
|
-
(三)完善绩效考核和责任追究机制;
|
49
|
-
(四)公司章程规定或董事会授权的其他信息技术管理职责。
|
50
|
-
"""
|
51
|
-
text2 = """
|
52
|
-
第八条 证券基金经营机构经营管理层负责落实信息技术管理目标,对信息技术管理工作承担责任,履行下列职责:
|
53
|
-
"""
|
54
|
-
|
55
|
-
cols = st.columns(3)
|
56
|
-
with cols[0]:
|
57
|
-
option = st.selectbox('算法:', ('shibing624/text2vec-base-chinese', 'GanymedeNil/text2vec-large-chinese'))
|
58
|
-
|
59
|
-
text1 = st.text_area("文本1:", text1.strip(), height=120)
|
60
|
-
text2 = st.text_area("文本2:", text2.strip(), height=120)
|
61
|
-
|
62
|
-
if st.form_submit_button('🚀开始计算'):
|
63
|
-
with st.spinner('AI正在计算...'):
|
64
|
-
st.dataframe(nlp([text1, text2], option))
|
meutils/serving/webui/run.sh
DELETED
meutils/spark/__init__.py
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
# @Project : MeUtils.
|
4
|
-
# @File : __init__.py
|
5
|
-
# @Time : 2021/3/5 11:29 上午
|
6
|
-
# @Author : yuanjie
|
7
|
-
# @WeChat : 313303303
|
8
|
-
# @Software : PyCharm
|
9
|
-
# @Description :
|
10
|
-
|
11
|
-
from meutils.pipe import *
|
12
|
-
|
13
|
-
import pyspark.sql.functions as F
|
14
|
-
|
15
|
-
from pyspark.sql import *
|
16
|
-
from pyspark.sql.types import *
|
17
|
-
|
18
|
-
spark = (
|
19
|
-
SparkSession.builder
|
20
|
-
.appName("Yuanjie")
|
21
|
-
.config('log4j.rootCategory', "WARN")
|
22
|
-
.enableHiveSupport()
|
23
|
-
.getOrCreate()
|
24
|
-
)
|
25
|
-
|
26
|
-
logger.info(f"Spark Version: {spark.version}")
|
meutils/tools/monitor.yml
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
item_list:
|
2
|
-
- name: '测试服务'
|
3
|
-
url: 'http://0.0.0.0:9955/post-func'
|
4
|
-
get_data:
|
5
|
-
- { "msg": 'SUCCESS' } # 成功样例
|
6
|
-
- { "msg": 'FAIL' } # 失败样例
|
7
|
-
keywords: [ "SUCCESS" ]# 判定条件
|
8
|
-
|
9
|
-
# - name: '推荐服务'
|
10
|
-
# url: 'http://127.0.0.1:8000/get'
|
11
|
-
#
|
12
|
-
# get_data:
|
13
|
-
# - { "stus": 'YES' } #成功样例
|
14
|
-
# - { "stus": 'NO' } #失败样例
|
15
|
-
# keywords: [ "YES", "OK" ]
|
16
|
-
#
|
17
|
-
# - name: 'NLP服务'
|
18
|
-
# url: 'http://127.0.0.1:8000/post'
|
19
|
-
# post_data:
|
20
|
-
# - { "stus": 'YES' } #成功样例
|
21
|
-
# - { "stus": 'NO' } #失败样例
|
22
|
-
# keywords: [ "YES","OK" ]#判定条件
|
23
|
-
#
|
24
|
-
# - name: 'xxxxxx'
|
25
|
-
# url: 'http://127.0.0.1:8000/post'
|
26
|
-
# post_data:
|
27
|
-
# - { "stus": 'YES' } #成功样例
|
28
|
-
# - { "stus": 'NO' } #失败样例
|
29
|
-
# keywords: [ "YES","OK" ]#判定条件
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/meutils/{fileparser → parsers/fileparser}//350/241/250/346/240/274/346/212/275/345/217/226.py"
RENAMED
File without changes
|