model-compose 0.2.11__tar.gz → 0.2.12__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.
Files changed (189) hide show
  1. {model_compose-0.2.11/src/model_compose.egg-info → model_compose-0.2.12}/PKG-INFO +2 -2
  2. {model_compose-0.2.11 → model_compose-0.2.12}/pyproject.toml +2 -2
  3. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/services/model/tasks/__init__.py +1 -0
  4. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/services/model/tasks/summarization.py +22 -19
  5. model_compose-0.2.12/src/mindor/core/component/services/model/tasks/text_classification.py +78 -0
  6. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/services/model/tasks/text_embedding.py +18 -14
  7. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/services/model/tasks/text_generation.py +21 -18
  8. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/services/model/tasks/translation.py +21 -18
  9. {model_compose-0.2.11/src/mindor/dsl/schema/component → model_compose-0.2.12/src/mindor/dsl/schema/action}/impl/model/impl/__init__.py +1 -0
  10. model_compose-0.2.12/src/mindor/dsl/schema/action/impl/model/impl/summarization.py +18 -0
  11. model_compose-0.2.12/src/mindor/dsl/schema/action/impl/model/impl/text_classification.py +12 -0
  12. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/action/impl/model/impl/text_embedding.py +4 -4
  13. model_compose-0.2.12/src/mindor/dsl/schema/action/impl/model/impl/text_generation.py +16 -0
  14. model_compose-0.2.12/src/mindor/dsl/schema/action/impl/model/impl/translation.py +16 -0
  15. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/action/impl/model/model.py +1 -0
  16. {model_compose-0.2.11/src/mindor/dsl/schema/action → model_compose-0.2.12/src/mindor/dsl/schema/component}/impl/model/impl/__init__.py +1 -0
  17. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/model/impl/common.py +3 -0
  18. model_compose-0.2.12/src/mindor/dsl/schema/component/impl/model/impl/text_classification.py +9 -0
  19. model_compose-0.2.12/src/mindor/dsl/schema/component/impl/model/impl/types.py +8 -0
  20. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/model/model.py +1 -0
  21. {model_compose-0.2.11 → model_compose-0.2.12/src/model_compose.egg-info}/PKG-INFO +2 -2
  22. {model_compose-0.2.11 → model_compose-0.2.12}/src/model_compose.egg-info/SOURCES.txt +3 -0
  23. {model_compose-0.2.11 → model_compose-0.2.12}/src/model_compose.egg-info/requires.txt +1 -1
  24. model_compose-0.2.11/src/mindor/dsl/schema/action/impl/model/impl/summarization.py +0 -17
  25. model_compose-0.2.11/src/mindor/dsl/schema/action/impl/model/impl/text_generation.py +0 -15
  26. model_compose-0.2.11/src/mindor/dsl/schema/action/impl/model/impl/translation.py +0 -15
  27. model_compose-0.2.11/src/mindor/dsl/schema/component/impl/model/impl/types.py +0 -7
  28. {model_compose-0.2.11 → model_compose-0.2.12}/LICENSE +0 -0
  29. {model_compose-0.2.11 → model_compose-0.2.12}/README.md +0 -0
  30. {model_compose-0.2.11 → model_compose-0.2.12}/setup.cfg +0 -0
  31. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/__init__.py +0 -0
  32. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/cli/__init__.py +0 -0
  33. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/cli/compose.py +0 -0
  34. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/__init__.py +0 -0
  35. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/__init__.py +0 -0
  36. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/base.py +0 -0
  37. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/component.py +0 -0
  38. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/context.py +0 -0
  39. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/services/__init__.py +0 -0
  40. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/services/http_client.py +0 -0
  41. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/services/http_server.py +0 -0
  42. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/services/mcp_client.py +0 -0
  43. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/services/mcp_server.py +0 -0
  44. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/services/model/__init__.py +0 -0
  45. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/services/model/base.py +0 -0
  46. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/services/model/model.py +0 -0
  47. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/services/shell.py +0 -0
  48. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/component/services/workflow.py +0 -0
  49. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/compose/__init__.py +0 -0
  50. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/compose/compose.py +0 -0
  51. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/compose/manager.py +0 -0
  52. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/controller/__init__.py +0 -0
  53. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/controller/base.py +0 -0
  54. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/controller/controller.py +0 -0
  55. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/controller/runner/__init__.py +0 -0
  56. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/controller/runner/client.py +0 -0
  57. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/controller/runner/http_client.py +0 -0
  58. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/controller/runner/mcp_client.py +0 -0
  59. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/controller/runner/runner.py +0 -0
  60. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/controller/services/__init__.py +0 -0
  61. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/controller/services/http_server.py +0 -0
  62. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/controller/services/mcp_server.py +0 -0
  63. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/controller/webui/__init__.py +0 -0
  64. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/controller/webui/gradio.py +0 -0
  65. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/controller/webui/webui.py +0 -0
  66. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/gateway/__init__.py +0 -0
  67. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/gateway/base.py +0 -0
  68. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/gateway/gateway.py +0 -0
  69. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/gateway/services/__init__.py +0 -0
  70. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/gateway/services/http_tunnel.py +0 -0
  71. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/gateway/services/ssh_tunnel.py +0 -0
  72. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/listener/__init__.py +0 -0
  73. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/listener/base.py +0 -0
  74. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/listener/listener.py +0 -0
  75. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/listener/services/__init__.py +0 -0
  76. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/listener/services/http_callback.py +0 -0
  77. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/logger/__init__.py +0 -0
  78. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/logger/base.py +0 -0
  79. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/logger/logger.py +0 -0
  80. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/logger/logging.py +0 -0
  81. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/logger/services/__init__.py +0 -0
  82. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/logger/services/console.py +0 -0
  83. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/logger/services/file.py +0 -0
  84. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/runtime/__init__.py +0 -0
  85. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/runtime/env.py +0 -0
  86. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/services/__init__.py +0 -0
  87. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/services/async_service.py +0 -0
  88. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/utils/__init__.py +0 -0
  89. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/utils/expiring.py +0 -0
  90. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/utils/http_client.py +0 -0
  91. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/utils/http_request.py +0 -0
  92. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/utils/http_status.py +0 -0
  93. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/utils/image.py +0 -0
  94. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/utils/mcp_client.py +0 -0
  95. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/utils/renderer.py +0 -0
  96. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/utils/ssh_client.py +0 -0
  97. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/utils/streaming.py +0 -0
  98. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/utils/time.py +0 -0
  99. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/utils/workqueue.py +0 -0
  100. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/workflow/__init__.py +0 -0
  101. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/workflow/context.py +0 -0
  102. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/workflow/job/__init__.py +0 -0
  103. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/workflow/job/base.py +0 -0
  104. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/workflow/job/impl/__init__.py +0 -0
  105. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/workflow/job/impl/action.py +0 -0
  106. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/workflow/job/impl/delay.py +0 -0
  107. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/workflow/job/job.py +0 -0
  108. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/workflow/schema.py +0 -0
  109. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/core/workflow/workflow.py +0 -0
  110. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/__init__.py +0 -0
  111. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/loader.py +0 -0
  112. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/__init__.py +0 -0
  113. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/action/__init__.py +0 -0
  114. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/action/action.py +0 -0
  115. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/action/impl/__init__.py +0 -0
  116. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/action/impl/common.py +0 -0
  117. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/action/impl/http_client.py +0 -0
  118. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/action/impl/http_server.py +0 -0
  119. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/action/impl/mcp_client.py +0 -0
  120. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/action/impl/mcp_server.py +0 -0
  121. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/action/impl/model/__init__.py +0 -0
  122. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/action/impl/model/impl/common.py +0 -0
  123. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/action/impl/shell.py +0 -0
  124. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/action/impl/workflow.py +0 -0
  125. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/__init__.py +0 -0
  126. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/component.py +0 -0
  127. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/__init__.py +0 -0
  128. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/common.py +0 -0
  129. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/http_client.py +0 -0
  130. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/http_server.py +0 -0
  131. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/mcp_client.py +0 -0
  132. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/mcp_server.py +0 -0
  133. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/model/__init__.py +0 -0
  134. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/model/impl/summarization.py +0 -0
  135. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/model/impl/text_embedding.py +0 -0
  136. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/model/impl/text_generation.py +0 -0
  137. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/model/impl/translation.py +0 -0
  138. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/shell.py +0 -0
  139. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/types.py +0 -0
  140. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/component/impl/workflow.py +0 -0
  141. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/compose.py +0 -0
  142. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/controller/__init__.py +0 -0
  143. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/controller/controller.py +0 -0
  144. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/controller/impl/__init__.py +0 -0
  145. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/controller/impl/common.py +0 -0
  146. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/controller/impl/http_server.py +0 -0
  147. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/controller/impl/mcp_server.py +0 -0
  148. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/controller/impl/types.py +0 -0
  149. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/controller/impl/webui.py +0 -0
  150. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/gateway/__init__.py +0 -0
  151. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/gateway/gateway.py +0 -0
  152. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/gateway/impl/__init__.py +0 -0
  153. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/gateway/impl/common.py +0 -0
  154. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/gateway/impl/http_tunnel.py +0 -0
  155. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/gateway/impl/ssh_tunnel.py +0 -0
  156. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/gateway/impl/types.py +0 -0
  157. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/job/__init__.py +0 -0
  158. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/job/impl/__init__.py +0 -0
  159. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/job/impl/action.py +0 -0
  160. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/job/impl/common.py +0 -0
  161. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/job/impl/delay.py +0 -0
  162. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/job/impl/types.py +0 -0
  163. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/job/job.py +0 -0
  164. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/listener/__init__.py +0 -0
  165. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/listener/impl/__init__.py +0 -0
  166. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/listener/impl/common.py +0 -0
  167. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/listener/impl/http_callback.py +0 -0
  168. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/listener/impl/types.py +0 -0
  169. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/listener/listener.py +0 -0
  170. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/logger/__init__.py +0 -0
  171. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/logger/impl/__init__.py +0 -0
  172. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/logger/impl/common.py +0 -0
  173. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/logger/impl/console.py +0 -0
  174. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/logger/impl/file.py +0 -0
  175. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/logger/impl/types.py +0 -0
  176. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/logger/logger.py +0 -0
  177. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/runtime/__init__.py +0 -0
  178. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/runtime/impl/__init__.py +0 -0
  179. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/runtime/impl/common.py +0 -0
  180. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/runtime/impl/docker.py +0 -0
  181. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/runtime/impl/types.py +0 -0
  182. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/runtime/runtime.py +0 -0
  183. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/schema/workflow.py +0 -0
  184. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/utils/__init__.py +0 -0
  185. {model_compose-0.2.11 → model_compose-0.2.12}/src/mindor/dsl/utils/annotation.py +0 -0
  186. {model_compose-0.2.11 → model_compose-0.2.12}/src/model_compose.egg-info/dependency_links.txt +0 -0
  187. {model_compose-0.2.11 → model_compose-0.2.12}/src/model_compose.egg-info/entry_points.txt +0 -0
  188. {model_compose-0.2.11 → model_compose-0.2.12}/src/model_compose.egg-info/top_level.txt +0 -0
  189. {model_compose-0.2.11 → model_compose-0.2.12}/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.11
