model-compose 0.4.7__tar.gz → 0.4.9__tar.gz
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.
- {model_compose-0.4.7/src/model_compose.egg-info → model_compose-0.4.9}/PKG-INFO +1 -2
- {model_compose-0.4.7 → model_compose-0.4.9}/pyproject.toml +1 -2
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/base.py +14 -38
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/context.py +2 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/__init__.py +2 -0
- model_compose-0.4.9/src/mindor/core/component/services/datasets/__init__.py +1 -0
- model_compose-0.4.9/src/mindor/core/component/services/datasets/datasets.py +129 -0
- model_compose-0.4.9/src/mindor/core/component/services/datasets/providers/__init__.py +2 -0
- model_compose-0.4.9/src/mindor/core/component/services/datasets/providers/common.py +18 -0
- model_compose-0.4.9/src/mindor/core/component/services/datasets/providers/huggingface.py +36 -0
- model_compose-0.4.9/src/mindor/core/component/services/datasets/providers/local.py +32 -0
- model_compose-0.4.9/src/mindor/core/component/services/datasets/utils.py +12 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/http_client.py +5 -5
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/http_server.py +2 -2
- model_compose-0.4.9/src/mindor/core/component/services/image_processor.py +210 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/base/common.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/base/huggingface.py +96 -20
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/__init__.py +1 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/chat_completion/huggingface.py +12 -2
- model_compose-0.4.9/src/mindor/core/component/services/model/tasks/face_embedding/common.py +47 -0
- model_compose-0.4.9/src/mindor/core/component/services/model/tasks/face_embedding/custom.py +12 -0
- model_compose-0.4.9/src/mindor/core/component/services/model/tasks/face_embedding/insightface.py +113 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_generation/common.py +6 -6
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_generation/custom.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_generation/flux.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_generation/hunyuan_image.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_generation/sdxl.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_to_text/huggingface.py +7 -7
- model_compose-0.4.9/src/mindor/core/component/services/model/tasks/image_upscale/__init__.py +1 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_upscale/common.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_upscale/esrgan.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_upscale/ldsr.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_upscale/real_esrgan.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_upscale/swinir.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/text_classification/huggingface.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/text_embedding/huggingface.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/text_generation/huggingface.py +13 -10
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/text_splitter.py +0 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/vector_store/base.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/vector_store/vector_store.py +8 -8
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/base.py +17 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runner/http_client.py +6 -5
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/services/http_server.py +44 -24
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/services/mcp_server.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/webui/gradio.py +6 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/webui/webui.py +1 -1
- {model_compose-0.4.7/src/mindor/core/services → model_compose-0.4.9/src/mindor/core/foundation}/async_service.py +32 -2
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/gateway/base.py +6 -1
- model_compose-0.4.9/src/mindor/core/gateway/services/http_tunnel/base.py +29 -0
- model_compose-0.4.9/src/mindor/core/gateway/services/http_tunnel/drivers/__init__.py +2 -0
- model_compose-0.4.9/src/mindor/core/gateway/services/http_tunnel/drivers/cloudflare.py +14 -0
- model_compose-0.4.9/src/mindor/core/gateway/services/http_tunnel/drivers/ngrok.py +36 -0
- model_compose-0.4.9/src/mindor/core/gateway/services/http_tunnel/http_tunnel.py +41 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/gateway/services/ssh_tunnel.py +0 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/listener/base.py +12 -7
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/listener/services/http_callback.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/logger/base.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/renderers.py +9 -3
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/time.py +6 -3
- model_compose-0.4.9/src/mindor/core/utils/websocket_client.py +56 -0
- model_compose-0.4.7/src/mindor/core/utils/workqueue.py → model_compose-0.4.9/src/mindor/core/utils/work_queue.py +3 -3
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/impl/random_router.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/workflow.py +4 -4
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/loader.py +4 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/action.py +1 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/__init__.py +3 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/datasets/__init__.py +1 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/datasets/common.py +14 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/datasets/datasets.py +48 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/datasets/providers/__init__.py +2 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/datasets/providers/common.py +19 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/datasets/providers/huggingface.py +12 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/datasets/providers/local.py +10 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/http_client.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/http_server.py +2 -2
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/image_processor.py +91 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/__init__.py +2 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/chat_completion.py +14 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/common.py +1 -1
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/__init__.py +1 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/face_embedding.py +8 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/__init__.py +4 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/common.py +12 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/dlib.py +18 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/facenet.py +19 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/insightface.py +19 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model_trainer/__init__.py +1 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model_trainer/impl/__init__.py +3 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model_trainer/impl/classification.py +7 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model_trainer/impl/common.py +85 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model_trainer/impl/sft.py +25 -0
- model_compose-0.4.9/src/mindor/dsl/schema/action/impl/model_trainer/model_trainer.py +8 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/text_splitter.py +0 -1
- {model_compose-0.4.7/src/mindor/dsl/schema/component → model_compose-0.4.9/src/mindor/dsl/schema/action}/impl/vector_store/impl/__init__.py +1 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/vector_store/impl/chroma.py +6 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/vector_store/impl/faiss.py +6 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/vector_store/impl/milvus.py +6 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/vector_store/impl/qdrant.py +6 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/component.py +3 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/__init__.py +3 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/common.py +10 -3
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/datasets/__init__.py +1 -0
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/datasets/datasets.py +18 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/http_client.py +2 -2
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/image_processor.py +17 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/__init__.py +1 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/chat_completion.py +3 -3
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/common.py +140 -0
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/__init__.py +1 -0
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/face_embedding.py +12 -0
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/__init__.py +4 -0
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/common.py +29 -0
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/dlib.py +14 -0
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/facenet.py +14 -0
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/insightface.py +14 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/text_classification.py +4 -3
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/text_embedding.py +3 -3
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/text_generation.py +3 -3
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/model.py +1 -0
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model_trainer/__init__.py +1 -0
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model_trainer/impl/__init__.py +3 -0
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model_trainer/impl/classification.py +17 -0
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model_trainer/impl/common.py +27 -0
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model_trainer/impl/sft.py +17 -0
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/model_trainer/model_trainer.py +11 -0
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/types.py +15 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/vector_store/impl/chroma.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/vector_store/impl/common.py +6 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/vector_store/impl/milvus.py +2 -2
- model_compose-0.4.9/src/mindor/dsl/schema/component/impl/vector_store/impl/qdrant.py +32 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/impl/http_server.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/impl/mcp_server.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/webui/impl/common.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/common.py +1 -1
- model_compose-0.4.9/src/mindor/dsl/schema/gateway/impl/http_tunnel/__init__.py +1 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/listener/impl/http_callback.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/runtime/impl/docker.py +3 -3
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/transport/ssh.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/workflow.py +1 -0
- model_compose-0.4.9/src/mindor/dsl/utils/path.py +23 -0
- {model_compose-0.4.7 → model_compose-0.4.9/src/model_compose.egg-info}/PKG-INFO +1 -2
- {model_compose-0.4.7 → model_compose-0.4.9}/src/model_compose.egg-info/SOURCES.txt +60 -6
- {model_compose-0.4.7 → model_compose-0.4.9}/src/model_compose.egg-info/requires.txt +0 -1
- model_compose-0.4.7/src/mindor/core/gateway/services/http_tunnel.py +0 -82
- model_compose-0.4.7/src/mindor/dsl/schema/component/impl/model/impl/common.py +0 -97
- model_compose-0.4.7/src/mindor/dsl/schema/component/impl/model/impl/types.py +0 -10
- model_compose-0.4.7/src/mindor/dsl/schema/component/impl/types.py +0 -12
- model_compose-0.4.7/src/mindor/dsl/schema/component/impl/vector_store/impl/qdrant.py +0 -41
- model_compose-0.4.7/src/mindor/dsl/schema/component/impl/vector_store/impl/types.py +0 -7
- {model_compose-0.4.7 → model_compose-0.4.9}/LICENSE +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/README.md +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/setup.cfg +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/cli/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/cli/compose.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/component.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/mcp_client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/mcp_server.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/base/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/base/huggingface_hub.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/base/unsloth.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/model.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/chat_completion/__init__.py +0 -0
- {model_compose-0.4.7/src/mindor/core/component/services/model/tasks/image_generation → model_compose-0.4.9/src/mindor/core/component/services/model/tasks/face_embedding}/__init__.py +0 -0
- {model_compose-0.4.7/src/mindor/core/component/services/model/tasks/image_upscale → model_compose-0.4.9/src/mindor/core/component/services/model/tasks/image_generation}/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_to_text/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/image_upscale/custom.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/text_classification/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/text_embedding/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/tasks/text_generation/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/shell.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/vector_store/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/vector_store/drivers/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/vector_store/drivers/chroma.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/vector_store/drivers/milvus.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/workflow.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/compose/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/compose/compose.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/compose/manager.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/controller.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runner/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runner/client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runner/mcp_client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runner/runner.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runtime/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runtime/docker/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runtime/docker/context/Dockerfile +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runtime/docker/docker.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runtime/native/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runtime/native/native.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/runtime/specs.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/services/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/controller/webui/__init__.py +0 -0
- {model_compose-0.4.7/src/mindor/core/services → model_compose-0.4.9/src/mindor/core/foundation}/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/gateway/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/gateway/gateway.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/gateway/services/__init__.py +0 -0
- {model_compose-0.4.7/src/mindor/dsl/schema/gateway/impl → model_compose-0.4.9/src/mindor/core/gateway/services}/http_tunnel/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/listener/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/listener/listener.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/listener/services/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/logger/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/logger/logger.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/logger/logging.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/logger/services/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/logger/services/console.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/logger/services/file.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/runtime/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/runtime/docker/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/runtime/docker/docker.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/runtime/env.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/caching.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/http_client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/http_request.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/http_response.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/http_status.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/image.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/mcp_client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/package.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/resolvers.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/shell.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/ssh_client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/streamer.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/utils/streaming.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/context.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/base.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/impl/action.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/impl/delay.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/impl/filter.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/impl/if_.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/impl/switch.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/job/job.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/workflow/schema.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/mcp_client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/mcp_server.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/image_generation.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/flux.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/hunyuan_image.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/sdxl.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_to_text.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/image_upscale.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/esrgan.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/ldsr.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/real_esrgan.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/swinir.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/text_classification.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/text_embedding.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/impl/text_generation.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/model/model.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/shell.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/vector_store/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/vector_store/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/vector_store/vector_store.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/action/impl/workflow.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/http_server.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/mcp_client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/mcp_server.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/image_generation.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/flux.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/hunyuan_image.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/sdxl.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_to_text.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/image_upscale.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/esrgan.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/ldsr.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/real_esrgan.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/swinir.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/shell.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/text_splitter.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/vector_store/__init__.py +0 -0
- {model_compose-0.4.7/src/mindor/dsl/schema/action → model_compose-0.4.9/src/mindor/dsl/schema/component}/impl/vector_store/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/vector_store/impl/faiss.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/vector_store/vector_store.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/component/impl/workflow.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/compose.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/controller.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/impl/types.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/webui/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/webui/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/webui/impl/dynamic.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/webui/impl/gradio.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/webui/impl/static.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/controller/webui/webui.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/gateway.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/http_tunnel/http_tunnel.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/cloudflare.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/ngrok.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/ssh_tunnel.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/gateway/impl/types.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/action.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/delay.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/filter.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/if_.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/random_router.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/switch.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/impl/types.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/job/job.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/listener/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/listener/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/listener/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/listener/impl/types.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/listener/listener.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/logger/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/logger/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/logger/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/logger/impl/console.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/logger/impl/file.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/logger/impl/types.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/logger/logger.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/runtime/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/runtime/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/runtime/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/runtime/impl/native.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/runtime/impl/types.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/runtime/runtime.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/transport/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/schema/transport/http.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/utils/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/utils/annotation.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/dsl/utils/enum.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/model_compose.egg-info/dependency_links.txt +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/model_compose.egg-info/entry_points.txt +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/src/model_compose.egg-info/top_level.txt +0 -0
- {model_compose-0.4.7 → model_compose-0.4.9}/tests/test_cli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: model-compose
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.9
|
|
4
4
|
Summary: model-compose: Declarative AI Model and Workflow Orchestrator
|
|
5
5
|
Author-email: Hanyeol Cho <hanyeol.cho@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -16,7 +16,6 @@ Requires-Dist: requests
|
|
|
16
16
|
Requires-Dist: fastapi
|
|
17
17
|
Requires-Dist: uvicorn
|
|
18
18
|
Requires-Dist: mcp>=1.10.1
|
|
19
|
-
Requires-Dist: pyngrok
|
|
20
19
|
Requires-Dist: ulid
|
|
21
20
|
Requires-Dist: gradio
|
|
22
21
|
Requires-Dist: Pillow
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "model-compose"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.9"
|
|
4
4
|
description = "model-compose: Declarative AI Model and Workflow Orchestrator"
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Hanyeol Cho", email = "hanyeol.cho@gmail.com" }
|
|
@@ -17,7 +17,6 @@ dependencies = [
|
|
|
17
17
|
"fastapi",
|
|
18
18
|
"uvicorn",
|
|
19
19
|
"mcp>=1.10.1",
|
|
20
|
-
"pyngrok",
|
|
21
20
|
"ulid",
|
|
22
21
|
"gradio",
|
|
23
22
|
"Pillow",
|
|
@@ -5,9 +5,8 @@ from mindor.dsl.schema.action import ActionConfig
|
|
|
5
5
|
from mindor.dsl.schema.listener import ListenerConfig
|
|
6
6
|
from mindor.dsl.schema.gateway import GatewayConfig
|
|
7
7
|
from mindor.dsl.schema.workflow import WorkflowConfig
|
|
8
|
-
from mindor.core.
|
|
9
|
-
from mindor.core.utils.
|
|
10
|
-
from mindor.core.utils.package import install_package, parse_requirement, is_requirement_satisfied
|
|
8
|
+
from mindor.core.foundation import AsyncService
|
|
9
|
+
from mindor.core.utils.work_queue import WorkQueue
|
|
11
10
|
from mindor.core.logger import logging
|
|
12
11
|
from .context import ComponentActionContext
|
|
13
12
|
|
|
@@ -50,20 +49,10 @@ class ComponentService(AsyncService):
|
|
|
50
49
|
self.id: str = id
|
|
51
50
|
self.config: ComponentConfig = config
|
|
52
51
|
self.global_configs: ComponentGlobalConfigs = global_configs
|
|
53
|
-
self.
|
|
52
|
+
self.work_queue: Optional[WorkQueue] = None
|
|
54
53
|
|
|
55
54
|
if self.config.max_concurrent_count > 0:
|
|
56
|
-
self.
|
|
57
|
-
|
|
58
|
-
async def setup(self) -> None:
|
|
59
|
-
dependencies = self._get_setup_requirements()
|
|
60
|
-
if dependencies:
|
|
61
|
-
await self._install_packages(dependencies)
|
|
62
|
-
|
|
63
|
-
await self._setup()
|
|
64
|
-
|
|
65
|
-
async def teardown(self) -> None:
|
|
66
|
-
await self._teardown()
|
|
55
|
+
self.work_queue = WorkQueue(self.config.max_concurrent_count, self._run)
|
|
67
56
|
|
|
68
57
|
async def start(self, background: bool = False) -> None:
|
|
69
58
|
await super().start(background)
|
|
@@ -73,29 +62,20 @@ class ComponentService(AsyncService):
|
|
|
73
62
|
_, action = ActionResolver(self.config.actions).resolve(action_id)
|
|
74
63
|
context = ComponentActionContext(run_id, input)
|
|
75
64
|
|
|
76
|
-
if self.
|
|
77
|
-
return await (await self.
|
|
65
|
+
if self.work_queue:
|
|
66
|
+
return await (await self.work_queue.schedule(action, context))
|
|
78
67
|
|
|
79
68
|
return await self._run(action, context)
|
|
80
69
|
|
|
81
|
-
async def _setup(self) -> None:
|
|
82
|
-
pass
|
|
83
|
-
|
|
84
|
-
async def _teardown(self) -> None:
|
|
85
|
-
pass
|
|
86
|
-
|
|
87
|
-
def _get_setup_requirements(self) -> Optional[List[str]]:
|
|
88
|
-
return None
|
|
89
|
-
|
|
90
70
|
async def _start(self) -> None:
|
|
91
|
-
if self.
|
|
92
|
-
await self.
|
|
71
|
+
if self.work_queue:
|
|
72
|
+
await self.work_queue.start()
|
|
93
73
|
|
|
94
74
|
await super()._start()
|
|
95
75
|
|
|
96
76
|
async def _stop(self) -> None:
|
|
97
|
-
if self.
|
|
98
|
-
await self.
|
|
77
|
+
if self.work_queue:
|
|
78
|
+
await self.work_queue.stop()
|
|
99
79
|
|
|
100
80
|
await super()._stop()
|
|
101
81
|
|
|
@@ -111,14 +91,10 @@ class ComponentService(AsyncService):
|
|
|
111
91
|
@abstractmethod
|
|
112
92
|
async def _run(self, action: ActionConfig, context: ComponentActionContext) -> Any:
|
|
113
93
|
pass
|
|
114
|
-
|
|
115
|
-
async def
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
requirement = parse_requirement(package_spec)
|
|
119
|
-
if not requirement or not is_requirement_satisfied(requirement):
|
|
120
|
-
logging.info(f"Installing missing module: {package_spec}")
|
|
121
|
-
await install_package(repository or package_spec)
|
|
94
|
+
|
|
95
|
+
async def _install_package(self, package_spec: str, repository: Optional[str]) -> None:
|
|
96
|
+
logging.info(f"Installing required module: {package_spec}")
|
|
97
|
+
await super()._install_package(package_spec, repository)
|
|
122
98
|
|
|
123
99
|
def register_component(type: ComponentType):
|
|
124
100
|
def decorator(cls: Type[ComponentService]) -> Type[ComponentService]:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
2
|
from mindor.core.utils.renderers import VariableRenderer, ImageValueRenderer
|
|
3
3
|
from mindor.core.gateway import find_gateway_by_port
|
|
4
|
+
from PIL import Image as PILImage
|
|
4
5
|
|
|
5
6
|
class ComponentActionContext:
|
|
6
7
|
def __init__(self, run_id: str, input: Dict[str, Any]):
|
|
@@ -16,7 +17,7 @@ class ComponentActionContext:
|
|
|
16
17
|
async def render_variable(self, value: Any, ignore_files: bool = False) -> Any:
|
|
17
18
|
return await self.renderer.render(value, ignore_files)
|
|
18
19
|
|
|
19
|
-
async def render_image(self, value: Any) ->
|
|
20
|
+
async def render_image(self, value: Any) -> Optional[PILImage.Image]:
|
|
20
21
|
return await ImageValueRenderer().render(await self.render_variable(value))
|
|
21
22
|
|
|
22
23
|
def contains_variable_reference(self, key: str, value: Any) -> bool:
|
|
@@ -3,7 +3,9 @@ from .http_client import *
|
|
|
3
3
|
from .mcp_server import *
|
|
4
4
|
from .mcp_client import *
|
|
5
5
|
from .model import *
|
|
6
|
+
from .datasets import *
|
|
6
7
|
from .vector_store import *
|
|
7
8
|
from .workflow import *
|
|
8
9
|
from .shell import *
|
|
9
10
|
from .text_splitter import *
|
|
11
|
+
from .image_processor import *
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .datasets import *
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import TYPE_CHECKING
|
|
3
|
+
|
|
4
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, AsyncIterator, Any
|
|
5
|
+
from mindor.dsl.schema.action import DatasetsActionConfig, DatasetsActionMethod, DatasetsProvider
|
|
6
|
+
from ...base import ComponentService, ComponentType, ComponentGlobalConfigs, register_component
|
|
7
|
+
from ...context import ComponentActionContext
|
|
8
|
+
from .providers import HuggingfaceDatasetsProvider, LocalDatasetsProvider
|
|
9
|
+
from .utils import format_template_example
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from datasets import Dataset
|
|
13
|
+
|
|
14
|
+
class DatasetsAction:
|
|
15
|
+
def __init__(self, config: DatasetsActionConfig):
|
|
16
|
+
self.config: DatasetsActionConfig = config
|
|
17
|
+
|
|
18
|
+
async def run(self, context: ComponentActionContext) -> Any:
|
|
19
|
+
result = await self._dispatch(context)
|
|
20
|
+
context.register_source("result", result)
|
|
21
|
+
|
|
22
|
+
return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
|
|
23
|
+
|
|
24
|
+
async def _dispatch(self, context: ComponentActionContext) -> Dataset:
|
|
25
|
+
if self.config.method == DatasetsActionMethod.LOAD:
|
|
26
|
+
return await self._load(context)
|
|
27
|
+
|
|
28
|
+
if self.config.method == DatasetsActionMethod.CONCAT:
|
|
29
|
+
return await self._concat(context)
|
|
30
|
+
|
|
31
|
+
if self.config.method == DatasetsActionMethod.SELECT:
|
|
32
|
+
return await self._select(context)
|
|
33
|
+
|
|
34
|
+
if self.config.method == DatasetsActionMethod.MAP:
|
|
35
|
+
return await self._map(context)
|
|
36
|
+
|
|
37
|
+
raise ValueError(f"Unsupported datasets action method: {self.config.method}")
|
|
38
|
+
|
|
39
|
+
async def _load(self, context: ComponentActionContext) -> Dataset:
|
|
40
|
+
fraction = await context.render_variable(self.config.fraction)
|
|
41
|
+
shuffle = await context.render_variable(self.config.shuffle)
|
|
42
|
+
|
|
43
|
+
dataset = await self._load_dataset(context)
|
|
44
|
+
|
|
45
|
+
if shuffle:
|
|
46
|
+
dataset = dataset.shuffle()
|
|
47
|
+
|
|
48
|
+
if isinstance(fraction, float) and fraction < 1.0:
|
|
49
|
+
sample_size = max(int(len(dataset) * fraction), 1)
|
|
50
|
+
dataset = dataset.select(range(sample_size))
|
|
51
|
+
|
|
52
|
+
return dataset
|
|
53
|
+
|
|
54
|
+
async def _load_dataset(self, context: ComponentActionContext) -> Dataset:
|
|
55
|
+
if self.config.provider == DatasetsProvider.HUGGINGFACE:
|
|
56
|
+
return await HuggingfaceDatasetsProvider(self.config).load(context)
|
|
57
|
+
|
|
58
|
+
if self.config.provider == DatasetsProvider.LOCAL:
|
|
59
|
+
return await LocalDatasetsProvider(self.config).load(context)
|
|
60
|
+
|
|
61
|
+
raise ValueError(f"Unsupported dataset provider: {self.config.provider}")
|
|
62
|
+
|
|
63
|
+
async def _concat(self, context: ComponentActionContext) -> Dataset:
|
|
64
|
+
from datasets import concatenate_datasets
|
|
65
|
+
|
|
66
|
+
datasets = await context.render_variable(self.config.datasets)
|
|
67
|
+
direction = await context.render_variable(self.config.direction)
|
|
68
|
+
info = await context.render_variable(self.config.info)
|
|
69
|
+
split = await context.render_variable(self.config.split)
|
|
70
|
+
|
|
71
|
+
for dataset in datasets:
|
|
72
|
+
if not isinstance(dataset, Dataset):
|
|
73
|
+
raise ValueError(f"Expected Dataset instance, but got {type(dataset).__name__}")
|
|
74
|
+
|
|
75
|
+
return concatenate_datasets(
|
|
76
|
+
datasets,
|
|
77
|
+
info=info,
|
|
78
|
+
split=split,
|
|
79
|
+
axis=0 if direction == "vertical" else 1
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
async def _select(self, context: ComponentActionContext) -> Dataset:
|
|
83
|
+
dataset = await context.render_variable(self.config.dataset)
|
|
84
|
+
axis = await context.render_variable(self.config.axis)
|
|
85
|
+
indices = await context.render_variable(self.config.indices)
|
|
86
|
+
columns = await context.render_variable(self.config.columns)
|
|
87
|
+
|
|
88
|
+
if not isinstance(dataset, Dataset):
|
|
89
|
+
raise ValueError(f"Expected Dataset instance, but got {type(dataset).__name__}")
|
|
90
|
+
|
|
91
|
+
if axis == "rows":
|
|
92
|
+
if indices is None:
|
|
93
|
+
raise ValueError("indices must be provided when axis='rows'")
|
|
94
|
+
return dataset.select([ int(index) for index in indices ])
|
|
95
|
+
|
|
96
|
+
if axis == "columns":
|
|
97
|
+
if columns is None:
|
|
98
|
+
raise ValueError("columns must be provided when axis='columns'")
|
|
99
|
+
return dataset.select_columns(columns)
|
|
100
|
+
|
|
101
|
+
raise ValueError(f"Unsupported axis: {axis}")
|
|
102
|
+
|
|
103
|
+
async def _map(self, context: ComponentActionContext) -> Dataset:
|
|
104
|
+
dataset = await context.render_variable(self.config.dataset)
|
|
105
|
+
template = await context.render_variable(self.config.template)
|
|
106
|
+
output_column = await context.render_variable(self.config.output_column)
|
|
107
|
+
remove_columns = await context.render_variable(self.config.remove_columns)
|
|
108
|
+
|
|
109
|
+
if not isinstance(dataset, Dataset):
|
|
110
|
+
raise ValueError(f"Expected Dataset instance, but got {type(dataset).__name__}")
|
|
111
|
+
|
|
112
|
+
def format_example(example):
|
|
113
|
+
return { output_column: format_template_example(template, example) }
|
|
114
|
+
|
|
115
|
+
return dataset.map(format_example, remove_columns=remove_columns)
|
|
116
|
+
|
|
117
|
+
@register_component(ComponentType.DATASETS)
|
|
118
|
+
class DatasetsComponent(ComponentService):
|
|
119
|
+
def __init__(self, id: str, config: DatasetsActionConfig, global_configs: ComponentGlobalConfigs, daemon: bool):
|
|
120
|
+
super().__init__(id, config, global_configs, daemon)
|
|
121
|
+
|
|
122
|
+
def _get_setup_requirements(self) -> Optional[List[str]]:
|
|
123
|
+
return [ "datasets" ]
|
|
124
|
+
|
|
125
|
+
async def _run(self, action: DatasetsActionConfig, context: ComponentActionContext) -> Any:
|
|
126
|
+
async def _run():
|
|
127
|
+
return await DatasetsAction(action).run(context)
|
|
128
|
+
|
|
129
|
+
return await self.run_in_thread(_run)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import TYPE_CHECKING
|
|
3
|
+
|
|
4
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, AsyncIterator, Any
|
|
5
|
+
from abc import ABC, abstractmethod
|
|
6
|
+
from mindor.dsl.schema.action import DatasetsLoadActionConfig
|
|
7
|
+
from ....context import ComponentActionContext
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from datasets import Dataset
|
|
11
|
+
|
|
12
|
+
class CommonDatasetsProvider(ABC):
|
|
13
|
+
def __init__(self, config: DatasetsLoadActionConfig):
|
|
14
|
+
self.config: DatasetsLoadActionConfig = config
|
|
15
|
+
|
|
16
|
+
@abstractmethod
|
|
17
|
+
async def load(self, context: ComponentActionContext) -> Dataset:
|
|
18
|
+
pass
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import TYPE_CHECKING
|
|
3
|
+
|
|
4
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, AsyncIterator, Any
|
|
5
|
+
from .common import CommonDatasetsProvider, ComponentActionContext
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from datasets import Dataset
|
|
9
|
+
|
|
10
|
+
class HuggingfaceDatasetsProvider(CommonDatasetsProvider):
|
|
11
|
+
async def load(self, context: ComponentActionContext) -> Dataset:
|
|
12
|
+
from datasets import load_dataset
|
|
13
|
+
|
|
14
|
+
path = await context.render_variable(self.config.path)
|
|
15
|
+
name = await context.render_variable(self.config.name)
|
|
16
|
+
revision = await context.render_variable(self.config.revision)
|
|
17
|
+
token = await context.render_variable(self.config.token)
|
|
18
|
+
split = await context.render_variable(self.config.split)
|
|
19
|
+
streaming = await context.render_variable(self.config.streaming)
|
|
20
|
+
keep_in_memory = await context.render_variable(self.config.keep_in_memory)
|
|
21
|
+
cache_dir = await context.render_variable(self.config.cache_dir)
|
|
22
|
+
save_infos = await context.render_variable(self.config.save_infos)
|
|
23
|
+
trust_remote_code = await context.render_variable(self.config.trust_remote_code)
|
|
24
|
+
|
|
25
|
+
return load_dataset(
|
|
26
|
+
path=path,
|
|
27
|
+
name=name,
|
|
28
|
+
revision=revision,
|
|
29
|
+
token=token,
|
|
30
|
+
split=split,
|
|
31
|
+
streaming=streaming,
|
|
32
|
+
keep_in_memory=keep_in_memory,
|
|
33
|
+
cache_dir=cache_dir,
|
|
34
|
+
save_infos=save_infos,
|
|
35
|
+
trust_remote_code=trust_remote_code
|
|
36
|
+
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import TYPE_CHECKING
|
|
3
|
+
|
|
4
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, AsyncIterator, Any
|
|
5
|
+
from .common import CommonDatasetsProvider, ComponentActionContext
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from datasets import Dataset
|
|
9
|
+
|
|
10
|
+
class LocalDatasetsProvider(CommonDatasetsProvider):
|
|
11
|
+
async def load(self, context: ComponentActionContext) -> Dataset:
|
|
12
|
+
from datasets import load_dataset
|
|
13
|
+
|
|
14
|
+
loader = await context.render_variable(self.config.loader)
|
|
15
|
+
data_files = await context.render_variable(self.config.data_files)
|
|
16
|
+
data_dir = await context.render_variable(self.config.data_dir)
|
|
17
|
+
split = await context.render_variable(self.config.split)
|
|
18
|
+
streaming = await context.render_variable(self.config.streaming)
|
|
19
|
+
keep_in_memory = await context.render_variable(self.config.keep_in_memory)
|
|
20
|
+
cache_dir = await context.render_variable(self.config.cache_dir)
|
|
21
|
+
save_infos = await context.render_variable(self.config.save_infos)
|
|
22
|
+
|
|
23
|
+
return load_dataset(
|
|
24
|
+
path=loader,
|
|
25
|
+
data_files=data_files,
|
|
26
|
+
data_dir=data_dir,
|
|
27
|
+
split=split,
|
|
28
|
+
streaming=streaming,
|
|
29
|
+
keep_in_memory=keep_in_memory,
|
|
30
|
+
cache_dir=cache_dir,
|
|
31
|
+
save_infos=save_infos
|
|
32
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from typing import Dict, List, Any
|
|
2
|
+
import re
|
|
3
|
+
|
|
4
|
+
def format_template_example(template: str, example: Dict[str, Any]) -> str:
|
|
5
|
+
column_names = set(re.findall(r"\{(\w+)\}", template))
|
|
6
|
+
formatted = template
|
|
7
|
+
|
|
8
|
+
for column in column_names:
|
|
9
|
+
if column in example:
|
|
10
|
+
formatted = formatted.replace(f"{{{column}}}", str(example[column]))
|
|
11
|
+
|
|
12
|
+
return formatted
|
{model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/http_client.py
RENAMED
|
@@ -43,16 +43,16 @@ class HttpClientPollingCompletion(HttpClientCompletion):
|
|
|
43
43
|
if status in (self.config.success_when or []):
|
|
44
44
|
return response
|
|
45
45
|
if status in (self.config.fail_when or []):
|
|
46
|
-
raise RuntimeError(f"Polling failed: status '{status}' matched a failure condition
|
|
46
|
+
raise RuntimeError(f"Polling failed: status '{status}' matched a failure condition")
|
|
47
47
|
else: # use status code
|
|
48
48
|
if is_status_code_matched(status_code, self.config.success_when or []):
|
|
49
49
|
return response
|
|
50
50
|
if is_status_code_matched(status_code, self.config.fail_when or []):
|
|
51
|
-
raise RuntimeError(f"Polling failed: status code '{status_code}' matched a failure condition
|
|
51
|
+
raise RuntimeError(f"Polling failed: status code '{status_code}' matched a failure condition")
|
|
52
52
|
|
|
53
53
|
await asyncio.sleep(interval.total_seconds())
|
|
54
54
|
|
|
55
|
-
raise TimeoutError(f"Polling timed out after {timeout}
|
|
55
|
+
raise TimeoutError(f"Polling timed out after {timeout}")
|
|
56
56
|
|
|
57
57
|
async def _resolve_url_or_path(self, context: ComponentActionContext) -> str:
|
|
58
58
|
if self.config.path:
|
|
@@ -128,13 +128,13 @@ class HttpClientAction:
|
|
|
128
128
|
return await context.render_variable(self.config.endpoint)
|
|
129
129
|
|
|
130
130
|
def _convert_stream_chunk(self, chunk: bytes) -> Any:
|
|
131
|
-
if self.config.
|
|
131
|
+
if self.config.streaming_format == HttpStreamFormat.JSON:
|
|
132
132
|
try:
|
|
133
133
|
return json.loads(chunk)
|
|
134
134
|
except:
|
|
135
135
|
return None
|
|
136
136
|
|
|
137
|
-
if self.config.
|
|
137
|
+
if self.config.streaming_format == HttpStreamFormat.TEXT:
|
|
138
138
|
return chunk.decode("utf-8", errors="replace")
|
|
139
139
|
|
|
140
140
|
return chunk
|
{model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/http_server.py
RENAMED
|
@@ -117,13 +117,13 @@ class HttpServerAction:
|
|
|
117
117
|
return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else (result or response)
|
|
118
118
|
|
|
119
119
|
def _convert_stream_chunk(self, chunk: bytes) -> Any:
|
|
120
|
-
if self.config.
|
|
120
|
+
if self.config.streaming_format == HttpStreamFormat.JSON:
|
|
121
121
|
try:
|
|
122
122
|
return json.loads(chunk)
|
|
123
123
|
except:
|
|
124
124
|
return None
|
|
125
125
|
|
|
126
|
-
if self.config.
|
|
126
|
+
if self.config.streaming_format == HttpStreamFormat.TEXT:
|
|
127
127
|
return chunk.decode("utf-8", errors="replace")
|
|
128
128
|
|
|
129
129
|
return chunk
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from mindor.dsl.schema.component import ImageProcessorComponentConfig
|
|
3
|
+
from mindor.dsl.schema.action import ActionConfig, ImageProcessorActionConfig, ImageProcessorActionMethod, ImageScaleMode, FlipDirection
|
|
4
|
+
from ..base import ComponentService, ComponentType, ComponentGlobalConfigs, register_component
|
|
5
|
+
from ..context import ComponentActionContext
|
|
6
|
+
from PIL import Image as PILImage, ImageFilter, ImageEnhance
|
|
7
|
+
|
|
8
|
+
class ImageProcessorAction:
|
|
9
|
+
def __init__(self, config: ImageProcessorActionConfig):
|
|
10
|
+
self.config: ImageProcessorActionConfig = config
|
|
11
|
+
|
|
12
|
+
async def run(self, context: ComponentActionContext) -> Any:
|
|
13
|
+
result = await self._dispatch(context)
|
|
14
|
+
context.register_source("result", result)
|
|
15
|
+
|
|
16
|
+
return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
|
|
17
|
+
|
|
18
|
+
async def _dispatch(self, context: ComponentActionContext) -> Any:
|
|
19
|
+
if self.config.method == ImageProcessorActionMethod.RESIZE:
|
|
20
|
+
return await self._resize(context)
|
|
21
|
+
|
|
22
|
+
if self.config.method == ImageProcessorActionMethod.CROP:
|
|
23
|
+
return await self._crop(context)
|
|
24
|
+
|
|
25
|
+
if self.config.method == ImageProcessorActionMethod.ROTATE:
|
|
26
|
+
return await self._rotate(context)
|
|
27
|
+
|
|
28
|
+
if self.config.method == ImageProcessorActionMethod.FLIP:
|
|
29
|
+
return await self._flip(context)
|
|
30
|
+
|
|
31
|
+
if self.config.method == ImageProcessorActionMethod.GRAYSCALE:
|
|
32
|
+
return await self._grayscale(context)
|
|
33
|
+
|
|
34
|
+
if self.config.method == ImageProcessorActionMethod.BLUR:
|
|
35
|
+
return await self._blur(context)
|
|
36
|
+
|
|
37
|
+
if self.config.method == ImageProcessorActionMethod.SHARPEN:
|
|
38
|
+
return await self._sharpen(context)
|
|
39
|
+
|
|
40
|
+
if self.config.method == ImageProcessorActionMethod.ADJUST_BRIGHTNESS:
|
|
41
|
+
return await self._adjust_brightness(context)
|
|
42
|
+
|
|
43
|
+
if self.config.method == ImageProcessorActionMethod.ADJUST_CONTRAST:
|
|
44
|
+
return await self._adjust_contrast(context)
|
|
45
|
+
|
|
46
|
+
if self.config.method == ImageProcessorActionMethod.ADJUST_SATURATION:
|
|
47
|
+
return await self._adjust_saturation(context)
|
|
48
|
+
|
|
49
|
+
raise ValueError(f"Unsupported image processing action method: {self.config.method}")
|
|
50
|
+
|
|
51
|
+
async def _resize(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
52
|
+
image = await context.render_image(self.config.image)
|
|
53
|
+
width = await context.render_variable(self.config.width) if self.config.width else None
|
|
54
|
+
height = await context.render_variable(self.config.height) if self.config.height else None
|
|
55
|
+
scale_mode = await context.render_variable(self.config.scale_mode)
|
|
56
|
+
|
|
57
|
+
if width is None and height is None:
|
|
58
|
+
raise ValueError("At least one of width or height must be specified for resize")
|
|
59
|
+
|
|
60
|
+
if image:
|
|
61
|
+
return self._resize_image(image, width, height, scale_mode)
|
|
62
|
+
|
|
63
|
+
return None
|
|
64
|
+
|
|
65
|
+
async def _crop(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
66
|
+
image = await context.render_image(self.config.image)
|
|
67
|
+
x = await context.render_variable(self.config.x)
|
|
68
|
+
y = await context.render_variable(self.config.y)
|
|
69
|
+
width = await context.render_variable(self.config.width)
|
|
70
|
+
height = await context.render_variable(self.config.height)
|
|
71
|
+
|
|
72
|
+
if image:
|
|
73
|
+
return image.crop(x, y, x + width, y + height)
|
|
74
|
+
|
|
75
|
+
return None
|
|
76
|
+
|
|
77
|
+
async def _rotate(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
78
|
+
image = await context.render_image(self.config.image)
|
|
79
|
+
angle = await context.render_variable(self.config.angle)
|
|
80
|
+
expand = await context.render_variable(self.config.expand)
|
|
81
|
+
|
|
82
|
+
if image:
|
|
83
|
+
return image.rotate(-angle, expand=expand, resample=PILImage.Resampling.BICUBIC)
|
|
84
|
+
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
async def _flip(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
88
|
+
image = await context.render_image(self.config.image)
|
|
89
|
+
direction = await context.render_variable(self.config.direction)
|
|
90
|
+
|
|
91
|
+
if image:
|
|
92
|
+
if direction == FlipDirection.HORIZONTAL:
|
|
93
|
+
return image.transpose(PILImage.Transpose.FLIP_LEFT_RIGHT)
|
|
94
|
+
|
|
95
|
+
if direction == FlipDirection.VERTICAL:
|
|
96
|
+
return image.transpose(PILImage.Transpose.FLIP_TOP_BOTTOM)
|
|
97
|
+
|
|
98
|
+
return None
|
|
99
|
+
|
|
100
|
+
async def _grayscale(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
101
|
+
image = await context.render_image(self.config.image)
|
|
102
|
+
|
|
103
|
+
if image:
|
|
104
|
+
return image.convert("L")
|
|
105
|
+
|
|
106
|
+
return None
|
|
107
|
+
|
|
108
|
+
async def _blur(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
109
|
+
image = await context.render_image(self.config.image)
|
|
110
|
+
radius = await context.render_variable(self.config.radius)
|
|
111
|
+
|
|
112
|
+
if image:
|
|
113
|
+
return image.filter(ImageFilter.GaussianBlur(radius=radius))
|
|
114
|
+
|
|
115
|
+
async def _sharpen(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
116
|
+
image = await context.render_image(self.config.image)
|
|
117
|
+
factor = await context.render_variable(self.config.factor)
|
|
118
|
+
|
|
119
|
+
if image:
|
|
120
|
+
return ImageEnhance.Sharpness(image).enhance(factor)
|
|
121
|
+
|
|
122
|
+
return FileNotFoundError
|
|
123
|
+
|
|
124
|
+
async def _adjust_brightness(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
125
|
+
image = await context.render_image(self.config.image)
|
|
126
|
+
factor = await context.render_variable(self.config.factor)
|
|
127
|
+
|
|
128
|
+
if image:
|
|
129
|
+
return ImageEnhance.Brightness(image).enhance(factor)
|
|
130
|
+
|
|
131
|
+
return None
|
|
132
|
+
|
|
133
|
+
async def _adjust_contrast(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
134
|
+
image = await context.render_image(self.config.image)
|
|
135
|
+
factor = await context.render_variable(self.config.factor)
|
|
136
|
+
|
|
137
|
+
if image:
|
|
138
|
+
return ImageEnhance.Contrast(image).enhance(factor)
|
|
139
|
+
|
|
140
|
+
return image
|
|
141
|
+
|
|
142
|
+
async def _adjust_saturation(self, context: ComponentActionContext) -> Optional[PILImage.Image]:
|
|
143
|
+
image = await context.render_image(self.config.image)
|
|
144
|
+
factor = await context.render_variable(self.config.factor)
|
|
145
|
+
|
|
146
|
+
if image:
|
|
147
|
+
return ImageEnhance.Color(image).enhance(factor)
|
|
148
|
+
|
|
149
|
+
return None
|
|
150
|
+
|
|
151
|
+
def _resize_image(self, image: PILImage.Image, width: int, height: int, scale_mode: str) -> PILImage.Image:
|
|
152
|
+
original_width, original_height = image.size
|
|
153
|
+
target_width = width or original_width
|
|
154
|
+
target_height = height or original_height
|
|
155
|
+
|
|
156
|
+
if scale_mode == ImageScaleMode.FIT:
|
|
157
|
+
new_width, new_height = self._get_size_aspect_fit(target_width, target_height, original_width, original_height)
|
|
158
|
+
return image.resize((new_width, new_height), PILImage.Resampling.LANCZOS)
|
|
159
|
+
|
|
160
|
+
if scale_mode == ImageScaleMode.FILL:
|
|
161
|
+
new_width, new_height = self._get_size_aspect_fill(target_width, target_height, original_width, original_height)
|
|
162
|
+
image = image.resize((new_width, new_height), PILImage.Resampling.LANCZOS)
|
|
163
|
+
|
|
164
|
+
crop_box = self._get_center_crop_box(new_width, new_height, target_width, target_height)
|
|
165
|
+
return image.crop(crop_box)
|
|
166
|
+
|
|
167
|
+
if scale_mode == ImageScaleMode.STRETCH:
|
|
168
|
+
return image.resize((target_width, target_height), PILImage.Resampling.LANCZOS)
|
|
169
|
+
|
|
170
|
+
raise ValueError(f"Invalid scale_mode: {scale_mode}")
|
|
171
|
+
|
|
172
|
+
def _get_size_aspect_fit(self, target_width: int, target_height: int, original_width: int, original_height: int) -> Tuple[int, int]:
|
|
173
|
+
aspect_ratio = original_width / original_height
|
|
174
|
+
|
|
175
|
+
height = target_height
|
|
176
|
+
width = height * aspect_ratio
|
|
177
|
+
|
|
178
|
+
if width > target_width:
|
|
179
|
+
width = target_width
|
|
180
|
+
height = width / aspect_ratio
|
|
181
|
+
|
|
182
|
+
return (int(width), int(height))
|
|
183
|
+
|
|
184
|
+
def _get_size_aspect_fill(self, target_width: int, target_height: int, original_width: int, original_height: int) -> Tuple[int, int]:
|
|
185
|
+
aspect_ratio = original_width / original_height
|
|
186
|
+
|
|
187
|
+
height = target_height
|
|
188
|
+
width = height * aspect_ratio
|
|
189
|
+
|
|
190
|
+
if width < target_width:
|
|
191
|
+
width = target_width
|
|
192
|
+
height = width / aspect_ratio
|
|
193
|
+
|
|
194
|
+
return (int(width), int(height))
|
|
195
|
+
|
|
196
|
+
def _get_center_crop_box(self, image_width: int, image_height: int, target_width: int, target_height: int) -> Tuple[int, int, int, int]:
|
|
197
|
+
left = (image_width - target_width ) // 2
|
|
198
|
+
top = (image_height - target_height) // 2
|
|
199
|
+
right = left + target_width
|
|
200
|
+
bottom = top + target_height
|
|
201
|
+
|
|
202
|
+
return (left, top, right, bottom)
|
|
203
|
+
|
|
204
|
+
@register_component(ComponentType.IMAGE_PROCESSOR)
|
|
205
|
+
class ImageProcessorComponent(ComponentService):
|
|
206
|
+
def __init__(self, id: str, config: ImageProcessorComponentConfig, global_configs: ComponentGlobalConfigs, daemon: bool):
|
|
207
|
+
super().__init__(id, config, global_configs, daemon)
|
|
208
|
+
|
|
209
|
+
async def _run(self, action: ActionConfig, context: ComponentActionContext) -> Any:
|
|
210
|
+
return await ImageProcessorAction(action).run(context)
|
{model_compose-0.4.7 → model_compose-0.4.9}/src/mindor/core/component/services/model/base/common.py
RENAMED
|
@@ -5,7 +5,7 @@ from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annot
|
|
|
5
5
|
from abc import ABC, abstractmethod
|
|
6
6
|
from mindor.dsl.schema.component import ModelComponentConfig, ModelTaskType, ModelDriver, HuggingfaceModelConfig, LocalModelConfig
|
|
7
7
|
from mindor.dsl.schema.action import ModelActionConfig
|
|
8
|
-
from mindor.core.
|
|
8
|
+
from mindor.core.foundation import AsyncService
|
|
9
9
|
from mindor.core.logger import logging
|
|
10
10
|
from ....context import ComponentActionContext
|
|
11
11
|
import asyncio
|