model-compose 0.2.10__tar.gz → 0.2.11__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.2.10/src/model_compose.egg-info → model_compose-0.2.11}/PKG-INFO +3 -1
- {model_compose-0.2.10 → model_compose-0.2.11}/pyproject.toml +4 -2
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/model/tasks/__init__.py +2 -0
- model_compose-0.2.11/src/mindor/core/component/services/model/tasks/summarization.py +75 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/model/tasks/text_embedding.py +12 -6
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/model/tasks/text_generation.py +14 -6
- model_compose-0.2.11/src/mindor/core/component/services/model/tasks/translation.py +72 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/workflow/workflow.py +0 -1
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/action/impl/model/impl/__init__.py +2 -0
- model_compose-0.2.11/src/mindor/dsl/schema/action/impl/model/impl/summarization.py +17 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/action/impl/model/impl/text_embedding.py +1 -1
- model_compose-0.2.11/src/mindor/dsl/schema/action/impl/model/impl/text_generation.py +15 -0
- model_compose-0.2.11/src/mindor/dsl/schema/action/impl/model/impl/translation.py +15 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/action/impl/model/model.py +2 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/model/impl/__init__.py +2 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/model/impl/common.py +4 -4
- model_compose-0.2.11/src/mindor/dsl/schema/component/impl/model/impl/summarization.py +9 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/model/impl/text_embedding.py +2 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/model/impl/text_generation.py +2 -0
- model_compose-0.2.11/src/mindor/dsl/schema/component/impl/model/impl/translation.py +9 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/model/impl/types.py +2 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/model/model.py +3 -1
- {model_compose-0.2.10 → model_compose-0.2.11/src/model_compose.egg-info}/PKG-INFO +3 -1
- {model_compose-0.2.10 → model_compose-0.2.11}/src/model_compose.egg-info/SOURCES.txt +6 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/model_compose.egg-info/requires.txt +2 -0
- model_compose-0.2.10/src/mindor/dsl/schema/action/impl/model/impl/text_generation.py +0 -15
- {model_compose-0.2.10 → model_compose-0.2.11}/LICENSE +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/README.md +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/setup.cfg +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/cli/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/cli/compose.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/base.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/component.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/context.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/http_client.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/http_server.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/mcp_client.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/mcp_server.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/model/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/model/base.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/model/model.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/shell.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/workflow.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/compose/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/compose/compose.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/compose/manager.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/base.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/controller.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/runner/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/runner/client.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/runner/http_client.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/runner/mcp_client.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/runner/runner.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/services/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/services/http_server.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/services/mcp_server.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/webui/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/webui/gradio.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/webui/webui.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/gateway/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/gateway/base.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/gateway/gateway.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/gateway/services/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/gateway/services/http_tunnel.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/gateway/services/ssh_tunnel.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/listener/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/listener/base.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/listener/listener.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/listener/services/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/listener/services/http_callback.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/logger/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/logger/base.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/logger/logger.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/logger/logging.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/logger/services/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/logger/services/console.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/logger/services/file.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/runtime/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/runtime/env.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/services/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/services/async_service.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/utils/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/utils/expiring.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/utils/http_client.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/utils/http_request.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/utils/http_status.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/utils/image.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/utils/mcp_client.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/utils/renderer.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/utils/ssh_client.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/utils/streaming.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/utils/time.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/utils/workqueue.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/workflow/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/workflow/context.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/workflow/job/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/workflow/job/base.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/workflow/job/impl/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/workflow/job/impl/action.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/workflow/job/impl/delay.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/workflow/job/job.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/workflow/schema.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/loader.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/action/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/action/action.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/action/impl/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/action/impl/common.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/action/impl/http_client.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/action/impl/http_server.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/action/impl/mcp_client.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/action/impl/mcp_server.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/action/impl/model/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/action/impl/model/impl/common.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/action/impl/shell.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/action/impl/workflow.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/component.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/common.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/http_client.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/http_server.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/mcp_client.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/mcp_server.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/model/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/shell.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/types.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/workflow.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/compose.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/controller/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/controller/controller.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/controller/impl/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/controller/impl/common.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/controller/impl/http_server.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/controller/impl/mcp_server.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/controller/impl/types.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/controller/impl/webui.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/gateway/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/gateway/gateway.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/gateway/impl/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/gateway/impl/common.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/gateway/impl/http_tunnel.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/gateway/impl/ssh_tunnel.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/gateway/impl/types.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/job/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/job/impl/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/job/impl/action.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/job/impl/common.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/job/impl/delay.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/job/impl/types.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/job/job.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/listener/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/listener/impl/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/listener/impl/common.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/listener/impl/http_callback.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/listener/impl/types.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/listener/listener.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/logger/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/logger/impl/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/logger/impl/common.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/logger/impl/console.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/logger/impl/file.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/logger/impl/types.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/logger/logger.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/runtime/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/runtime/impl/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/runtime/impl/common.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/runtime/impl/docker.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/runtime/impl/types.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/runtime/runtime.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/workflow.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/utils/__init__.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/utils/annotation.py +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/model_compose.egg-info/dependency_links.txt +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/model_compose.egg-info/entry_points.txt +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/src/model_compose.egg-info/top_level.txt +0 -0
- {model_compose-0.2.10 → model_compose-0.2.11}/tests/test_cli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: model-compose
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.11
|
|
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
|
|
@@ -22,6 +22,8 @@ Requires-Dist: gradio
|
|
|
22
22
|
Requires-Dist: Pillow
|
|
23
23
|
Requires-Dist: transformers
|
|
24
24
|
Requires-Dist: torch
|
|
25
|
+
Requires-Dist: sentencepiece
|
|
26
|
+
Requires-Dist: accelerate
|
|
25
27
|
Dynamic: license-file
|
|
26
28
|
|
|
27
29
|
# model-compose: Declarative AI Model and Workflow Orchestrator
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "model-compose"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.11"
|
|
4
4
|
description = "model-compose: Declarative AI Model and Workflow Orchestrator"
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Hanyeol Cho", email = "hanyeol.cho@gmail.com" }
|
|
@@ -22,7 +22,9 @@ dependencies = [
|
|
|
22
22
|
"gradio",
|
|
23
23
|
"Pillow",
|
|
24
24
|
"transformers",
|
|
25
|
-
"torch"
|
|
25
|
+
"torch",
|
|
26
|
+
"sentencepiece",
|
|
27
|
+
"accelerate"
|
|
26
28
|
]
|
|
27
29
|
|
|
28
30
|
[project.scripts]
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from mindor.dsl.schema.component import ModelComponentConfig
|
|
3
|
+
from mindor.dsl.schema.action import ModelActionConfig, SummarizationModelActionConfig
|
|
4
|
+
from mindor.core.logger import logging
|
|
5
|
+
from ..base import ModelTaskService, ModelTaskType, register_model_task_service
|
|
6
|
+
from ..base import ComponentActionContext
|
|
7
|
+
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, PreTrainedModel, PreTrainedTokenizer, GenerationMixin
|
|
8
|
+
import torch
|
|
9
|
+
|
|
10
|
+
class SummarizationTaskAction:
|
|
11
|
+
def __init__(self, config: SummarizationModelActionConfig, model: Union[PreTrainedModel, GenerationMixin], tokenizer: PreTrainedTokenizer):
|
|
12
|
+
self.config: SummarizationModelActionConfig = config
|
|
13
|
+
self.model: Union[PreTrainedModel, GenerationMixin] = model
|
|
14
|
+
self.tokenizer: PreTrainedTokenizer = tokenizer
|
|
15
|
+
|
|
16
|
+
async def run(self, context: ComponentActionContext) -> Any:
|
|
17
|
+
text: Union[str, List[str]] = await context.render_variable(self.config.text)
|
|
18
|
+
|
|
19
|
+
# Model parameters
|
|
20
|
+
max_input_length = await context.render_variable(self.config.params.max_input_length)
|
|
21
|
+
max_output_length = await context.render_variable(self.config.params.max_output_length)
|
|
22
|
+
min_output_length = await context.render_variable(self.config.params.min_output_length)
|
|
23
|
+
num_beams = await context.render_variable(self.config.params.num_beams)
|
|
24
|
+
length_penalty = await context.render_variable(self.config.params.length_penalty)
|
|
25
|
+
early_stopping = await context.render_variable(self.config.params.early_stopping)
|
|
26
|
+
do_sample = await context.render_variable(self.config.params.do_sample)
|
|
27
|
+
|
|
28
|
+
# Tokenizing
|
|
29
|
+
inputs = self.tokenizer(text, return_tensors="pt", max_length=max_input_length, padding=True, truncation=True).to(self.model.device)
|
|
30
|
+
|
|
31
|
+
# Text Summarization
|
|
32
|
+
with torch.no_grad():
|
|
33
|
+
outputs = self.model.generate(
|
|
34
|
+
**inputs,
|
|
35
|
+
max_length=max_output_length,
|
|
36
|
+
min_length=min_output_length,
|
|
37
|
+
num_beams=num_beams,
|
|
38
|
+
length_penalty=length_penalty,
|
|
39
|
+
early_stopping=early_stopping,
|
|
40
|
+
do_sample=do_sample,
|
|
41
|
+
pad_token_id=getattr(self.tokenizer, "pad_token_id", None),
|
|
42
|
+
eos_token_id=getattr(self.tokenizer, "eos_token_id", None)
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
# Decoding output
|
|
46
|
+
outputs = self.tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
|
47
|
+
|
|
48
|
+
result = outputs if isinstance(text, list) else outputs[0]
|
|
49
|
+
context.register_source("result", result)
|
|
50
|
+
|
|
51
|
+
return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
|
|
52
|
+
|
|
53
|
+
@register_model_task_service(ModelTaskType.SUMMARIZATION)
|
|
54
|
+
class SummarizationTaskService(ModelTaskService):
|
|
55
|
+
def __init__(self, id: str, config: ModelComponentConfig, daemon: bool):
|
|
56
|
+
super().__init__(id, config, daemon)
|
|
57
|
+
|
|
58
|
+
self.model: Optional[Union[PreTrainedModel, GenerationMixin]] = None
|
|
59
|
+
self.tokenizer: Optional[PreTrainedTokenizer] = None
|
|
60
|
+
|
|
61
|
+
async def _serve(self) -> None:
|
|
62
|
+
try:
|
|
63
|
+
self.model = AutoModelForSeq2SeqLM.from_pretrained(self.config.model).to(torch.device(self.config.device))
|
|
64
|
+
self.tokenizer = AutoTokenizer.from_pretrained(self.config.model, use_fast=self.config.fast_tokenizer)
|
|
65
|
+
logging.info(f"Model and tokenizer loaded successfully on device '{self.config.device}': {self.config.model}")
|
|
66
|
+
except Exception as e:
|
|
67
|
+
logging.error(f"Failed to load model '{self.config.model}': {e}")
|
|
68
|
+
raise
|
|
69
|
+
|
|
70
|
+
async def _shutdown(self) -> None:
|
|
71
|
+
self.model = None
|
|
72
|
+
self.tokenizer = None
|
|
73
|
+
|
|
74
|
+
async def _run(self, action: ModelActionConfig, context: ComponentActionContext) -> Any:
|
|
75
|
+
return await SummarizationTaskAction(action, self.model, self.tokenizer).run(context)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
2
|
from mindor.dsl.schema.component import ModelComponentConfig
|
|
3
3
|
from mindor.dsl.schema.action import ModelActionConfig, TextEmbeddingModelActionConfig
|
|
4
|
+
from mindor.core.logger import logging
|
|
4
5
|
from ..base import ModelTaskService, ModelTaskType, register_model_task_service
|
|
5
6
|
from ..base import ComponentActionContext
|
|
6
7
|
from transformers import AutoModel, AutoTokenizer, PreTrainedModel, PreTrainedTokenizer
|
|
@@ -18,12 +19,12 @@ class TextEmbeddingTaskAction:
|
|
|
18
19
|
text = await context.render_variable(self.config.text)
|
|
19
20
|
|
|
20
21
|
# Model parameters
|
|
21
|
-
|
|
22
|
-
pooling
|
|
23
|
-
normalize
|
|
22
|
+
max_input_length = await context.render_variable(self.config.params.max_input_length)
|
|
23
|
+
pooling = await context.render_variable(self.config.params.pooling)
|
|
24
|
+
normalize = await context.render_variable(self.config.params.normalize)
|
|
24
25
|
|
|
25
26
|
# Tokenizing
|
|
26
|
-
inputs = self.tokenizer(text, return_tensors="pt", padding=True, truncation=True
|
|
27
|
+
inputs = self.tokenizer(text, return_tensors="pt", max_length=max_input_length, padding=True, truncation=True).to(self.model.device)
|
|
27
28
|
attention_mask: Tensor = inputs.get("attention_mask", None)
|
|
28
29
|
|
|
29
30
|
# Forward pass through the model
|
|
@@ -72,8 +73,13 @@ class TextEmbeddingTaskService(ModelTaskService):
|
|
|
72
73
|
self.tokenizer: Optional[PreTrainedTokenizer] = None
|
|
73
74
|
|
|
74
75
|
async def _serve(self) -> None:
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
try:
|
|
77
|
+
self.model = AutoModel.from_pretrained(self.config.model).to(torch.device(self.config.device))
|
|
78
|
+
self.tokenizer = AutoTokenizer.from_pretrained(self.config.model, use_fast=self.config.fast_tokenizer)
|
|
79
|
+
logging.info(f"Model and tokenizer loaded successfully on device '{self.config.device}': {self.config.model}")
|
|
80
|
+
except Exception as e:
|
|
81
|
+
logging.error(f"Failed to load model '{self.config.model}': {e}")
|
|
82
|
+
raise
|
|
77
83
|
|
|
78
84
|
async def _shutdown(self) -> None:
|
|
79
85
|
self.model = None
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
2
|
from mindor.dsl.schema.component import ModelComponentConfig
|
|
3
3
|
from mindor.dsl.schema.action import ModelActionConfig, TextGenerationModelActionConfig
|
|
4
|
+
from mindor.core.logger import logging
|
|
4
5
|
from ..base import ModelTaskService, ModelTaskType, register_model_task_service
|
|
5
6
|
from ..base import ComponentActionContext
|
|
6
7
|
from transformers import AutoModelForCausalLM, AutoTokenizer, PreTrainedModel, PreTrainedTokenizer, GenerationMixin
|
|
@@ -13,10 +14,10 @@ class TextGenerationTaskAction:
|
|
|
13
14
|
self.tokenizer: PreTrainedTokenizer = tokenizer
|
|
14
15
|
|
|
15
16
|
async def run(self, context: ComponentActionContext) -> Any:
|
|
16
|
-
prompt: str = await context.render_variable(self.config.prompt)
|
|
17
|
+
prompt: Union[str, List[str]] = await context.render_variable(self.config.prompt)
|
|
17
18
|
|
|
18
19
|
# Model parameters
|
|
19
|
-
|
|
20
|
+
max_output_length = await context.render_variable(self.config.params.max_output_length)
|
|
20
21
|
num_return_sequences = await context.render_variable(self.config.params.num_return_sequences)
|
|
21
22
|
temperature = await context.render_variable(self.config.params.temperature)
|
|
22
23
|
top_k = await context.render_variable(self.config.params.top_k)
|
|
@@ -29,7 +30,7 @@ class TextGenerationTaskAction:
|
|
|
29
30
|
with torch.no_grad():
|
|
30
31
|
outputs = self.model.generate(
|
|
31
32
|
**inputs,
|
|
32
|
-
max_length=
|
|
33
|
+
max_length=max_output_length,
|
|
33
34
|
num_return_sequences=num_return_sequences,
|
|
34
35
|
temperature=temperature,
|
|
35
36
|
top_k=top_k,
|
|
@@ -38,7 +39,9 @@ class TextGenerationTaskAction:
|
|
|
38
39
|
)
|
|
39
40
|
|
|
40
41
|
# Decoding output
|
|
41
|
-
|
|
42
|
+
outputs = self.tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
|
43
|
+
|
|
44
|
+
result = outputs if isinstance(prompt, list) else outputs[0]
|
|
42
45
|
context.register_source("result", result)
|
|
43
46
|
|
|
44
47
|
return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
|
|
@@ -52,8 +55,13 @@ class TextGenerationTaskService(ModelTaskService):
|
|
|
52
55
|
self.tokenizer: Optional[PreTrainedTokenizer] = None
|
|
53
56
|
|
|
54
57
|
async def _serve(self) -> None:
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
try:
|
|
59
|
+
self.model = AutoModelForCausalLM.from_pretrained(self.config.model).to(torch.device(self.config.device))
|
|
60
|
+
self.tokenizer = AutoTokenizer.from_pretrained(self.config.model, use_fast=self.config.fast_tokenizer)
|
|
61
|
+
logging.info(f"Model and tokenizer loaded successfully on device '{self.config.device}': {self.config.model}")
|
|
62
|
+
except Exception as e:
|
|
63
|
+
logging.error(f"Failed to load model '{self.config.model}': {e}")
|
|
64
|
+
raise
|
|
57
65
|
|
|
58
66
|
async def _shutdown(self) -> None:
|
|
59
67
|
self.model = None
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from mindor.dsl.schema.component import ModelComponentConfig
|
|
3
|
+
from mindor.dsl.schema.action import ModelActionConfig, TranslationModelActionConfig
|
|
4
|
+
from mindor.core.logger import logging
|
|
5
|
+
from ..base import ModelTaskService, ModelTaskType, register_model_task_service
|
|
6
|
+
from ..base import ComponentActionContext
|
|
7
|
+
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, PreTrainedModel, PreTrainedTokenizer, GenerationMixin
|
|
8
|
+
import torch
|
|
9
|
+
|
|
10
|
+
class TranslationTaskAction:
|
|
11
|
+
def __init__(self, config: TranslationModelActionConfig, model: Union[PreTrainedModel, GenerationMixin], tokenizer: PreTrainedTokenizer):
|
|
12
|
+
self.config: TranslationModelActionConfig = config
|
|
13
|
+
self.model: Union[PreTrainedModel, GenerationMixin] = model
|
|
14
|
+
self.tokenizer: PreTrainedTokenizer = tokenizer
|
|
15
|
+
|
|
16
|
+
async def run(self, context: ComponentActionContext) -> Any:
|
|
17
|
+
text: Union[str, List[str]] = await context.render_variable(self.config.text)
|
|
18
|
+
|
|
19
|
+
# Model parameters
|
|
20
|
+
max_input_length = await context.render_variable(self.config.params.max_input_length)
|
|
21
|
+
max_output_length = await context.render_variable(self.config.params.max_output_length)
|
|
22
|
+
min_output_length = await context.render_variable(self.config.params.min_output_length)
|
|
23
|
+
num_beams = await context.render_variable(self.config.params.num_beams)
|
|
24
|
+
length_penalty = await context.render_variable(self.config.params.length_penalty)
|
|
25
|
+
|
|
26
|
+
# Tokenizing
|
|
27
|
+
inputs = self.tokenizer(text, return_tensors="pt", max_length=max_input_length, padding=True, truncation=True).to(self.model.device)
|
|
28
|
+
|
|
29
|
+
# Text Translation
|
|
30
|
+
with torch.no_grad():
|
|
31
|
+
outputs = self.model.generate(
|
|
32
|
+
**inputs,
|
|
33
|
+
max_length=max_output_length,
|
|
34
|
+
min_length=min_output_length,
|
|
35
|
+
num_beams=num_beams,
|
|
36
|
+
length_penalty=length_penalty,
|
|
37
|
+
do_sample=False,
|
|
38
|
+
pad_token_id=getattr(self.tokenizer, "pad_token_id", None),
|
|
39
|
+
eos_token_id=getattr(self.tokenizer, "eos_token_id", None)
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
# Decoding output
|
|
43
|
+
outputs = self.tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
|
44
|
+
|
|
45
|
+
result = outputs if isinstance(text, list) else outputs[0]
|
|
46
|
+
context.register_source("result", result)
|
|
47
|
+
|
|
48
|
+
return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
|
|
49
|
+
|
|
50
|
+
@register_model_task_service(ModelTaskType.TRANSLATION)
|
|
51
|
+
class TranslationTaskService(ModelTaskService):
|
|
52
|
+
def __init__(self, id: str, config: ModelComponentConfig, daemon: bool):
|
|
53
|
+
super().__init__(id, config, daemon)
|
|
54
|
+
|
|
55
|
+
self.model: Optional[Union[PreTrainedModel, GenerationMixin]] = None
|
|
56
|
+
self.tokenizer: Optional[PreTrainedTokenizer] = None
|
|
57
|
+
|
|
58
|
+
async def _serve(self) -> None:
|
|
59
|
+
try:
|
|
60
|
+
self.model = AutoModelForSeq2SeqLM.from_pretrained(self.config.model).to(torch.device(self.config.device))
|
|
61
|
+
self.tokenizer = AutoTokenizer.from_pretrained(self.config.model, use_fast=self.config.fast_tokenizer)
|
|
62
|
+
logging.info(f"Model and tokenizer loaded successfully on device '{self.config.device}': {self.config.model}")
|
|
63
|
+
except Exception as e:
|
|
64
|
+
logging.error(f"Failed to load model '{self.config.model}': {e}")
|
|
65
|
+
raise
|
|
66
|
+
|
|
67
|
+
async def _shutdown(self) -> None:
|
|
68
|
+
self.model = None
|
|
69
|
+
self.tokenizer = None
|
|
70
|
+
|
|
71
|
+
async def _run(self, action: ModelActionConfig, context: ComponentActionContext) -> Any:
|
|
72
|
+
return await TranslationTaskAction(action, self.model, self.tokenizer).run(context)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
from pydantic import model_validator
|
|
4
|
+
from .common import CommonModelActionConfig
|
|
5
|
+
|
|
6
|
+
class SummarizationParamsConfig(BaseModel):
|
|
7
|
+
max_input_length: int = Field(default=1024, description="Maximum number of tokens per input text.")
|
|
8
|
+
max_output_length: int = Field(default=256, description="The maximum number of tokens to generate.")
|
|
9
|
+
min_output_length: int = Field(default=30, description="The minimum number of tokens to generate.")
|
|
10
|
+
num_beams: int = Field(default=4, description="")
|
|
11
|
+
length_penalty: float = Field(default=2.0, description="")
|
|
12
|
+
early_stopping: bool = Field(default=True, description="")
|
|
13
|
+
do_sample: bool = Field(default=True, description="Whether to use sampling.")
|
|
14
|
+
|
|
15
|
+
class SummarizationModelActionConfig(CommonModelActionConfig):
|
|
16
|
+
text: str = Field(..., description="")
|
|
17
|
+
params: SummarizationParamsConfig = Field(default_factory=SummarizationParamsConfig, description="Summarization configuration parameters.")
|
|
@@ -4,10 +4,10 @@ from pydantic import model_validator
|
|
|
4
4
|
from .common import CommonModelActionConfig
|
|
5
5
|
|
|
6
6
|
class TextEmbeddingParamsConfig(BaseModel):
|
|
7
|
+
max_input_length: int = Field(default=512, description="Maximum number of tokens per input text.")
|
|
7
8
|
pooling: Literal[ "mean", "cls", "max" ] = Field(default="mean", description="Pooling strategy used to aggregate token embeddings.")
|
|
8
9
|
normalize: bool = Field(default=True, description="Whether to apply L2 normalization to the output embeddings.")
|
|
9
10
|
batch_size: int = Field(default=1, description="Number of input texts to process in a single batch.")
|
|
10
|
-
max_length: int = Field(default=512, description="Maximum number of tokens per input text.")
|
|
11
11
|
|
|
12
12
|
class TextEmbeddingModelActionConfig(CommonModelActionConfig):
|
|
13
13
|
text: str = Field(..., description="Input text to be embedded.")
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
from pydantic import model_validator
|
|
4
|
+
from .common import CommonModelActionConfig
|
|
5
|
+
|
|
6
|
+
class TextGenerationParamsConfig(BaseModel):
|
|
7
|
+
max_output_length: int = Field(default=1024, description="The maximum number of tokens to generate.")
|
|
8
|
+
num_return_sequences: int = Field(default=1, description="The number of generated sequences to return.")
|
|
9
|
+
temperature: float = Field(default=1.0, description="Sampling temperature; higher values produce more random results.")
|
|
10
|
+
top_k: int = Field(default=50, description="Top-K sampling; restricts sampling to the top K tokens.")
|
|
11
|
+
top_p: float = Field(default=1.0, description="Top-p (nucleus) sampling; restricts sampling to tokens with cumulative probability >= top_p.")
|
|
12
|
+
|
|
13
|
+
class TextGenerationModelActionConfig(CommonModelActionConfig):
|
|
14
|
+
prompt: str = Field(..., description="")
|
|
15
|
+
params: TextGenerationParamsConfig = Field(default_factory=TextGenerationParamsConfig, description="Text generation configuration parameters.")
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
from pydantic import model_validator
|
|
4
|
+
from .common import CommonModelActionConfig
|
|
5
|
+
|
|
6
|
+
class TranslationParamsConfig(BaseModel):
|
|
7
|
+
max_input_length: int = Field(default=1024, description="Maximum number of tokens per input text.")
|
|
8
|
+
max_output_length: int = Field(default=256, description="The maximum number of tokens to generate.")
|
|
9
|
+
min_output_length: int = Field(default=10, description="The minimum number of tokens to generate.")
|
|
10
|
+
num_beams: int = Field(default=4, description="")
|
|
11
|
+
length_penalty: float = Field(default=1.0, description="")
|
|
12
|
+
|
|
13
|
+
class TranslationModelActionConfig(CommonModelActionConfig):
|
|
14
|
+
text: str = Field(..., description="")
|
|
15
|
+
params: TranslationParamsConfig = Field(default_factory=TranslationParamsConfig, description="Translation configuration parameters.")
|
|
@@ -8,11 +8,11 @@ from .types import ModelTaskType
|
|
|
8
8
|
|
|
9
9
|
class CommonModelComponentConfig(CommonComponentConfig):
|
|
10
10
|
type: Literal[ComponentType.MODEL]
|
|
11
|
-
task: ModelTaskType = Field(..., description="")
|
|
12
|
-
model: str = Field(..., description="")
|
|
11
|
+
task: ModelTaskType = Field(..., description="Type of task the model performs.")
|
|
12
|
+
model: str = Field(..., description="Model name or path.")
|
|
13
13
|
device: str = Field(default="cpu", description="Computation device to use.")
|
|
14
|
-
cache_dir: Optional[str] = Field(default=None, description="")
|
|
15
|
-
|
|
14
|
+
cache_dir: Optional[str] = Field(default=None, description="Directory to cache the model and tokenizer files.")
|
|
15
|
+
fast_tokenizer: bool = Field(default=True, description="Whether to use the fast tokenizer if available.")
|
|
16
16
|
|
|
17
17
|
@model_validator(mode="before")
|
|
18
18
|
def inflate_single_action(cls, values: Dict[str, Any]):
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
from pydantic import model_validator
|
|
4
|
+
from mindor.dsl.schema.action import SummarizationModelActionConfig
|
|
5
|
+
from .common import CommonModelComponentConfig, ModelTaskType
|
|
6
|
+
|
|
7
|
+
class SummarizationModelComponentConfig(CommonModelComponentConfig):
|
|
8
|
+
task: Literal[ModelTaskType.SUMMARIZATION]
|
|
9
|
+
actions: Dict[str, SummarizationModelActionConfig] = Field(default_factory=dict)
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
2
|
from pydantic import BaseModel, Field
|
|
3
3
|
from pydantic import model_validator
|
|
4
|
+
from mindor.dsl.schema.action import TextEmbeddingModelActionConfig
|
|
4
5
|
from .common import CommonModelComponentConfig, ModelTaskType
|
|
5
6
|
|
|
6
7
|
class TextEmbeddingModelComponentConfig(CommonModelComponentConfig):
|
|
7
8
|
task: Literal[ModelTaskType.TEXT_EMBEDDING]
|
|
9
|
+
actions: Dict[str, TextEmbeddingModelActionConfig] = Field(default_factory=dict)
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
2
|
from pydantic import BaseModel, Field
|
|
3
3
|
from pydantic import model_validator
|
|
4
|
+
from mindor.dsl.schema.action import TextGenerationModelActionConfig
|
|
4
5
|
from .common import CommonModelComponentConfig, ModelTaskType
|
|
5
6
|
|
|
6
7
|
class TextGenerationModelComponentConfig(CommonModelComponentConfig):
|
|
7
8
|
task: Literal[ModelTaskType.TEXT_GENERATION]
|
|
9
|
+
actions: Dict[str, TextGenerationModelActionConfig] = Field(default_factory=dict)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
from pydantic import model_validator
|
|
4
|
+
from mindor.dsl.schema.action import TranslationModelActionConfig
|
|
5
|
+
from .common import CommonModelComponentConfig, ModelTaskType
|
|
6
|
+
|
|
7
|
+
class TranslationModelComponentConfig(CommonModelComponentConfig):
|
|
8
|
+
task: Literal[ModelTaskType.TRANSLATION]
|
|
9
|
+
actions: Dict[str, TranslationModelActionConfig] = Field(default_factory=dict)
|
{model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/dsl/schema/component/impl/model/model.py
RENAMED
|
@@ -4,7 +4,9 @@ from .impl import *
|
|
|
4
4
|
|
|
5
5
|
ModelComponentConfig = Annotated[
|
|
6
6
|
Union[
|
|
7
|
-
TextGenerationModelComponentConfig,
|
|
7
|
+
TextGenerationModelComponentConfig,
|
|
8
|
+
SummarizationModelComponentConfig,
|
|
9
|
+
TranslationModelComponentConfig,
|
|
8
10
|
TextEmbeddingModelComponentConfig,
|
|
9
11
|
],
|
|
10
12
|
Field(discriminator="task")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: model-compose
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.11
|
|
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
|
|
@@ -22,6 +22,8 @@ Requires-Dist: gradio
|
|
|
22
22
|
Requires-Dist: Pillow
|
|
23
23
|
Requires-Dist: transformers
|
|
24
24
|
Requires-Dist: torch
|
|
25
|
+
Requires-Dist: sentencepiece
|
|
26
|
+
Requires-Dist: accelerate
|
|
25
27
|
Dynamic: license-file
|
|
26
28
|
|
|
27
29
|
# model-compose: Declarative AI Model and Workflow Orchestrator
|
|
@@ -20,8 +20,10 @@ src/mindor/core/component/services/model/__init__.py
|
|
|
20
20
|
src/mindor/core/component/services/model/base.py
|
|
21
21
|
src/mindor/core/component/services/model/model.py
|
|
22
22
|
src/mindor/core/component/services/model/tasks/__init__.py
|
|
23
|
+
src/mindor/core/component/services/model/tasks/summarization.py
|
|
23
24
|
src/mindor/core/component/services/model/tasks/text_embedding.py
|
|
24
25
|
src/mindor/core/component/services/model/tasks/text_generation.py
|
|
26
|
+
src/mindor/core/component/services/model/tasks/translation.py
|
|
25
27
|
src/mindor/core/compose/__init__.py
|
|
26
28
|
src/mindor/core/compose/compose.py
|
|
27
29
|
src/mindor/core/compose/manager.py
|
|
@@ -102,8 +104,10 @@ src/mindor/dsl/schema/action/impl/model/__init__.py
|
|
|
102
104
|
src/mindor/dsl/schema/action/impl/model/model.py
|
|
103
105
|
src/mindor/dsl/schema/action/impl/model/impl/__init__.py
|
|
104
106
|
src/mindor/dsl/schema/action/impl/model/impl/common.py
|
|
107
|
+
src/mindor/dsl/schema/action/impl/model/impl/summarization.py
|
|
105
108
|
src/mindor/dsl/schema/action/impl/model/impl/text_embedding.py
|
|
106
109
|
src/mindor/dsl/schema/action/impl/model/impl/text_generation.py
|
|
110
|
+
src/mindor/dsl/schema/action/impl/model/impl/translation.py
|
|
107
111
|
src/mindor/dsl/schema/component/__init__.py
|
|
108
112
|
src/mindor/dsl/schema/component/component.py
|
|
109
113
|
src/mindor/dsl/schema/component/impl/__init__.py
|
|
@@ -119,8 +123,10 @@ src/mindor/dsl/schema/component/impl/model/__init__.py
|
|
|
119
123
|
src/mindor/dsl/schema/component/impl/model/model.py
|
|
120
124
|
src/mindor/dsl/schema/component/impl/model/impl/__init__.py
|
|
121
125
|
src/mindor/dsl/schema/component/impl/model/impl/common.py
|
|
126
|
+
src/mindor/dsl/schema/component/impl/model/impl/summarization.py
|
|
122
127
|
src/mindor/dsl/schema/component/impl/model/impl/text_embedding.py
|
|
123
128
|
src/mindor/dsl/schema/component/impl/model/impl/text_generation.py
|
|
129
|
+
src/mindor/dsl/schema/component/impl/model/impl/translation.py
|
|
124
130
|
src/mindor/dsl/schema/component/impl/model/impl/types.py
|
|
125
131
|
src/mindor/dsl/schema/controller/__init__.py
|
|
126
132
|
src/mindor/dsl/schema/controller/controller.py
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
from typing import Type, Union, Literal, Optional, Dict, List, Tuple, Set, Annotated, Any
|
|
2
|
-
from pydantic import BaseModel, Field
|
|
3
|
-
from pydantic import model_validator
|
|
4
|
-
from .common import CommonModelActionConfig
|
|
5
|
-
|
|
6
|
-
class TextGenerationParamsConfig(BaseModel):
|
|
7
|
-
max_length: int = Field(default=128, description="")
|
|
8
|
-
num_return_sequences: int = Field(default=1, description="")
|
|
9
|
-
temperature: float = Field(default=1.0, description="")
|
|
10
|
-
top_k: int = Field(default=50, description="")
|
|
11
|
-
top_p: float = Field(default=1.0, description="")
|
|
12
|
-
|
|
13
|
-
class TextGenerationModelActionConfig(CommonModelActionConfig):
|
|
14
|
-
prompt: str = Field(..., description="")
|
|
15
|
-
params: TextGenerationParamsConfig = Field(default_factory=TextGenerationParamsConfig, description="Text generation configuration parameters.")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/__init__.py
RENAMED
|
File without changes
|
{model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/http_client.py
RENAMED
|
File without changes
|
{model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/http_server.py
RENAMED
|
File without changes
|
{model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/mcp_client.py
RENAMED
|
File without changes
|
{model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/mcp_server.py
RENAMED
|
File without changes
|
{model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/model/__init__.py
RENAMED
|
File without changes
|
{model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/model/base.py
RENAMED
|
File without changes
|
{model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/model/model.py
RENAMED
|
File without changes
|
|
File without changes
|
{model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/component/services/workflow.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/runner/http_client.py
RENAMED
|
File without changes
|
{model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/runner/mcp_client.py
RENAMED
|
File without changes
|
|
File without changes
|
{model_compose-0.2.10 → model_compose-0.2.11}/src/mindor/core/controller/services/__init__.py
RENAMED
|
File without changes
|