3
+ Version: 0.2.12
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
@@ -20,7 +20,7 @@ Requires-Dist: pyngrok
20
20
  Requires-Dist: ulid
21
21
  Requires-Dist: gradio
22
22
  Requires-Dist: Pillow
23
- Requires-Dist: transformers
23
+ Requires-Dist: transformers>=4.21.0
24
24
  Requires-Dist: torch
25
25
  Requires-Dist: sentencepiece
26
26
  Requires-Dist: accelerate
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "model-compose"
3
- version = "0.2.11"
3
+ version = "0.2.12"
4
4
  description = "model-compose: Declarative AI Model and Workflow Orchestrator"
5
5
  authors = [
6
6
  { name = "Hanyeol Cho", email = "hanyeol.cho@gmail.com" }
@@ -21,7 +21,7 @@ dependencies = [
21
21
  "ulid",
22
22
  "gradio",
23
23
  "Pillow",
24
- "transformers",
24
+ "transformers>=4.21.0",
25
25
  "torch",
26
26
  "sentencepiece",
27
27
  "accelerate"
@@ -1,4 +1,5 @@
1
1
  from .text_generation import *
2
2
  from .summarization import *
3
3
  from .translation import *
4
+ from .text_classification import *
4
5
  from .text_embedding import *
@@ -16,7 +16,6 @@ class SummarizationTaskAction:
16
16
  async def run(self, context: ComponentActionContext) -> Any:
17
17
  text: Union[str, List[str]] = await context.render_variable(self.config.text)
18
18
 
19
- # Model parameters
20
19
  max_input_length = await context.render_variable(self.config.params.max_input_length)
21
20
  max_output_length = await context.render_variable(self.config.params.max_output_length)
22
21
  min_output_length = await context.render_variable(self.config.params.min_output_length)
@@ -24,28 +23,32 @@ class SummarizationTaskAction:
24
23
  length_penalty = await context.render_variable(self.config.params.length_penalty)
25
24
  early_stopping = await context.render_variable(self.config.params.early_stopping)
26
25
  do_sample = await context.render_variable(self.config.params.do_sample)
26
+ batch_size = await context.render_variable(self.config.params.batch_size)
27
27
 
28
- # Tokenizing
29
- inputs = self.tokenizer(text, return_tensors="pt", max_length=max_input_length, padding=True, truncation=True).to(self.model.device)
28
+ texts: List[str] = [ text ] if isinstance(text, str) else text
29
+ results = []
30
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
- )
31
+ for index in range(0, len(texts), batch_size):
32
+ batch_texts = texts[index:index + batch_size]
33
+ inputs = self.tokenizer(batch_texts, return_tensors="pt", max_length=max_input_length, padding=True, truncation=True).to(self.model.device)
44
34
 
45
- # Decoding output
46
- outputs = self.tokenizer.batch_decode(outputs, skip_special_tokens=True)
35
+ with torch.no_grad():
36
+ outputs = self.model.generate(
37
+ **inputs,
38
+ max_length=max_output_length,
39
+ min_length=min_output_length,
40
+ num_beams=num_beams,
41
+ length_penalty=length_penalty,
42
+ early_stopping=early_stopping,
43
+ do_sample=do_sample,
44
+ pad_token_id=getattr(self.tokenizer, "pad_token_id", None),
45
+ eos_token_id=getattr(self.tokenizer, "eos_token_id", None)
46
+ )
47
+
48
+ outputs = self.tokenizer.batch_decode(outputs, skip_special_tokens=True)
49
+ results.extend(outputs)
47
50
 
48
- result = outputs if isinstance(text, list) else outputs[0]
51
+ result = results if len(results) > 1 else results[0]
49
52
  context.register_source("result", result)
50
53
 
51
54
  return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
@@ -0,0 +1,78 @@
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, TextClassificationModelActionConfig
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 AutoModelForSequenceClassification, AutoTokenizer, PreTrainedModel, PreTrainedTokenizer
8
+ from transformers.modeling_outputs import SequenceClassifierOutput
9
+ import torch.nn.functional as F
10
+ import torch
11
+
12
+ class TextClassificationTaskAction:
13
+ def __init__(self, config: TextClassificationModelActionConfig, model: PreTrainedModel, tokenizer: PreTrainedTokenizer):
14
+ self.config: TextClassificationModelActionConfig = config
15
+ self.model: PreTrainedModel = model
16
+ self.tokenizer: PreTrainedTokenizer = tokenizer
17
+
18
+ async def run(self, context: ComponentActionContext, labels: Optional[List[str]]) -> Any:
19
+ text: Union[str, List[str]] = await context.render_variable(self.config.text)
20
+
21
+ return_probabilities = await context.render_variable(self.config.params.return_probabilities)
22
+ batch_size = await context.render_variable(self.config.params.batch_size)
23
+
24
+ texts: List[str] = [ text ] if isinstance(text, str) else text
25
+ results = []
26
+
27
+ for index in range(0, len(texts), batch_size):
28
+ batch_texts = texts[index:index + batch_size]
29
+ inputs = self.tokenizer(batch_texts, return_tensors="pt", padding=True, truncation=True).to(self.model.device)
30
+
31
+ with torch.no_grad():
32
+ outputs: SequenceClassifierOutput = self.model(**inputs)
33
+ logits = outputs.logits # shape: (batch_size, num_classes)
34
+
35
+ predicted = []
36
+ if return_probabilities:
37
+ probs = F.softmax(logits, dim=-1).cpu()
38
+ for prob in probs:
39
+ predicted_index = torch.argmax(prob).item()
40
+ predicted.append({
41
+ "label": labels[predicted_index] if labels else predicted_index,
42
+ "probabilities": prob.tolist()
43
+ })
44
+ else:
45
+ predicted_indices = torch.argmax(logits, dim=-1).tolist()
46
+ for predicted_index in predicted_indices:
47
+ predicted.append(labels[predicted_index] if labels else predicted_index)
48
+
49
+ results.extend(predicted)
50
+
51
+ result = results if len(results) > 1 else results[0]
52
+ context.register_source("result", result)
53
+
54
+ return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
55
+
56
+ @register_model_task_service(ModelTaskType.TEXT_CLASSIFICATION)
57
+ class TextClassificationTaskService(ModelTaskService):
58
+ def __init__(self, id: str, config: ModelComponentConfig, daemon: bool):
59
+ super().__init__(id, config, daemon)
60
+
61
+ self.model: Optional[PreTrainedModel] = None
62
+ self.tokenizer: Optional[PreTrainedTokenizer] = None
63
+
64
+ async def _serve(self) -> None:
65
+ try:
66
+ self.model = AutoModelForSequenceClassification.from_pretrained(self.config.model).to(torch.device(self.config.device))
67
+ self.tokenizer = AutoTokenizer.from_pretrained(self.config.model, use_fast=self.config.fast_tokenizer)
68
+ logging.info(f"Model and tokenizer loaded successfully on device '{self.config.device}': {self.config.model}")
69
+ except Exception as e:
70
+ logging.error(f"Failed to load model '{self.config.model}': {e}")
71
+ raise
72
+
73
+ async def _shutdown(self) -> None:
74
+ self.model = None
75
+ self.tokenizer = None
76
+
77
+ async def _run(self, action: ModelActionConfig, context: ComponentActionContext) -> Any:
78
+ return await TextClassificationTaskAction(action, self.model, self.tokenizer).run(context, self.config.labels)
@@ -16,29 +16,33 @@ class TextEmbeddingTaskAction:
16
16
  self.tokenizer: PreTrainedTokenizer = tokenizer
17
17
 
18
18
  async def run(self, context: ComponentActionContext) -> Any:
19
- text = await context.render_variable(self.config.text)
19
+ text: Union[str, List[str]] = await context.render_variable(self.config.text)
20
20
 
21
- # Model parameters
22
21
  max_input_length = await context.render_variable(self.config.params.max_input_length)
23
22
  pooling = await context.render_variable(self.config.params.pooling)
24
23
  normalize = await context.render_variable(self.config.params.normalize)
24
+ batch_size = await context.render_variable(self.config.params.batch_size)
25
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
- attention_mask: Tensor = inputs.get("attention_mask", None)
26
+ texts: List[str] = [ text ] if isinstance(text, str) else text
27
+ results = []
29
28
 
30
- # Forward pass through the model
31
- with torch.no_grad():
32
- outputs: BaseModelOutput = self.model(**inputs)
33
- last_hidden_state = outputs.last_hidden_state # (batch_size, seq_len, hidden_size)
29
+ for index in range(0, len(texts), batch_size):
30
+ batch_texts = texts[index:index + batch_size]
31
+ inputs = self.tokenizer(batch_texts, return_tensors="pt", max_length=max_input_length, padding=True, truncation=True).to(self.model.device)
32
+ attention_mask: Tensor = inputs.get("attention_mask", None)
34
33
 
35
- # Apply pooling strategy (mean, cls, max)
36
- embedding = self._pool_hidden_state(last_hidden_state, attention_mask, pooling)
34
+ with torch.no_grad():
35
+ outputs: BaseModelOutput = self.model(**inputs)
36
+ last_hidden_state = outputs.last_hidden_state # (batch_size, seq_len, hidden_size)
37
37
 
38
- if normalize:
39
- embedding = torch.nn.functional.normalize(embedding, p=2, dim=1)
38
+ embeddings = self._pool_hidden_state(last_hidden_state, attention_mask, pooling)
40
39
 
41
- result = embedding.squeeze().tolist()
40
+ if normalize:
41
+ embeddings = torch.nn.functional.normalize(embeddings, p=2, dim=1)
42
+
43
+ results.extend(embeddings.cpu().tolist())
44
+
45
+ result = results if len(results) > 1 else results[0]
42
46
  context.register_source("result", result)
43
47
 
44
48
  return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
@@ -16,32 +16,35 @@ class TextGenerationTaskAction:
16
16
  async def run(self, context: ComponentActionContext) -> Any:
17
17
  prompt: Union[str, List[str]] = await context.render_variable(self.config.prompt)
18
18
 
19
- # Model parameters
20
19
  max_output_length = await context.render_variable(self.config.params.max_output_length)
21
20
  num_return_sequences = await context.render_variable(self.config.params.num_return_sequences)
22
21
  temperature = await context.render_variable(self.config.params.temperature)
23
22
  top_k = await context.render_variable(self.config.params.top_k)
24
23
  top_p = await context.render_variable(self.config.params.top_p)
24
+ batch_size = await context.render_variable(self.config.params.batch_size)
25
25
 
26
- # Tokenizing
27
- inputs = self.tokenizer(prompt, return_tensors="pt").to(self.model.device)
26
+ prompts: List[str] = [ prompt ] if isinstance(prompt, str) else prompt
27
+ results = []
28
28
 
29
- # Text generation
30
- with torch.no_grad():
31
- outputs = self.model.generate(
32
- **inputs,
33
- max_length=max_output_length,
34
- num_return_sequences=num_return_sequences,
35
- temperature=temperature,
36
- top_k=top_k,
37
- top_p=top_p,
38
- do_sample=True
39
- )
29
+ for index in range(0, len(prompts), batch_size):
30
+ batch_prompts = prompts[index:index + batch_size]
31
+ inputs = self.tokenizer(batch_prompts, return_tensors="pt").to(self.model.device)
40
32
 
41
- # Decoding output
42
- outputs = self.tokenizer.batch_decode(outputs, skip_special_tokens=True)
43
-
44
- result = outputs if isinstance(prompt, list) else outputs[0]
33
+ with torch.no_grad():
34
+ outputs = self.model.generate(
35
+ **inputs,
36
+ max_new_tokens=max_output_length,
37
+ num_return_sequences=num_return_sequences,
38
+ temperature=temperature,
39
+ top_k=top_k,
40
+ top_p=top_p,
41
+ do_sample=True
42
+ )
43
+
44
+ outputs = self.tokenizer.batch_decode(outputs, skip_special_tokens=True)
45
+ results.extend(outputs)
46
+
47
+ result = results if len(results) > 1 else results[0]
45
48
  context.register_source("result", result)
46
49
 
47
50
  return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
@@ -16,33 +16,36 @@ class TranslationTaskAction:
16
16
  async def run(self, context: ComponentActionContext) -> Any:
17
17
  text: Union[str, List[str]] = await context.render_variable(self.config.text)
18
18
 
19
- # Model parameters
20
19
  max_input_length = await context.render_variable(self.config.params.max_input_length)
21
20
  max_output_length = await context.render_variable(self.config.params.max_output_length)
22
21
  min_output_length = await context.render_variable(self.config.params.min_output_length)
23
22
  num_beams = await context.render_variable(self.config.params.num_beams)
24
23
  length_penalty = await context.render_variable(self.config.params.length_penalty)
24
+ batch_size = await context.render_variable(self.config.params.batch_size)
25
25
 
26
- # Tokenizing
27
- inputs = self.tokenizer(text, return_tensors="pt", max_length=max_input_length, padding=True, truncation=True).to(self.model.device)
26
+ texts: List[str] = [ text ] if isinstance(text, str) else text
27
+ results = []
28
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
- )
29
+ for index in range(0, len(texts), batch_size):
30
+ batch_texts = texts[index:index + batch_size]
31
+ inputs = self.tokenizer(batch_texts, return_tensors="pt", max_length=max_input_length, padding=True, truncation=True).to(self.model.device)
41
32
 
