model-compose 0.4.7__tar.gz → 0.4.8__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.8}/PKG-INFO +1 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/pyproject.toml +1 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/base.py +14 -38
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/__init__.py +1 -0
- model_compose-0.4.8/src/mindor/core/component/services/datasets/__init__.py +1 -0
- model_compose-0.4.8/src/mindor/core/component/services/datasets/datasets.py +104 -0
- model_compose-0.4.8/src/mindor/core/component/services/datasets/providers/__init__.py +2 -0
- model_compose-0.4.8/src/mindor/core/component/services/datasets/providers/common.py +18 -0
- model_compose-0.4.8/src/mindor/core/component/services/datasets/providers/huggingface.py +36 -0
- model_compose-0.4.8/src/mindor/core/component/services/datasets/providers/local.py +32 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/http_client.py +5 -5
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/http_server.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/base/common.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/__init__.py +1 -0
- model_compose-0.4.8/src/mindor/core/component/services/model/tasks/face_embedding/common.py +47 -0
- model_compose-0.4.8/src/mindor/core/component/services/model/tasks/face_embedding/custom.py +12 -0
- model_compose-0.4.8/src/mindor/core/component/services/model/tasks/face_embedding/insightface.py +95 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/image_generation/common.py +6 -6
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/image_generation/custom.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/image_generation/flux.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/image_generation/hunyuan_image.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/image_generation/sdxl.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/image_to_text/huggingface.py +5 -5
- model_compose-0.4.8/src/mindor/core/component/services/model/tasks/image_upscale/__init__.py +1 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/image_upscale/common.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/image_upscale/esrgan.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/image_upscale/ldsr.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/image_upscale/real_esrgan.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/image_upscale/swinir.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/text_classification/huggingface.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/text_embedding/huggingface.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/text_generation/huggingface.py +6 -6
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/text_splitter.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/vector_store/base.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/vector_store/vector_store.py +8 -8
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/base.py +17 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/runner/http_client.py +6 -5
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/services/http_server.py +44 -24
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/services/mcp_server.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/webui/gradio.py +6 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/webui/webui.py +1 -1
- {model_compose-0.4.7/src/mindor/core/services → model_compose-0.4.8/src/mindor/core/foundation}/async_service.py +32 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/gateway/base.py +6 -1
- model_compose-0.4.8/src/mindor/core/gateway/services/http_tunnel/base.py +29 -0
- model_compose-0.4.8/src/mindor/core/gateway/services/http_tunnel/drivers/__init__.py +2 -0
- model_compose-0.4.8/src/mindor/core/gateway/services/http_tunnel/drivers/cloudflare.py +14 -0
- model_compose-0.4.8/src/mindor/core/gateway/services/http_tunnel/drivers/ngrok.py +36 -0
- model_compose-0.4.8/src/mindor/core/gateway/services/http_tunnel/http_tunnel.py +41 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/gateway/services/ssh_tunnel.py +0 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/listener/base.py +12 -7
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/listener/services/http_callback.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/logger/base.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/time.py +6 -3
- model_compose-0.4.8/src/mindor/core/utils/websocket_client.py +56 -0
- model_compose-0.4.7/src/mindor/core/utils/workqueue.py → model_compose-0.4.8/src/mindor/core/utils/work_queue.py +3 -3
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/workflow/job/impl/random_router.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/workflow/workflow.py +4 -4
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/loader.py +4 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/__init__.py +2 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/datasets/__init__.py +1 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/datasets/common.py +13 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/datasets/datasets.py +40 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/datasets/providers/__init__.py +2 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/datasets/providers/common.py +19 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/datasets/providers/huggingface.py +12 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/datasets/providers/local.py +10 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/http_client.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/http_server.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/__init__.py +2 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/common.py +1 -1
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/__init__.py +1 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/face_embedding.py +8 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/__init__.py +4 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/common.py +12 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/dlib.py +18 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/facenet.py +19 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/model/impl/face_embedding/impl/insightface.py +19 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/model_trainer/__init__.py +1 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/model_trainer/impl/__init__.py +3 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/model_trainer/impl/classification.py +7 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/model_trainer/impl/common.py +22 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/model_trainer/impl/sft.py +7 -0
- model_compose-0.4.8/src/mindor/dsl/schema/action/impl/model_trainer/model_trainer.py +8 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/text_splitter.py +1 -1
- {model_compose-0.4.7/src/mindor/dsl/schema/component → model_compose-0.4.8/src/mindor/dsl/schema/action}/impl/vector_store/impl/__init__.py +1 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/vector_store/impl/chroma.py +6 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/vector_store/impl/faiss.py +6 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/vector_store/impl/milvus.py +6 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/vector_store/impl/qdrant.py +6 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/component.py +1 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/__init__.py +2 -0
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/datasets/__init__.py +1 -0
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/datasets/datasets.py +18 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/http_client.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/__init__.py +1 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/chat_completion.py +3 -3
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/common.py +35 -33
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/__init__.py +1 -0
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/face_embedding.py +12 -0
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/__init__.py +4 -0
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/common.py +29 -0
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/dlib.py +14 -0
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/facenet.py +14 -0
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/model/impl/face_embedding/impl/insightface.py +14 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/text_classification.py +4 -3
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/text_embedding.py +3 -3
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/text_generation.py +3 -3
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/model.py +1 -0
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/model_trainer/__init__.py +1 -0
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/model_trainer/impl/__init__.py +3 -0
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/model_trainer/impl/classification.py +17 -0
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/model_trainer/impl/common.py +18 -0
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/model_trainer/impl/sft.py +17 -0
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/model_trainer/model_trainer.py +11 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/types.py +2 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/vector_store/impl/chroma.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/vector_store/impl/common.py +6 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/vector_store/impl/milvus.py +2 -2
- model_compose-0.4.8/src/mindor/dsl/schema/component/impl/vector_store/impl/qdrant.py +32 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/controller/impl/http_server.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/controller/impl/mcp_server.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/controller/webui/impl/common.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/gateway/impl/common.py +1 -1
- model_compose-0.4.8/src/mindor/dsl/schema/gateway/impl/http_tunnel/__init__.py +1 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/listener/impl/http_callback.py +2 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/runtime/impl/docker.py +3 -3
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/transport/ssh.py +1 -1
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/workflow.py +1 -0
- {model_compose-0.4.7 → model_compose-0.4.8/src/model_compose.egg-info}/PKG-INFO +1 -2
- {model_compose-0.4.7 → model_compose-0.4.8}/src/model_compose.egg-info/SOURCES.txt +55 -6
- {model_compose-0.4.7 → model_compose-0.4.8}/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/types.py +0 -10
- 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.8}/LICENSE +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/README.md +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/setup.cfg +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/cli/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/cli/compose.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/component.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/context.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/mcp_client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/mcp_server.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/base/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/base/huggingface.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/base/huggingface_hub.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/base/unsloth.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/model.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/chat_completion/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/chat_completion/huggingface.py +0 -0
- {model_compose-0.4.7/src/mindor/core/component/services/model/tasks/image_generation → model_compose-0.4.8/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.8/src/mindor/core/component/services/model/tasks/image_generation}/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/image_to_text/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/image_upscale/custom.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/text_classification/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/text_embedding/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/model/tasks/text_generation/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/shell.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/vector_store/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/vector_store/drivers/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/vector_store/drivers/chroma.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/vector_store/drivers/milvus.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/component/services/workflow.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/compose/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/compose/compose.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/compose/manager.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/controller.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/runner/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/runner/client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/runner/mcp_client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/runner/runner.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/runtime/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/runtime/docker/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/runtime/docker/context/Dockerfile +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/runtime/docker/docker.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/runtime/native/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/runtime/native/native.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/runtime/specs.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/services/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/controller/webui/__init__.py +0 -0
- {model_compose-0.4.7/src/mindor/core/services → model_compose-0.4.8/src/mindor/core/foundation}/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/gateway/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/gateway/gateway.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/gateway/services/__init__.py +0 -0
- {model_compose-0.4.7/src/mindor/dsl/schema/gateway/impl → model_compose-0.4.8/src/mindor/core/gateway/services}/http_tunnel/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/listener/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/listener/listener.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/listener/services/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/logger/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/logger/logger.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/logger/logging.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/logger/services/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/logger/services/console.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/logger/services/file.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/runtime/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/runtime/docker/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/runtime/docker/docker.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/runtime/env.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/caching.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/http_client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/http_request.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/http_response.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/http_status.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/image.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/mcp_client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/package.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/renderers.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/resolvers.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/shell.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/ssh_client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/streamer.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/utils/streaming.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/workflow/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/workflow/context.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/workflow/job/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/workflow/job/base.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/workflow/job/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/workflow/job/impl/action.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/workflow/job/impl/delay.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/workflow/job/impl/filter.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/workflow/job/impl/if_.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/workflow/job/impl/switch.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/workflow/job/job.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/core/workflow/schema.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/action.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/mcp_client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/mcp_server.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/chat_completion.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/image_generation.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/flux.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/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.8}/src/mindor/dsl/schema/action/impl/model/impl/image_generation/impl/sdxl.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/image_to_text.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/image_upscale.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/esrgan.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/ldsr.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/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.8}/src/mindor/dsl/schema/action/impl/model/impl/image_upscale/impl/swinir.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/text_classification.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/text_embedding.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/impl/text_generation.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/model/model.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/shell.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/vector_store/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/vector_store/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/vector_store/vector_store.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/action/impl/workflow.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/http_server.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/mcp_client.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/mcp_server.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/image_generation.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/flux.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/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.8}/src/mindor/dsl/schema/component/impl/model/impl/image_generation/impl/sdxl.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/image_to_text.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/image_upscale.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/esrgan.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/ldsr.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/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.8}/src/mindor/dsl/schema/component/impl/model/impl/image_upscale/impl/swinir.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/shell.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/text_splitter.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/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.8/src/mindor/dsl/schema/component}/impl/vector_store/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/vector_store/impl/faiss.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/vector_store/vector_store.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/component/impl/workflow.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/compose.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/controller/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/controller/controller.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/controller/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/controller/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/controller/impl/types.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/controller/webui/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/controller/webui/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/controller/webui/impl/dynamic.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/controller/webui/impl/gradio.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/controller/webui/impl/static.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/controller/webui/webui.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/gateway/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/gateway/gateway.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/gateway/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/gateway/impl/http_tunnel/http_tunnel.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/cloudflare.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/gateway/impl/http_tunnel/impl/ngrok.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/gateway/impl/ssh_tunnel.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/gateway/impl/types.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/job/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/job/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/job/impl/action.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/job/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/job/impl/delay.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/job/impl/filter.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/job/impl/if_.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/job/impl/random_router.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/job/impl/switch.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/job/impl/types.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/job/job.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/listener/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/listener/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/listener/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/listener/impl/types.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/listener/listener.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/logger/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/logger/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/logger/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/logger/impl/console.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/logger/impl/file.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/logger/impl/types.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/logger/logger.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/runtime/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/runtime/impl/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/runtime/impl/common.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/runtime/impl/native.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/runtime/impl/types.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/runtime/runtime.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/transport/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/schema/transport/http.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/utils/__init__.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/utils/annotation.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/mindor/dsl/utils/enum.py +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/model_compose.egg-info/dependency_links.txt +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/model_compose.egg-info/entry_points.txt +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/src/model_compose.egg-info/top_level.txt +0 -0
- {model_compose-0.4.7 → model_compose-0.4.8}/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.8
|
|
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.8"
|
|
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]:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .datasets import *
|
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
from datasets import Dataset
|
|
12
|
+
|
|
13
|
+
class DatasetsAction:
|
|
14
|
+
def __init__(self, config: DatasetsActionConfig):
|
|
15
|
+
self.config: DatasetsActionConfig = config
|
|
16
|
+
|
|
17
|
+
async def run(self, context: ComponentActionContext) -> Any:
|
|
18
|
+
result = await self._dispatch(context)
|
|
19
|
+
context.register_source("result", result)
|
|
20
|
+
|
|
21
|
+
return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
|
|
22
|
+
|
|
23
|
+
async def _dispatch(self, context: ComponentActionContext) -> Dataset:
|
|
24
|
+
if self.config.method == DatasetsActionMethod.LOAD:
|
|
25
|
+
return await self._load(context)
|
|
26
|
+
|
|
27
|
+
if self.config.method == DatasetsActionMethod.CONCAT:
|
|
28
|
+
return await self._concat(context)
|
|
29
|
+
|
|
30
|
+
if self.config.method == DatasetsActionMethod.SELECT:
|
|
31
|
+
return await self._select(context)
|
|
32
|
+
|
|
33
|
+
raise ValueError(f"Unsupported datasets action method: {self.config.method}")
|
|
34
|
+
|
|
35
|
+
async def _load(self, context: ComponentActionContext) -> Dataset:
|
|
36
|
+
fraction = await context.render_variable(self.config.fraction)
|
|
37
|
+
shuffle = await context.render_variable(self.config.shuffle)
|
|
38
|
+
|
|
39
|
+
dataset = await self._load_dataset(context)
|
|
40
|
+
|
|
41
|
+
if shuffle:
|
|
42
|
+
dataset = dataset.shuffle()
|
|
43
|
+
|
|
44
|
+
if isinstance(fraction, float) and fraction < 1.0:
|
|
45
|
+
sample_size = max(int(len(dataset) * fraction), 1)
|
|
46
|
+
dataset = dataset.select(range(sample_size))
|
|
47
|
+
|
|
48
|
+
return dataset
|
|
49
|
+
|
|
50
|
+
async def _load_dataset(self, context: ComponentActionContext) -> Dataset:
|
|
51
|
+
if self.config.provider == DatasetsProvider.HUGGINGFACE:
|
|
52
|
+
return await HuggingfaceDatasetsProvider(self.config).load(context)
|
|
53
|
+
|
|
54
|
+
if self.config.provider == DatasetsProvider.LOCAL:
|
|
55
|
+
return await LocalDatasetsProvider(self.config).load(context)
|
|
56
|
+
|
|
57
|
+
raise ValueError(f"Unsupported dataset provider: {self.config.provider}")
|
|
58
|
+
|
|
59
|
+
async def _concat(self, context: ComponentActionContext) -> Dataset:
|
|
60
|
+
from datasets import concatenate_datasets
|
|
61
|
+
|
|
62
|
+
datasets = await context.render_variable(self.config.datasets)
|
|
63
|
+
direction = await context.render_variable(self.config.direction)
|
|
64
|
+
info = await context.render_variable(self.config.info)
|
|
65
|
+
split = await context.render_variable(self.config.split)
|
|
66
|
+
|
|
67
|
+
return concatenate_datasets(
|
|
68
|
+
datasets,
|
|
69
|
+
info=info,
|
|
70
|
+
split=split,
|
|
71
|
+
axis=0 if direction == "vertical" else 1
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
async def _select(self, context: ComponentActionContext) -> Dataset:
|
|
75
|
+
dataset = await context.render_variable(self.config.dataset)
|
|
76
|
+
axis = await context.render_variable(self.config.axis)
|
|
77
|
+
indices = await context.render_variable(self.config.indices)
|
|
78
|
+
columns = await context.render_variable(self.config.columns)
|
|
79
|
+
|
|
80
|
+
if axis == "rows":
|
|
81
|
+
if indices is None:
|
|
82
|
+
raise ValueError("indices must be provided when axis='rows'")
|
|
83
|
+
return dataset.select([ int(index) for index in indices ])
|
|
84
|
+
|
|
85
|
+
if axis == "columns":
|
|
86
|
+
if columns is None:
|
|
87
|
+
raise ValueError("columns must be provided when axis='columns'")
|
|
88
|
+
return dataset.select_columns(columns)
|
|
89
|
+
|
|
90
|
+
raise ValueError(f"Unsupported axis: {axis}")
|
|
91
|
+
|
|
92
|
+
@register_component(ComponentType.DATASETS)
|
|
93
|
+
class DatasetsComponent(ComponentService):
|
|
94
|
+
def __init__(self, id: str, config: DatasetsActionConfig, global_configs: ComponentGlobalConfigs, daemon: bool):
|
|
95
|
+
super().__init__(id, config, global_configs, daemon)
|
|
96
|
+
|
|
97
|
+
def _get_setup_requirements(self) -> Optional[List[str]]:
|
|
98
|
+
return [ "datasets" ]
|
|
99
|
+
|
|
100
|
+
async def _run(self, action: DatasetsActionConfig, context: ComponentActionContext) -> Any:
|
|
101
|
+
async def _run():
|
|
102
|
+
return await DatasetsAction(action).run(context)
|
|
103
|
+
|
|
104
|
+
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
|
+
)
|
{model_compose-0.4.7 → model_compose-0.4.8}/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.8}/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
|
{model_compose-0.4.7 → model_compose-0.4.8}/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
|
|
@@ -0,0 +1,47 @@
|
|
|
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, TypeAlias, Any
|
|
5
|
+
from abc import ABC, abstractmethod
|
|
6
|
+
from mindor.dsl.schema.action import FaceEmbeddingModelActionConfig
|
|
7
|
+
from mindor.core.logger import logging
|
|
8
|
+
from ...base import ModelTaskService, ComponentActionContext
|
|
9
|
+
from PIL import Image as PILImage
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
import torch
|
|
13
|
+
|
|
14
|
+
class FaceEmbeddingTaskAction:
|
|
15
|
+
def __init__(self, config: FaceEmbeddingModelActionConfig, device: Optional[torch.device]):
|
|
16
|
+
self.config: FaceEmbeddingModelActionConfig = config
|
|
17
|
+
self.device: Optional[torch.device] = device
|
|
18
|
+
|
|
19
|
+
async def run(self, context: ComponentActionContext) -> Any:
|
|
20
|
+
image = await self._prepare_input(context)
|
|
21
|
+
is_single_input = not isinstance(image, list)
|
|
22
|
+
images: List[PILImage.Image] = [ image ] if is_single_input else image
|
|
23
|
+
results = []
|
|
24
|
+
|
|
25
|
+
batch_size = await context.render_variable(self.config.batch_size)
|
|
26
|
+
params = await self._resolve_embedding_params(context)
|
|
27
|
+
|
|
28
|
+
for index in range(0, len(images), batch_size):
|
|
29
|
+
batch_images = images[index:index + batch_size]
|
|
30
|
+
embeddings = await self._embed(batch_images, params)
|
|
31
|
+
results.extend(embeddings)
|
|
32
|
+
|
|
33
|
+
return results[0] if is_single_input else results
|
|
34
|
+
|
|
35
|
+
async def _prepare_input(self, context: ComponentActionContext) -> Union[PILImage.Image, List[PILImage.Image]]:
|
|
36
|
+
return await context.render_image(self.config.image)
|
|
37
|
+
|
|
38
|
+
@abstractmethod
|
|
39
|
+
async def _embed(self, images: List[PILImage.Image], params: Dict[str, Any]) -> List[PILImage.Image]:
|
|
40
|
+
pass
|
|
41
|
+
|
|
42
|
+
@abstractmethod
|
|
43
|
+
async def _resolve_embedding_params(self, context: ComponentActionContext) -> Dict[str, Any]:
|
|
44
|
+
pass
|
|
45
|
+
|
|
46
|
+
class FaceEmbeddingTaskService(ModelTaskService):
|
|
47
|
+
pass
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, TypeAlias, Any
|
|
2
|
+
from mindor.dsl.schema.component import ModelComponentConfig, FaceEmbeddingModelFamily
|
|
3
|
+
from ...base import ModelTaskType, ModelDriver, register_model_task_service
|
|
4
|
+
|
|
5
|
+
@register_model_task_service(ModelTaskType.FACE_EMBEDDING, ModelDriver.CUSTOM)
|
|
6
|
+
class CustomFaceEmbeddingTaskService:
|
|
7
|
+
def __new__(cls, id: str, config: ModelComponentConfig, daemon: bool):
|
|
8
|
+
if config.family == FaceEmbeddingModelFamily.INSIGHTFACE:
|
|
9
|
+
from .insightface import InsightfaceFaceEmbeddingTaskService
|
|
10
|
+
return InsightfaceFaceEmbeddingTaskService(id, config, daemon)
|
|
11
|
+
|
|
12
|
+
raise ValueError(f"Unknown family: {config.family}")
|
model_compose-0.4.8/src/mindor/core/component/services/model/tasks/face_embedding/insightface.py
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
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, TypeAlias, Any
|
|
5
|
+
from mindor.dsl.schema.component import ModelComponentConfig, LocalModelConfig
|
|
6
|
+
from mindor.dsl.schema.action import ModelActionConfig, InsightfaceFaceEmbeddingModelActionConfig
|
|
7
|
+
from mindor.core.logger import logging
|
|
8
|
+
from .common import FaceEmbeddingTaskService, FaceEmbeddingTaskAction
|
|
9
|
+
from ...base import ComponentActionContext
|
|
10
|
+
from PIL import Image as PILImage
|
|
11
|
+
import asyncio, os
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from insightface.app import FaceAnalysis
|
|
15
|
+
from torch import Tensor
|
|
16
|
+
|
|
17
|
+
class InsightfaceFaceEmbeddingTaskAction(FaceEmbeddingTaskAction):
|
|
18
|
+
def __init__(self, config: InsightfaceFaceEmbeddingModelActionConfig, model: FaceAnalysis):
|
|
19
|
+
super().__init__(config, None)
|
|
20
|
+
|
|
21
|
+
self.model: FaceAnalysis = model
|
|
22
|
+
|
|
23
|
+
async def _embed(self, images: List[PILImage.Image], params: Dict[str, Any]) -> List[Tensor]:
|
|
24
|
+
import numpy as np
|
|
25
|
+
import cv2
|
|
26
|
+
|
|
27
|
+
embeddings = []
|
|
28
|
+
for image in images:
|
|
29
|
+
image_cv = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)
|
|
30
|
+
for face in self.model.get(image_cv):
|
|
31
|
+
embeddings.append(face.embedding)
|
|
32
|
+
|
|
33
|
+
return embeddings
|
|
34
|
+
|
|
35
|
+
async def _resolve_embedding_params(self, context: ComponentActionContext) -> Dict[str, Any]:
|
|
36
|
+
return {}
|
|
37
|
+
|
|
38
|
+
class InsightfaceFaceEmbeddingTaskService(FaceEmbeddingTaskService):
|
|
39
|
+
def __init__(self, id: str, config: ModelComponentConfig, daemon: bool):
|
|
40
|
+
super().__init__(id, config, daemon)
|
|
41
|
+
|
|
42
|
+
self.model: Optional[FaceAnalysis] = None
|
|
43
|
+
|
|
44
|
+
def get_setup_requirements(self) -> Optional[List[str]]:
|
|
45
|
+
return [ "insightface", "opencv-python", "onnxruntime" ]
|
|
46
|
+
|
|
47
|
+
async def _serve(self) -> None:
|
|
48
|
+
try:
|
|
49
|
+
self.model = self._load_pretrained_model()
|
|
50
|
+
logging.info(f"Model loaded successfully: {self.config.model}")
|
|
51
|
+
except Exception as e:
|
|
52
|
+
logging.error(f"Failed to load model '{self.config.model}': {e}")
|
|
53
|
+
raise
|
|
54
|
+
|
|
55
|
+
def _load_pretrained_model(self) -> FaceAnalysis:
|
|
56
|
+
from insightface.app import FaceAnalysis
|
|
57
|
+
|
|
58
|
+
model = FaceAnalysis(**self._resolve_model_params())
|
|
59
|
+
model.prepare(ctx_id=self._get_device_id())
|
|
60
|
+
|
|
61
|
+
return model
|
|
62
|
+
|
|
63
|
+
def _resolve_model_params(self) -> Dict[str, Any]:
|
|
64
|
+
if isinstance(self.config.model, LocalModelConfig):
|
|
65
|
+
path = os.path.dirname(self.config.model.path)
|
|
66
|
+
|
|
67
|
+
if os.path.basename(path) != "models":
|
|
68
|
+
raise ValueError(f"Expected 'models' directory in path, got: {path}")
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
"name": os.path.basename(self.config.model.path),
|
|
72
|
+
"root": os.path.dirname(path)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if isinstance(self.config.model, str):
|
|
76
|
+
path = os.path.dirname(self.config.model)
|
|
77
|
+
|
|
78
|
+
if os.path.basename(path) != "models":
|
|
79
|
+
raise ValueError(f"Expected 'models' directory in path, got: {path}")
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
"name": os.path.basename(self.config.model),
|
|
83
|
+
"root": os.path.dirname(path)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
raise ValueError(f"Unsupported model type: {type(self.config.model)}")
|
|
87
|
+
|
|
88
|
+
def _get_device_id(self) -> int:
|
|
89
|
+
return 0
|
|
90
|
+
|
|
91
|
+
async def _shutdown(self) -> None:
|
|
92
|
+
pass
|
|
93
|
+
|
|
94
|
+
async def _run(self, action: ModelActionConfig, context: ComponentActionContext, loop: asyncio.AbstractEventLoop) -> Any:
|
|
95
|
+
return await InsightfaceFaceEmbeddingTaskAction(action, self.model).run(context)
|
|
@@ -12,9 +12,9 @@ if TYPE_CHECKING:
|
|
|
12
12
|
import torch
|
|
13
13
|
|
|
14
14
|
class ImageGenerationTaskAction:
|
|
15
|
-
def __init__(self, config: ImageGenerationModelActionConfig, device: torch.device):
|
|
15
|
+
def __init__(self, config: ImageGenerationModelActionConfig, device: Optional[torch.device]):
|
|
16
16
|
self.config: ImageGenerationModelActionConfig = config
|
|
17
|
-
self.device: torch.device = device
|
|
17
|
+
self.device: Optional[torch.device] = device
|
|
18
18
|
|
|
19
19
|
async def run(self, context: ComponentActionContext) -> Any:
|
|
20
20
|
text = await self._prepare_input(context)
|
|
@@ -22,18 +22,18 @@ class ImageGenerationTaskAction:
|
|
|
22
22
|
texts: List[PILImage.Image] = [ text ] if is_single_input else text
|
|
23
23
|
results = []
|
|
24
24
|
|
|
25
|
-
batch_size
|
|
26
|
-
params
|
|
25
|
+
batch_size = await context.render_variable(self.config.batch_size)
|
|
26
|
+
params = await self._resolve_generation_params(context)
|
|
27
27
|
|
|
28
28
|
for index in range(0, len(texts), batch_size):
|
|
29
29
|
batch_texts = texts[index:index + batch_size]
|
|
30
|
-
upscaled_images = await self.
|
|
30
|
+
upscaled_images = await self._generate(batch_texts, params)
|
|
31
31
|
results.extend(upscaled_images)
|
|
32
32
|
|
|
33
33
|
return results[0] if is_single_input else results
|
|
34
34
|
|
|
35
35
|
async def _prepare_input(self, context: ComponentActionContext) -> Union[str, List[str]]:
|
|
36
|
-
return await context.
|
|
36
|
+
return await context.render_variable(self.config.text)
|
|
37
37
|
|
|
38
38
|
@abstractmethod
|
|
39
39
|
async def _generate(self, images: List[PILImage.Image], params: Dict[str, Any]) -> List[PILImage.Image]:
|
|
@@ -9,4 +9,4 @@ class CustomImageGenerationTaskService:
|
|
|
9
9
|
from .hunyuan_image import HunyuanImageGenerationTaskService
|
|
10
10
|
return HunyuanImageGenerationTaskService(id, config, daemon)
|
|
11
11
|
|
|
12
|
-
raise ValueError(f"Unknown
|
|
12
|
+
raise ValueError(f"Unknown family: {config.family}")
|
|
@@ -14,7 +14,7 @@ if TYPE_CHECKING:
|
|
|
14
14
|
import torch
|
|
15
15
|
|
|
16
16
|
class FluxImageGenerationTaskAction(ImageGenerationTaskAction):
|
|
17
|
-
def __init__(self, config: FluxImageGenerationModelActionConfig, pipeline: Any, device: torch.device):
|
|
17
|
+
def __init__(self, config: FluxImageGenerationModelActionConfig, pipeline: Any, device: Optional[torch.device]):
|
|
18
18
|
super().__init__(config, device)
|
|
19
19
|
|
|
20
20
|
self.pipeline = pipeline
|
|
@@ -14,7 +14,7 @@ if TYPE_CHECKING:
|
|
|
14
14
|
import torch
|
|
15
15
|
|
|
16
16
|
class HunyuanImageGenerationTaskAction(ImageGenerationTaskAction):
|
|
17
|
-
def __init__(self, config: HunyuanImageGenerationModelActionConfig, pipeline: Any, device: torch.device):
|
|
17
|
+
def __init__(self, config: HunyuanImageGenerationModelActionConfig, pipeline: Any, device: Optional[torch.device]):
|
|
18
18
|
super().__init__(config, device)
|
|
19
19
|
|
|
20
20
|
self.pipeline = pipeline
|
|
@@ -14,7 +14,7 @@ if TYPE_CHECKING:
|
|
|
14
14
|
import torch
|
|
15
15
|
|
|
16
16
|
class SdxlImageGenerationTaskAction(ImageGenerationTaskAction):
|
|
17
|
-
def __init__(self, config: SdxlImageGenerationModelActionConfig, pipeline: Any, device: torch.device):
|
|
17
|
+
def __init__(self, config: SdxlImageGenerationModelActionConfig, pipeline: Any, device: Optional[torch.device]):
|
|
18
18
|
super().__init__(config, device)
|
|
19
19
|
|
|
20
20
|
self.pipeline = pipeline
|