clarifai 11.0.6rc4__py3-none-any.whl → 11.0.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. clarifai/__init__.py +1 -1
  2. clarifai/cli/__main__.py +4 -0
  3. clarifai/cli/base.py +2 -1
  4. clarifai/cli/model.py +10 -2
  5. clarifai/runners/dockerfile_template/Dockerfile.template +25 -11
  6. clarifai/runners/models/model_run_locally.py +48 -18
  7. clarifai/runners/models/model_upload.py +51 -27
  8. clarifai/runners/utils/const.py +4 -18
  9. clarifai/runners/utils/loader.py +5 -3
  10. clarifai/utils/cli.py +1 -1
  11. clarifai/utils/logging.py +1 -1
  12. {clarifai-11.0.6rc4.dist-info → clarifai-11.0.7.dist-info}/METADATA +25 -16
  13. clarifai-11.0.7.dist-info/RECORD +101 -0
  14. {clarifai-11.0.6rc4.dist-info → clarifai-11.0.7.dist-info}/WHEEL +1 -1
  15. clarifai/__pycache__/__init__.cpython-310.pyc +0 -0
  16. clarifai/__pycache__/errors.cpython-310.pyc +0 -0
  17. clarifai/__pycache__/versions.cpython-310.pyc +0 -0
  18. clarifai/cli/__pycache__/__init__.cpython-310.pyc +0 -0
  19. clarifai/cli/__pycache__/base.cpython-310.pyc +0 -0
  20. clarifai/cli/__pycache__/compute_cluster.cpython-310.pyc +0 -0
  21. clarifai/cli/__pycache__/deployment.cpython-310.pyc +0 -0
  22. clarifai/cli/__pycache__/model.cpython-310.pyc +0 -0
  23. clarifai/cli/__pycache__/nodepool.cpython-310.pyc +0 -0
  24. clarifai/client/__pycache__/__init__.cpython-310.pyc +0 -0
  25. clarifai/client/__pycache__/app.cpython-310.pyc +0 -0
  26. clarifai/client/__pycache__/base.cpython-310.pyc +0 -0
  27. clarifai/client/__pycache__/dataset.cpython-310.pyc +0 -0
  28. clarifai/client/__pycache__/input.cpython-310.pyc +0 -0
  29. clarifai/client/__pycache__/lister.cpython-310.pyc +0 -0
  30. clarifai/client/__pycache__/model.cpython-310.pyc +0 -0
  31. clarifai/client/__pycache__/module.cpython-310.pyc +0 -0
  32. clarifai/client/__pycache__/runner.cpython-310.pyc +0 -0
  33. clarifai/client/__pycache__/search.cpython-310.pyc +0 -0
  34. clarifai/client/__pycache__/user.cpython-310.pyc +0 -0
  35. clarifai/client/__pycache__/workflow.cpython-310.pyc +0 -0
  36. clarifai/client/auth/__pycache__/__init__.cpython-310.pyc +0 -0
  37. clarifai/client/auth/__pycache__/helper.cpython-310.pyc +0 -0
  38. clarifai/client/auth/__pycache__/register.cpython-310.pyc +0 -0
  39. clarifai/client/auth/__pycache__/stub.cpython-310.pyc +0 -0
  40. clarifai/constants/__pycache__/dataset.cpython-310.pyc +0 -0
  41. clarifai/constants/__pycache__/model.cpython-310.pyc +0 -0
  42. clarifai/constants/__pycache__/search.cpython-310.pyc +0 -0
  43. clarifai/datasets/__pycache__/__init__.cpython-310.pyc +0 -0
  44. clarifai/datasets/export/__pycache__/__init__.cpython-310.pyc +0 -0
  45. clarifai/datasets/export/__pycache__/inputs_annotations.cpython-310.pyc +0 -0
  46. clarifai/datasets/upload/__pycache__/__init__.cpython-310.pyc +0 -0
  47. clarifai/datasets/upload/__pycache__/base.cpython-310.pyc +0 -0
  48. clarifai/datasets/upload/__pycache__/features.cpython-310.pyc +0 -0
  49. clarifai/datasets/upload/__pycache__/image.cpython-310.pyc +0 -0
  50. clarifai/datasets/upload/__pycache__/text.cpython-310.pyc +0 -0
  51. clarifai/datasets/upload/__pycache__/utils.cpython-310.pyc +0 -0
  52. clarifai/models/__pycache__/__init__.cpython-310.pyc +0 -0
  53. clarifai/models/model_serving/README.md +0 -158
  54. clarifai/models/model_serving/__init__.py +0 -14
  55. clarifai/models/model_serving/__pycache__/__init__.cpython-310.pyc +0 -0
  56. clarifai/models/model_serving/__pycache__/constants.cpython-310.pyc +0 -0
  57. clarifai/models/model_serving/cli/__init__.py +0 -12
  58. clarifai/models/model_serving/cli/__pycache__/__init__.cpython-310.pyc +0 -0
  59. clarifai/models/model_serving/cli/__pycache__/_utils.cpython-310.pyc +0 -0
  60. clarifai/models/model_serving/cli/__pycache__/base.cpython-310.pyc +0 -0
  61. clarifai/models/model_serving/cli/__pycache__/build.cpython-310.pyc +0 -0
  62. clarifai/models/model_serving/cli/__pycache__/create.cpython-310.pyc +0 -0
  63. clarifai/models/model_serving/cli/_utils.py +0 -53
  64. clarifai/models/model_serving/cli/base.py +0 -14
  65. clarifai/models/model_serving/cli/build.py +0 -79
  66. clarifai/models/model_serving/cli/clarifai_clis.py +0 -33
  67. clarifai/models/model_serving/cli/create.py +0 -171
  68. clarifai/models/model_serving/cli/example_cli.py +0 -34
  69. clarifai/models/model_serving/cli/login.py +0 -26
  70. clarifai/models/model_serving/cli/upload.py +0 -183
  71. clarifai/models/model_serving/constants.py +0 -21
  72. clarifai/models/model_serving/docs/cli.md +0 -161
  73. clarifai/models/model_serving/docs/concepts.md +0 -229
  74. clarifai/models/model_serving/docs/dependencies.md +0 -11
  75. clarifai/models/model_serving/docs/inference_parameters.md +0 -139
  76. clarifai/models/model_serving/docs/model_types.md +0 -19
  77. clarifai/models/model_serving/model_config/__init__.py +0 -16
  78. clarifai/models/model_serving/model_config/__pycache__/__init__.cpython-310.pyc +0 -0
  79. clarifai/models/model_serving/model_config/__pycache__/base.cpython-310.pyc +0 -0
  80. clarifai/models/model_serving/model_config/__pycache__/config.cpython-310.pyc +0 -0
  81. clarifai/models/model_serving/model_config/__pycache__/inference_parameter.cpython-310.pyc +0 -0
  82. clarifai/models/model_serving/model_config/__pycache__/output.cpython-310.pyc +0 -0
  83. clarifai/models/model_serving/model_config/base.py +0 -369
  84. clarifai/models/model_serving/model_config/config.py +0 -312
  85. clarifai/models/model_serving/model_config/inference_parameter.py +0 -129
  86. clarifai/models/model_serving/model_config/model_types_config/multimodal-embedder.yaml +0 -25
  87. clarifai/models/model_serving/model_config/model_types_config/text-classifier.yaml +0 -19
  88. clarifai/models/model_serving/model_config/model_types_config/text-embedder.yaml +0 -20
  89. clarifai/models/model_serving/model_config/model_types_config/text-to-image.yaml +0 -19
  90. clarifai/models/model_serving/model_config/model_types_config/text-to-text.yaml +0 -19
  91. clarifai/models/model_serving/model_config/model_types_config/visual-classifier.yaml +0 -22
  92. clarifai/models/model_serving/model_config/model_types_config/visual-detector.yaml +0 -32
  93. clarifai/models/model_serving/model_config/model_types_config/visual-embedder.yaml +0 -19
  94. clarifai/models/model_serving/model_config/model_types_config/visual-segmenter.yaml +0 -19
  95. clarifai/models/model_serving/model_config/output.py +0 -133
  96. clarifai/models/model_serving/model_config/triton/__init__.py +0 -14
  97. clarifai/models/model_serving/model_config/triton/__pycache__/__init__.cpython-310.pyc +0 -0
  98. clarifai/models/model_serving/model_config/triton/__pycache__/serializer.cpython-310.pyc +0 -0
  99. clarifai/models/model_serving/model_config/triton/__pycache__/triton_config.cpython-310.pyc +0 -0
  100. clarifai/models/model_serving/model_config/triton/__pycache__/wrappers.cpython-310.pyc +0 -0
  101. clarifai/models/model_serving/model_config/triton/serializer.py +0 -136
  102. clarifai/models/model_serving/model_config/triton/triton_config.py +0 -182
  103. clarifai/models/model_serving/model_config/triton/wrappers.py +0 -281
  104. clarifai/models/model_serving/repo_build/__init__.py +0 -14
  105. clarifai/models/model_serving/repo_build/__pycache__/__init__.cpython-310.pyc +0 -0
  106. clarifai/models/model_serving/repo_build/__pycache__/build.cpython-310.pyc +0 -0
  107. clarifai/models/model_serving/repo_build/build.py +0 -198
  108. clarifai/models/model_serving/repo_build/static_files/__pycache__/base_test.cpython-310-pytest-7.2.0.pyc +0 -0
  109. clarifai/models/model_serving/repo_build/static_files/_requirements.txt +0 -2
  110. clarifai/models/model_serving/repo_build/static_files/base_test.py +0 -169
  111. clarifai/models/model_serving/repo_build/static_files/inference.py +0 -26
  112. clarifai/models/model_serving/repo_build/static_files/sample_clarifai_config.yaml +0 -25
  113. clarifai/models/model_serving/repo_build/static_files/test.py +0 -40
  114. clarifai/models/model_serving/repo_build/static_files/triton/model.py +0 -75
  115. clarifai/models/model_serving/utils.py +0 -31
  116. clarifai/rag/__pycache__/__init__.cpython-310.pyc +0 -0
  117. clarifai/rag/__pycache__/rag.cpython-310.pyc +0 -0
  118. clarifai/rag/__pycache__/utils.cpython-310.pyc +0 -0
  119. clarifai/runners/__pycache__/__init__.cpython-310.pyc +0 -0
  120. clarifai/runners/__pycache__/server.cpython-310.pyc +0 -0
  121. clarifai/runners/deepgram_live_transcribe.py +0 -98
  122. clarifai/runners/deepgram_live_transcribe.py~ +0 -98
  123. clarifai/runners/deepgram_runner.py +0 -131
  124. clarifai/runners/deepgram_runner.py~ +0 -130
  125. clarifai/runners/dockerfile_template/Dockerfile.cpu.template +0 -31
  126. clarifai/runners/dockerfile_template/Dockerfile.cuda.template +0 -79
  127. clarifai/runners/example_llama2.py~ +0 -72
  128. clarifai/runners/matt_example.py +0 -89
  129. clarifai/runners/matt_example.py~ +0 -87
  130. clarifai/runners/matt_llm_example.py +0 -129
  131. clarifai/runners/matt_llm_example.py~ +0 -128
  132. clarifai/runners/models/__pycache__/__init__.cpython-310.pyc +0 -0
  133. clarifai/runners/models/__pycache__/base_typed_model.cpython-310.pyc +0 -0
  134. clarifai/runners/models/__pycache__/model_class.cpython-310.pyc +0 -0
  135. clarifai/runners/models/__pycache__/model_run_locally.cpython-310.pyc +0 -0
  136. clarifai/runners/models/__pycache__/model_runner.cpython-310.pyc +0 -0
  137. clarifai/runners/models/__pycache__/model_servicer.cpython-310.pyc +0 -0
  138. clarifai/runners/models/__pycache__/model_upload.cpython-310.pyc +0 -0
  139. clarifai/runners/utils/__pycache__/__init__.cpython-310.pyc +0 -0
  140. clarifai/runners/utils/__pycache__/const.cpython-310.pyc +0 -0
  141. clarifai/runners/utils/__pycache__/data_handler.cpython-310.pyc +0 -0
  142. clarifai/runners/utils/__pycache__/data_utils.cpython-310.pyc +0 -0
  143. clarifai/runners/utils/__pycache__/loader.cpython-310.pyc +0 -0
  144. clarifai/runners/utils/__pycache__/logging.cpython-310.pyc +0 -0
  145. clarifai/runners/utils/__pycache__/url_fetcher.cpython-310.pyc +0 -0
  146. clarifai/runners/utils/logging.py +0 -6
  147. clarifai/schema/__pycache__/search.cpython-310.pyc +0 -0
  148. clarifai/urls/__pycache__/helper.cpython-310.pyc +0 -0
  149. clarifai/utils/__pycache__/__init__.cpython-310.pyc +0 -0
  150. clarifai/utils/__pycache__/logging.cpython-310.pyc +0 -0
  151. clarifai/utils/__pycache__/misc.cpython-310.pyc +0 -0
  152. clarifai/utils/__pycache__/model_train.cpython-310.pyc +0 -0
  153. clarifai/workflows/__pycache__/__init__.cpython-310.pyc +0 -0
  154. clarifai/workflows/__pycache__/export.cpython-310.pyc +0 -0
  155. clarifai/workflows/__pycache__/utils.cpython-310.pyc +0 -0
  156. clarifai/workflows/__pycache__/validate.cpython-310.pyc +0 -0
  157. clarifai-11.0.6rc4.dist-info/RECORD +0 -242
  158. {clarifai-11.0.6rc4.dist-info → clarifai-11.0.7.dist-info}/LICENSE +0 -0
  159. {clarifai-11.0.6rc4.dist-info → clarifai-11.0.7.dist-info}/entry_points.txt +0 -0
  160. {clarifai-11.0.6rc4.dist-info → clarifai-11.0.7.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,101 @@
1
+ clarifai/__init__.py,sha256=8JL7fWb1PSPPSGGv255OT9dL70U1IeroOgz1jRXS3Jc,23
2
+ clarifai/cli.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ clarifai/errors.py,sha256=RwzTajwds51wLD0MVlMC5kcpBnzRpreDLlazPSBZxrg,2605
4
+ clarifai/versions.py,sha256=jctnczzfGk_S3EnVqb2FjRKfSREkNmvNEwAAa_VoKiQ,222
5
+ clarifai/cli/README.md,sha256=YGApHfeUyu5P0Pdth-mqQCQftWHDxz6bugDlvDXDhOE,1942
6
+ clarifai/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ clarifai/cli/__main__.py,sha256=utJ2F40cl0jPHcYdTlGZRqpPfZ0CtVYB-8Ft0b2fWD4,72
8
+ clarifai/cli/base.py,sha256=eaUsp7S1e2dslC437Hjk7gUBQsng13ID3N3lkYotB2U,3403
9
+ clarifai/cli/compute_cluster.py,sha256=N2dNQNJEPg9nxsb8x2igEzYuGRzjn7l4kNttjFIxmhI,1827
10
+ clarifai/cli/deployment.py,sha256=sUEuz5-rtozMx8deVcJXLi6lHsP2jc8x3y2MpUAVfqY,2506
11
+ clarifai/cli/model.py,sha256=96Rz6EFK2HaFMX6v0E7DqO9bVN1thqpRVfbsvnN1UIE,11217
12
+ clarifai/cli/nodepool.py,sha256=yihxS_rIFoBBKzRlqBX8Ab42iPpBMJrJFsk8saph6ms,3049
13
+ clarifai/client/__init__.py,sha256=xI1U0l5AZdRThvQAXCLsd9axxyFzXXJ22m8LHqVjQRU,662
14
+ clarifai/client/app.py,sha256=6pckYme1urV2YJjLIYfeZ-vH0Z5YSQa51jzIMcEfwug,38342
15
+ clarifai/client/base.py,sha256=hSHOqkXbSKyaRDeylMMnkhUHCAHhEqno4KI0CXGziBA,7536
16
+ clarifai/client/compute_cluster.py,sha256=EvW9TJjPvInUlggfg1A98sxoWH8_PY5rCVXZhsj6ac0,8705
17
+ clarifai/client/dataset.py,sha256=y3zKT_VhP1gyN3OO-b3cPeW21ZXyKbQ7ZJkEG06bsTU,32096
18
+ clarifai/client/deployment.py,sha256=w7Y6pA1rYG4KRK1SwusRZc2sQRXlG8wezuVdzSWpCo0,2586
19
+ clarifai/client/input.py,sha256=GvrPV2chThNjimekBIleuIr6AD10_wrfc-1Hm5C4NQ8,45648
20
+ clarifai/client/lister.py,sha256=03KGMvs5RVyYqxLsSrWhNc34I8kiF1Ph0NeyEwu7nMU,2082
21
+ clarifai/client/model.py,sha256=0HC22i8RCjkC2lwRKnokMR6eaSt9_XXbi1Oim4sZVk4,88620
22
+ clarifai/client/module.py,sha256=FTkm8s9m-EaTKN7g9MnLhGJ9eETUfKG7aWZ3o1RshYs,4204
23
+ clarifai/client/nodepool.py,sha256=la3vTFrO4LX8zm2eQ5jqf2L0-kQ63Dano8FibadoZbk,10152
24
+ clarifai/client/search.py,sha256=GaPWN6JmTQGZaCHr6U1yv0zqR6wKFl7i9IVLg2ul1CI,14254
25
+ clarifai/client/user.py,sha256=WOv66ww2wx9isIge3V-xTHCkqC6akl2jEGAxzT_Ugfs,17642
26
+ clarifai/client/workflow.py,sha256=BOmA1ilHxsw-yl_ZE1NOEshzV7owavnXTIG2UOD6PuA,12163
27
+ clarifai/client/auth/__init__.py,sha256=7EwR0NrozkAUwpUnCsqXvE_p0wqx_SelXlSpKShKJK0,136
28
+ clarifai/client/auth/helper.py,sha256=Ngw5IDkOWvnOz5YwViVk55z3mC52MyezLc0G3WxLqok,14643
29
+ clarifai/client/auth/register.py,sha256=2CMdBsoVLoTfjyksE6j7BM2tiEc73WKYvxnwDDgNn1k,536
30
+ clarifai/client/auth/stub.py,sha256=xy4-fV0W8keCgXld4eOVzFQEIKxOktNwtL5bLztReug,4940
31
+ clarifai/constants/base.py,sha256=ogmFSZYoF0YhGjHg5aiOc3MLqPr_poKAls6xaD0_C3U,89
32
+ clarifai/constants/dataset.py,sha256=vjK3IlgXu31HycuvjRSzEQSqhU6xfj5TIgo6IpyUWoc,609
33
+ clarifai/constants/input.py,sha256=WcHwToUVIK9ItAhDefaSohQHCLNeR55PSjZ0BFnoZ3U,28
34
+ clarifai/constants/model.py,sha256=Um1hLfMFlh5R_vtP3Z6P-o6zon-tdbLcKVIl4PucrV4,438
35
+ clarifai/constants/rag.py,sha256=WcHwToUVIK9ItAhDefaSohQHCLNeR55PSjZ0BFnoZ3U,28
36
+ clarifai/constants/search.py,sha256=yYEqTaFg-KdnpJE_Ytp-EPVHIIC395iNtZrpVlLIf4o,101
37
+ clarifai/constants/workflow.py,sha256=cECq1xdvf44MCdtK2AbkiuuwhyL-6OWZdQfYbsLKy_o,33
38
+ clarifai/datasets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
+ clarifai/datasets/export/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
+ clarifai/datasets/export/inputs_annotations.py,sha256=3AtUBrMIjw8H3ehDsJFYcBFoAZ1QKQo1hXTMsHh8f20,10159
41
+ clarifai/datasets/upload/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
+ clarifai/datasets/upload/base.py,sha256=UIc0ufyIBCrb83_sFpv21L8FshsX4nwsLYQkdlJfzD4,2357
43
+ clarifai/datasets/upload/features.py,sha256=GK69WvUYnks5G26Z5L5XSisBIZILLv7lYhS2y8BJCt0,2031
44
+ clarifai/datasets/upload/image.py,sha256=HlCsfEMu_C4GVecGSv52RUJ6laLW8H64Pfj_FQyX6qg,8580
45
+ clarifai/datasets/upload/multimodal.py,sha256=_NpNQak9KMn0NOiOr48MYnXL0GQZ1LXKhwdYF1HhrHs,2377
46
+ clarifai/datasets/upload/text.py,sha256=dpRMNz49EyKau0kwksEaNV6TLBUf5lSr7t5g3pG2byM,2298
47
+ clarifai/datasets/upload/utils.py,sha256=BerWhq40ZUN30z6VImlc93eZtT-1vI18AMgSOuNzJEM,9647
48
+ clarifai/datasets/upload/loaders/README.md,sha256=aNRutSCTzLp2ruIZx74ZkN5AxpzwKOxMa7OzabnKpwg,2980
49
+ clarifai/datasets/upload/loaders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
+ clarifai/datasets/upload/loaders/coco_captions.py,sha256=YfuNXplbdoH8N9ph7RyN9MfJTtOcJBG4ie1ow6-mELA,1516
51
+ clarifai/datasets/upload/loaders/coco_detection.py,sha256=_I_yThw435KS9SH7zheBbJDK3zFgjTImBsES__ijjMk,2831
52
+ clarifai/datasets/upload/loaders/imagenet_classification.py,sha256=i7W5F6FTB3LwLmhPgjZHmbCbS3l4LmjsuBFKtjxl1pU,1962
53
+ clarifai/datasets/upload/loaders/xview_detection.py,sha256=hk8cZdYZimm4KOaZvBjYcC6ikURZMn51xmn7pXZT3HE,6052
54
+ clarifai/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
+ clarifai/models/api.py,sha256=d3FQQlG0mNDLrfEvchqaVcq4Tgb_TqryNnJtwp3c7sE,10961
56
+ clarifai/modules/README.md,sha256=mx8pVx6cPp-pP4LcFPT_nX3ngGmhygVK0WiXeD3cbIo,367
57
+ clarifai/modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
+ clarifai/modules/css.py,sha256=kadCEunmyh5h2yf0-4aysE3ZcZ6qaQcxuAgDXS96yF8,2020
59
+ clarifai/modules/pages.py,sha256=iOoM3RNRMgXlV0qBqcdQofxoXo2RuRQh0h9c9BIS0-I,1383
60
+ clarifai/modules/style.css,sha256=j7FNPZVhLPj35vvBksAJ90RuX5sLuqzDR5iM2WIEhiA,6073
61
+ clarifai/rag/__init__.py,sha256=wu3PzAzo7uqgrEzuaC9lY_3gj1HFiR3GU3elZIKTT5g,40
62
+ clarifai/rag/rag.py,sha256=bqUWnfdf91OYMucEK0_rJXDwg0oKjz5c7eda-9CPXu8,12680
63
+ clarifai/rag/utils.py,sha256=yr1jAcbpws4vFGBqlAwPPE7v1DRba48g8gixLFw8OhQ,4070
64
+ clarifai/runners/__init__.py,sha256=3vr4RVvN1IRy2SxJpyycAAvrUBbH-mXR7pqUmu4w36A,412
65
+ clarifai/runners/server.py,sha256=Z46BCUqpb3GpcD59qJKb7rL5dpl6vzMYNG3o0MGzox8,5001
66
+ clarifai/runners/dockerfile_template/Dockerfile.template,sha256=rfKauO0898wfACeD_oQnPlEyWbqCLzx5d2hQfU9gM_E,3209
67
+ clarifai/runners/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
68
+ clarifai/runners/models/base_typed_model.py,sha256=DWEUK5ge9NVZE6LkT3BNTFYjYMPHz-nDgPA48Y0DGXU,7859
69
+ clarifai/runners/models/model_class.py,sha256=9JSPAr4U4K7xI0kSl-q0mHB06zknm2OR-8XIgBCto94,1611
70
+ clarifai/runners/models/model_run_locally.py,sha256=Jo43XmhmnypvLQ9dm5AWcjjoBb2-ohKPpPl4R-e7rDE,21788
71
+ clarifai/runners/models/model_runner.py,sha256=3vzoastQxkGRDK8T9aojDsLNBb9A3IiKm6YmbFrE9S0,6241
72
+ clarifai/runners/models/model_servicer.py,sha256=X4715PVA5PBurRTYcwSEudg8fShGV6InAF4mmRlRcHg,2826
73
+ clarifai/runners/models/model_upload.py,sha256=VjJgNNBPP9O7LkNCXxOqa0lTW1M7k6XKVyI6XlLdXIc,25095
74
+ clarifai/runners/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
+ clarifai/runners/utils/const.py,sha256=L1yhOHzFHdPRJRhz7QEvu7AR_82C8tfL4UdZRy2DExs,948
76
+ clarifai/runners/utils/data_handler.py,sha256=sxy9zlAgI6ETuxCQhUgEXAn2GCsaW1GxpK6GTaMne0g,6966
77
+ clarifai/runners/utils/data_utils.py,sha256=R1iQ82TuQ9JwxCJk8yEB1Lyb0BYVhVbWJI9YDi1zGOs,318
78
+ clarifai/runners/utils/loader.py,sha256=6dvkfZtkrV11uGZnGUj5RaV4qpjwW-nDPBuDmBB_jXQ,6151
79
+ clarifai/runners/utils/url_fetcher.py,sha256=v_8JOWmkyFAzsBulsieKX7Nfjy1Yg7wGSZeqfEvw2cg,1640
80
+ clarifai/schema/search.py,sha256=JjTi8ammJgZZ2OGl4K6tIA4zEJ1Fr2ASZARXavI1j5c,2448
81
+ clarifai/urls/helper.py,sha256=tjoMGGHuWX68DUB0pk4MEjrmFsClUAQj2jmVEM_Sy78,4751
82
+ clarifai/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
83
+ clarifai/utils/cli.py,sha256=CdcLsF00KdfA-BgMIbO-u88gUF9Ts1n0TDDZS-oImp8,1949
84
+ clarifai/utils/constants.py,sha256=MG_iHnSwNEyUZOpvsrTicNwaT4CIjmlK_Ixk_qqEX8g,142
85
+ clarifai/utils/logging.py,sha256=2I7GWuqPm7JuGGBwME1464-DsQaJhEb0V0-z0P2-1h4,11847
86
+ clarifai/utils/misc.py,sha256=ptjt1NtteDT0EhrPoyQ7mgWtvoAQ-XNncQaZvNHb0KI,2253
87
+ clarifai/utils/model_train.py,sha256=Mndqy5GNu7kjQHjDyNVyamL0hQFLGSHcWhOuPyOvr1w,8005
88
+ clarifai/utils/evaluation/__init__.py,sha256=PYkurUrXrGevByj7RFb6CoU1iC7fllyQSfnnlo9WnY8,69
89
+ clarifai/utils/evaluation/helpers.py,sha256=aZeHLI7oSmU5YDWQp5GdkYW5qbHx37nV9xwunKTAwWM,18549
90
+ clarifai/utils/evaluation/main.py,sha256=sQAuMk0lPclXCYvy_rS7rYteo2xh9Ju13VNvbyGt_VM,15779
91
+ clarifai/utils/evaluation/testset_annotation_parser.py,sha256=iZfLw6oR1qgJ3MHMbOZXcGBLu7btSDn0VqdiAzpIm4g,5002
92
+ clarifai/workflows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
93
+ clarifai/workflows/export.py,sha256=vICRhIreqDSShxLKjHNM2JwzKsf1B4fdXB0ciMcA70k,1945
94
+ clarifai/workflows/utils.py,sha256=nGeB_yjVgUO9kOeKTg4OBBaBz-AwXI3m-huSVj-9W18,1924
95
+ clarifai/workflows/validate.py,sha256=yJq03MaJqi5AK3alKGJJBR89xmmjAQ31sVufJUiOqY8,2556
96
+ clarifai-11.0.7.dist-info/LICENSE,sha256=mUqF_d12-qE2n41g7C5_sq-BMLOcj6CNN-jevr15YHU,555
97
+ clarifai-11.0.7.dist-info/METADATA,sha256=c7Qb8bXAVepG4ylCKgcnz-0Uc1h_19Dst9rECcOJ5NE,22387
98
+ clarifai-11.0.7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
99
+ clarifai-11.0.7.dist-info/entry_points.txt,sha256=X9FZ4Z-i_r2Ud1RpZ9sNIFYuu_-9fogzCMCRUD9hyX0,51
100
+ clarifai-11.0.7.dist-info/top_level.txt,sha256=wUMdCQGjkxaynZ6nZ9FAnvBUCgp5RJUVFSy2j-KYo0s,9
101
+ clarifai-11.0.7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
Binary file
@@ -1,158 +0,0 @@
1
- # Clarifai Model Serving
2
-
3
- ## Overview
4
-
5
- Model Serving is a part of user journey at Clarifai offers a user-friendly interface for deploying your local model into production with Clarifai, featuring:
6
-
7
- * A convenient command-line interface (CLI)
8
- * Easy implementation and testing in Python
9
- * No need for MLops expertise.
10
-
11
- ## Quickstart Guide
12
-
13
- Quick example for deploying a `text-to-text` model
14
-
15
- ### Initialize a Clarifai model repository
16
-
17
- Suppose your working directory name is `your_model_dir`. Then run
18
-
19
- ```bash
20
- $ clarifai create model --type text-to-text --working-dir your_model_dir
21
- $ cd your_model_dir
22
- ```
23
-
24
- In `your_model_dir` folder you will see essential files for deployment process
25
-
26
- ```bash
27
- your_model_dir
28
- ├── clarifai_config.yaml
29
- ├── inference.py
30
- ├── test.py
31
- └── requirements.txt
32
- ```
33
-
34
- ### Implementation
35
-
36
- Write your code in class `InferenceModel` which is an interface between your model and Clarifai server in `inference.py`, there are 2 functions you must implement:
37
-
38
- * `__init__`: load your model checkpoint once.
39
- * `predict`: make prediction, called everytime when you make request from API.
40
-
41
- For example, a complete implementation of a hf text-generation model
42
-
43
- ```python
44
- import os
45
- from typing import Dict, Union
46
- from clarifai.models.model_serving.model_config import *
47
-
48
- import torch
49
- from transformers import AutoTokenizer
50
- import transformers
51
-
52
- class InferenceModel(TextToText):
53
- """User model inference class."""
54
-
55
- def __init__(self) -> None:
56
- """
57
- Load inference time artifacts that are called frequently .e.g. models, tokenizers, etc.
58
- in this method so they are loaded only once for faster inference.
59
- """
60
- # current directory
61
- self.base_path = os.path.dirname(__file__)
62
- # where you save hf checkpoint in your working dir e.i. `your_model_dir`
63
- model_path = os.path.join(self.base_path, "checkpoint")
64
- self.tokenizer = AutoTokenizer.from_pretrained(model_path)
65
- self.pipeline = transformers.pipeline(
66
- "text-generation",
67
- model=model_path,
68
- torch_dtype=torch.float16,
69
- device_map="auto",
70
- )
71
-
72
- def predict(self, input_data: list,
73
- inference_parameters: Dict[str, Union[str, float, int]]) -> list:
74
- """ Custom prediction function for `text-to-text` (also called as `text generation`) model.
75
-
76
- Args:
77
- input_data (List[str]): List of text
78
- inference_parameters (Dict[str, Union[str, float, int]]): your inference parameters
79
-
80
- Returns:
81
- list of TextOutput
82
-
83
- """
84
- output_sequences = self.pipeline(
85
- input_data,
86
- eos_token_id=self.tokenizer.eos_token_id,
87
- **inference_parameters)
88
-
89
- # wrap outputs in Clarifai defined output
90
- return [TextOutput(each[0]) for each in output_sequences]
91
- ```
92
-
93
- Update dependencies in `requirements.txt`
94
-
95
- ```
96
- clarifai
97
- torch=2.1.1
98
- transformers==4.36.2
99
- accelerate==0.26.1
100
- ```
101
-
102
- ### Test (optional)
103
-
104
- > NOTE: Running `test` is also involved in `build` and `upload` command.
105
-
106
- Test and play with your implementation by executing `test.py`.
107
-
108
- Install pytest
109
-
110
- ```bash
111
- $ pip install pytest
112
- ```
113
-
114
- Execute test
115
-
116
- ```bash
117
- $ pytest test.py
118
- ```
119
-
120
- ### Build
121
-
122
- Prepare for deployment step. Run:
123
-
124
- ```bash
125
- $ clarifai build model
126
- ```
127
-
128
- You will obtain `*.clarifai` file, it's simply a zip having all nessecary files in it to get your model work on Clarifai platform.
129
-
130
- `NOTE`: you need to upload your built file to cloud storage to get direct download `url` for next step
131
-
132
- ### Deployment
133
-
134
- Login to Clarifai
135
-
136
- ```bash
137
- $ clarifai login
138
- Get your PAT from https://clarifai.com/settings/security and pass it here: <insert your pat here>
139
- ```
140
-
141
- Upload
142
-
143
- ```bash
144
- # upload built file directly
145
- $ clarifai upload model <your-working-dir> --user-app <your_user_id>/<your_app_id> --id <your_model_id>
146
- # or using direct download url of cloud storage
147
- $ clarifai upload model --url <url> --user-app <your_user_id>/<your_app_id> --id <your_model_id>
148
- ```
149
-
150
- ## Learn More
151
-
152
- * [Detail Instruction](./docs/concepts.md)
153
- * [Examples](https://github.com/Clarifai/examples/tree/main/model_upload)
154
- * [Initialize from example](./docs/cli.md)
155
- * [CLI usage](./docs/cli.md)
156
- * [Inference parameters](./docs/inference_parameters.md)
157
- * [Model Types](./docs/model_types.md)
158
- * [Dependencies](./docs/dependencies.md)
@@ -1,14 +0,0 @@
1
- # Copyright 2023 Clarifai, Inc.
2
- # Licensed under the Apache License, Version 2.0 (the "License");
3
- # you may not use this file except in compliance with the License.
4
- # You may obtain a copy of the License at
5
- #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
- #
8
- # Unless required by applicable law or agreed to in writing, software
9
- # distributed under the License is distributed on an "AS IS" BASIS,
10
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- # See the License for the specific language governing permissions and
12
- # limitations under the License.
13
- from .model_config import * # noqa
14
- from .repo_build import * # noqa
@@ -1,12 +0,0 @@
1
- # Copyright 2023 Clarifai, Inc.
2
- # Licensed under the Apache License, Version 2.0 (the "License");
3
- # you may not use this file except in compliance with the License.
4
- # You may obtain a copy of the License at
5
- #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
- #
8
- # Unless required by applicable law or agreed to in writing, software
9
- # distributed under the License is distributed on an "AS IS" BASIS,
10
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- # See the License for the specific language governing permissions and
12
- # limitations under the License.
@@ -1,53 +0,0 @@
1
- from __future__ import annotations # isort: skip
2
- import os
3
- import shutil
4
- import subprocess
5
- from typing import Dict, Union
6
-
7
- from ..constants import (CLARIFAI_EXAMPLES_REPO, CLARIFAI_EXAMPLES_REPO_PATH,
8
- MODEL_UPLOAD_EXAMPLE_FOLDER)
9
-
10
-
11
- def download_examples_repo(forced_download: bool = False):
12
-
13
- def _pull():
14
- subprocess.run(f"git clone {CLARIFAI_EXAMPLES_REPO} {CLARIFAI_EXAMPLES_REPO_PATH}", shell=True)
15
-
16
- if not os.path.isdir(CLARIFAI_EXAMPLES_REPO_PATH):
17
- print(f"Download examples to {CLARIFAI_EXAMPLES_REPO_PATH}")
18
- _pull()
19
- else:
20
- if forced_download:
21
-
22
- def _rm_dir_readonly(func, path, _):
23
- import stat
24
- os.chmod(path, stat.S_IWRITE)
25
- func(path)
26
-
27
- print("Removing old examples...")
28
- shutil.rmtree(CLARIFAI_EXAMPLES_REPO_PATH, onerror=_rm_dir_readonly)
29
- _pull()
30
-
31
-
32
- def list_model_upload_examples(
33
- forced_download: bool = False) -> Dict[str, tuple[str, Union[str, None]]]:
34
- download_examples_repo(forced_download)
35
- model_upload_folder = MODEL_UPLOAD_EXAMPLE_FOLDER
36
- model_upload_path = os.path.join(CLARIFAI_EXAMPLES_REPO_PATH, model_upload_folder)
37
- examples = {}
38
- for model_type_ex in os.listdir(model_upload_path):
39
- _folder = os.path.join(model_upload_path, model_type_ex)
40
- if os.path.isdir(_folder):
41
- _walk = list(os.walk(_folder))
42
- if len(_walk) > 0:
43
- _, model_names, _files = _walk[0]
44
- readme = [item for item in _files if "readme" in item.lower()]
45
- for name in model_names:
46
- examples.update({
47
- f"{model_type_ex}/{name}": [
48
- os.path.join(_folder, name),
49
- os.path.join(_folder, readme[0]) or None
50
- ]
51
- })
52
-
53
- return examples
@@ -1,14 +0,0 @@
1
- from abc import ABC, abstractmethod
2
- from argparse import _SubParsersAction
3
-
4
-
5
- class BaseClarifaiCli(ABC):
6
-
7
- @staticmethod
8
- @abstractmethod
9
- def register(parser: _SubParsersAction):
10
- raise NotImplementedError()
11
-
12
- @abstractmethod
13
- def run(self):
14
- raise NotImplementedError()
@@ -1,79 +0,0 @@
1
- # Copyright 2023 Clarifai, Inc.
2
- # Licensed under the Apache License, Version 2.0 (the "License");
3
- # you may not use this file except in compliance with the License.
4
- # You may obtain a copy of the License at
5
- #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
- #
8
- # Unless required by applicable law or agreed to in writing, software
9
- # distributed under the License is distributed on an "AS IS" BASIS,
10
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- # See the License for the specific language governing permissions and
12
- # limitations under the License.
13
- """Commandline interface for model upload utils."""
14
- import argparse
15
- import os
16
- import subprocess
17
-
18
- from ..repo_build import RepositoryBuilder
19
- from .base import BaseClarifaiCli
20
-
21
-
22
- class BuildCli(BaseClarifaiCli):
23
-
24
- @staticmethod
25
- def register(parser: argparse._SubParsersAction):
26
- parser = parser.add_parser("build", help="Build clarifai model for uploading")
27
- sub_parser = parser.add_subparsers()
28
-
29
- BuildModelSubCli.register(sub_parser)
30
-
31
- parser.set_defaults(func=BuildCli)
32
-
33
-
34
- class BuildModelSubCli(BaseClarifaiCli):
35
-
36
- @staticmethod
37
- def register(parser: argparse._SubParsersAction):
38
- sub_parser = parser.add_parser("model", help="Build Clarifai model")
39
- sub_parser.add_argument(
40
- "path",
41
- type=str,
42
- nargs='?',
43
- help="Path to working directory, default is current directory",
44
- default=".")
45
- sub_parser.add_argument(
46
- "--out-path", type=str, required=False, help="Output path of built model", default=None)
47
- sub_parser.add_argument(
48
- "--name",
49
- type=str,
50
- required=False,
51
- help="Name of built file, default is `clarifai_model_id` in config if set or `model`",
52
- default=None)
53
- sub_parser.add_argument(
54
- "--no-test",
55
- action="store_true",
56
- help="Trigger this flag to skip testing before uploading")
57
- sub_parser.set_defaults(func=BuildModelSubCli)
58
-
59
- def __init__(self, args: argparse.Namespace) -> None:
60
- self.path = args.path
61
- self.no_test = args.no_test
62
- self.test_path = os.path.join(self.path, "test.py")
63
- self.output_path = args.out_path or self.path
64
- self.serving_backend = "triton"
65
- self.name = args.name
66
-
67
- def run(self):
68
-
69
- # Run test before uploading
70
- if not self.no_test:
71
- assert os.path.exists(
72
- self.test_path), FileNotFoundError(f"Could not find `test.py` in {self.path}")
73
- result = subprocess.run(f"pytest -s --log-level=INFO {self.test_path}", shell=True)
74
- assert result.returncode == 0, "Test has failed. Please make sure no error exists in your code."
75
-
76
- # build
77
- print("Start building...")
78
- RepositoryBuilder.build(
79
- self.path, backend=self.serving_backend, output_dir=self.output_path, name=self.name)
@@ -1,33 +0,0 @@
1
- from argparse import ArgumentParser
2
-
3
- from .build import BuildCli
4
- from .create import CreateCli
5
- from .example_cli import ExampleCli
6
- from .login import LoginCli
7
- from .upload import UploadCli
8
-
9
-
10
- def main():
11
-
12
- parser = ArgumentParser("clarifai")
13
- cmd_parser = parser.add_subparsers(help="Clarifai cli helpers")
14
-
15
- UploadCli.register(cmd_parser)
16
- CreateCli.register(cmd_parser)
17
- LoginCli.register(cmd_parser)
18
- ExampleCli.register(cmd_parser)
19
- BuildCli.register(cmd_parser)
20
-
21
- args = parser.parse_args()
22
-
23
- if not hasattr(args, "func"):
24
- parser.print_help()
25
- exit(1)
26
-
27
- # Run
28
- service = args.func(args)
29
- service.run()
30
-
31
-
32
- if __name__ == "__main__":
33
- main()