42
- # Decoding output
43
- outputs = self.tokenizer.batch_decode(outputs, skip_special_tokens=True)
33
+ with torch.no_grad():
34
+ outputs = self.model.generate(
35
+ **inputs,
36
+ max_length=max_output_length,
37
+ min_length=min_output_length,
38
+ num_beams=num_beams,
39
+ length_penalty=length_penalty,
40
+ do_sample=False,
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
+ outputs = self.tokenizer.batch_decode(outputs, skip_special_tokens=True)
46
+ results.extend(outputs)
44
47
 
45
- result = outputs if isinstance(text, list) else outputs[0]
48
+ result = results if len(results) > 1 else results[0]
46
49
  context.register_source("result", result)
47
50
 
48
51
  return (await context.render_variable(self.config.output, ignore_files=True)) if self.config.output else result
@@ -2,4 +2,5 @@ from .common import *
2
2
  from .text_generation import *
3
3
  from .summarization import *
4
4
  from .translation import *
5
+ from .text_classification import *
5
6
  from .text_embedding import *
@@ -0,0 +1,18 @@
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: Union[int, str] = Field(default=1024, description="Maximum number of tokens per input text.")
8
+ max_output_length: Union[int, str] = Field(default=256, description="The maximum number of tokens to generate.")
9
+ min_output_length: Union[int, str] = Field(default=30, description="The minimum number of tokens to generate.")
10
+ num_beams: Union[int, str] = Field(default=4, description="Number of beams to use for beam search.")
11
+ length_penalty: Union[float, str] = Field(default=2.0, description="Length penalty applied during beam search.")
12
+ early_stopping: bool = Field(default=True, description="Whether to stop the beam search when all beams finish generating.")
13
+ do_sample: bool = Field(default=True, description="Whether to use sampling.")
14
+ batch_size: Union[int, str] = Field(default=32, description="Number of input texts to process in a single batch.")
15
+
16
+ class SummarizationModelActionConfig(CommonModelActionConfig):
17
+ text: Union[str, List[str]] = Field(..., description="Input text to summarize.")
18
+ params: SummarizationParamsConfig = Field(default_factory=SummarizationParamsConfig, description="Summarization configuration parameters.")
@@ -0,0 +1,12 @@
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 TextClassificationParamsConfig(BaseModel):
7
+ return_probabilities: Union[bool, str] = Field(default=False, description="Whether to return class probabilities for each prediction.")
8
+ batch_size: Union[int, str] = Field(default=32, description="Number of input texts to process in a single batch.")
9
+
10
+ class TextClassificationModelActionConfig(CommonModelActionConfig):
11
+ text: Union[str, List[str]] = Field(..., description="Input text to classify.")
12
+ params: TextClassificationParamsConfig = Field(default_factory=TextClassificationParamsConfig, description="Text classification configuration parameters.")
@@ -4,11 +4,11 @@ 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
+ max_input_length: Union[int, str] = Field(default=512, description="Maximum number of tokens per input text.")
8
8
  pooling: Literal[ "mean", "cls", "max" ] = Field(default="mean", description="Pooling strategy used to aggregate token embeddings.")
9
- normalize: bool = Field(default=True, description="Whether to apply L2 normalization to the output embeddings.")
10
- batch_size: int = Field(default=1, description="Number of input texts to process in a single batch.")
9
+ normalize: Union[bool, str] = Field(default=True, description="Whether to apply L2 normalization to the output embeddings.")
10
+ batch_size: Union[int, str] = Field(default=32, description="Number of input texts to process in a single batch.")
11
11
 
12
12
  class TextEmbeddingModelActionConfig(CommonModelActionConfig):
13
- text: str = Field(..., description="Input text to be embedded.")
13
+ text: Union[str, List[str]] = Field(..., description="Input text to be embedded.")
14
14
  params: TextEmbeddingParamsConfig = Field(default_factory=TextEmbeddingParamsConfig, description="Configuration parameters for embedding generation.")
@@ -0,0 +1,16 @@
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: Union[int, str] = Field(default=1024, description="The maximum number of tokens to generate.")
8
+ num_return_sequences: Union[int, str] = Field(default=1, description="The number of generated sequences to return.")
9
+ temperature: Union[float, str] = Field(default=1.0, description="Sampling temperature; higher values produce more random results.")
10
+ top_k: Union[int, str] = Field(default=50, description="Top-K sampling; restricts sampling to the top K tokens.")
11
+ top_p: Union[int, str] = Field(default=0.9, description="Top-p (nucleus) sampling; restricts sampling to tokens with cumulative probability >= top_p.")
12
+ batch_size: Union[int, str] = Field(default=32, description="Number of input texts to process in a single batch.")
13
+
14
+ class TextGenerationModelActionConfig(CommonModelActionConfig):
15
+ prompt: Union[str, List[str]] = Field(..., description="Input prompt to generate text from.")
16
+ params: TextGenerationParamsConfig = Field(default_factory=TextGenerationParamsConfig, description="Text generation configuration parameters.")
@@ -0,0 +1,16 @@
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: Union[int, str] = Field(default=1024, description="Maximum number of tokens per input text.")
8
+ max_output_length: Union[int, str] = Field(default=256, description="The maximum number of tokens to generate.")
9
+ min_output_length: Union[int, str] = Field(default=10, description="The minimum number of tokens to generate.")
10
+ num_beams: Union[int, str] = Field(default=4, description="Number of beams to use for beam search.")
11
+ length_penalty: Union[float, str] = Field(default=1.0, description="Length penalty applied during beam search.")
12
+ batch_size: Union[int, str] = Field(default=32, description="Number of input texts to process in a single batch.")
13
+
14
+ class TranslationModelActionConfig(CommonModelActionConfig):
15
+ text: Union[str, List[str]] = Field(..., description="Input text to translate.")
16
+ params: TranslationParamsConfig = Field(default_factory=TranslationParamsConfig, description="Translation configuration parameters.")
@@ -6,5 +6,6 @@ ModelActionConfig = Union[
6
6
  TextGenerationModelActionConfig,
7
7
  SummarizationModelActionConfig,
8
8
  TranslationModelActionConfig,
9
+ TextClassificationModelActionConfig,
9
10
  TextEmbeddingModelActionConfig,
10
11
  ]
@@ -2,4 +2,5 @@ from .common import *
2
2
  from .text_generation import *
3
3
  from .summarization import *
4
4
  from .translation import *
5
+ from .text_classification import *
5
6
  from .text_embedding import *
@@ -21,3 +21,6 @@ class CommonModelComponentConfig(CommonComponentConfig):
21
21
  if any(k in values for k in action_keys):
22
22
  values["actions"] = { "__default__": { k: values.pop(k) for k in action_keys if k in values } }
23
23
  return values
24
+
25
+ class ClassificationModelComponentConfig(CommonModelComponentConfig):
26
+ labels: Optional[List[str]] = Field(default=None, description="List of class labels for classification tasks.")
@@ -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 TextClassificationModelActionConfig
5
+ from .common import ClassificationModelComponentConfig, ModelTaskType
6
+
7
+ class TextClassificationModelComponentConfig(ClassificationModelComponentConfig):
8
+ task: Literal[ModelTaskType.TEXT_CLASSIFICATION]
9
+ actions: Dict[str, TextClassificationModelActionConfig] = Field(default_factory=dict, description="")
@@ -0,0 +1,8 @@
1
+ from enum import Enum
2
+
3
+ class ModelTaskType(str, Enum):
4
+ TEXT_GENERATION = "text-generation"
5
+ SUMMARIZATION = "summarization"
6
+ TRANSLATION = "translation"
7
+ TEXT_CLASSIFICATION = "text-classification"
8
+ TEXT_EMBEDDING = "text-embedding"
@@ -7,6 +7,7 @@ ModelComponentConfig = Annotated[
7
7
  TextGenerationModelComponentConfig,
8
8
  SummarizationModelComponentConfig,
9
9
  TranslationModelComponentConfig,
10
+ TextClassificationModelComponentConfig,
10
11
  TextEmbeddingModelComponentConfig,
11
12
  ],
12
13
  Field(discriminator="task")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: model-compose
3
- Version: 0.2.11
3
+ Version: 0.2.12
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
@@ -20,7 +20,7 @@ Requires-Dist: pyngrok
20
20
  Requires-Dist: ulid
21
21
  Requires-Dist: gradio
22
22
  Requires-Dist: Pillow
23
- Requires-Dist: transformers
23
+ Requires-Dist: transformers>=4.21.0
24
24
  Requires-Dist: torch
25
25
  Requires-Dist: sentencepiece
26
26
  Requires-Dist: accelerate
@@ -21,6 +21,7 @@ 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
23
  src/mindor/core/component/services/model/tasks/summarization.py
24
+ src/mindor/core/component/services/model/tasks/text_classification.py
24
25
  src/mindor/core/component/services/model/tasks/text_embedding.py
25
26
  src/mindor/core/component/services/model/tasks/text_generation.py
26
27
  src/mindor/core/component/services/model/tasks/translation.py
@@ -105,6 +106,7 @@ src/mindor/dsl/schema/action/impl/model/model.py
105
106
  src/mindor/dsl/schema/action/impl/model/impl/__init__.py
106
107
  src/mindor/dsl/schema/action/impl/model/impl/common.py
107
108
  src/mindor/dsl/schema/action/impl/model/impl/summarization.py
109
+ src/mindor/dsl/schema/action/impl/model/impl/text_classification.py
108
110
  src/mindor/dsl/schema/action/impl/model/impl/text_embedding.py
109
111
  src/mindor/dsl/schema/action/impl/model/impl/text_generation.py
110
112
  src/mindor/dsl/schema/action/impl/model/impl/translation.py
@@ -124,6 +126,7 @@ src/mindor/dsl/schema/component/impl/model/model.py
124
126
  src/mindor/dsl/schema/component/impl/model/impl/__init__.py
125
127
  src/mindor/dsl/schema/component/impl/model/impl/common.py
126
128
  src/mindor/dsl/schema/component/impl/model/impl/summarization.py
129
+ src/mindor/dsl/schema/component/impl/model/impl/text_classification.py
127
130
  src/mindor/dsl/schema/component/impl/model/impl/text_embedding.py
128
131
  src/mindor/dsl/schema/component/impl/model/impl/text_generation.py
129
132
  src/mindor/dsl/schema/component/impl/model/impl/translation.py
@@ -11,7 +11,7 @@ pyngrok
11
11
  ulid
12
12
  gradio
13
13
  Pillow
14
- transformers
14
+ transformers>=4.21.0
15
15
  torch
16
16
  sentencepiece
17
17
  accelerate
@@ -1,17 +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 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.")
@@ -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_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.")
@@ -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 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.")
@@ -1,7 +0,0 @@
1
- from enum import Enum
2
-
3
- class ModelTaskType(str, Enum):
4
- TEXT_GENERATION = "text-generation"
5
- SUMMARIZATION = "summarization"
6
- TRANSLATION = "translation"
7
- TEXT_EMBEDDING = "text-embedding"
File without changes
File without changes
File without changes