clarifai 11.6.1__tar.gz → 11.6.3__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 (150) hide show
  1. {clarifai-11.6.1/clarifai.egg-info → clarifai-11.6.3}/PKG-INFO +2 -2
  2. clarifai-11.6.3/clarifai/__init__.py +1 -0
  3. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/cli/model.py +27 -6
  4. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/cli/templates/model_templates.py +4 -4
  5. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/pipeline_steps/pipeline_step_builder.py +12 -8
  6. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/server.py +3 -1
  7. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/utils/constants.py +1 -1
  8. {clarifai-11.6.1 → clarifai-11.6.3/clarifai.egg-info}/PKG-INFO +2 -2
  9. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai.egg-info/requires.txt +1 -1
  10. {clarifai-11.6.1 → clarifai-11.6.3}/requirements.txt +1 -1
  11. clarifai-11.6.1/clarifai/__init__.py +0 -1
  12. {clarifai-11.6.1 → clarifai-11.6.3}/LICENSE +0 -0
  13. {clarifai-11.6.1 → clarifai-11.6.3}/MANIFEST.in +0 -0
  14. {clarifai-11.6.1 → clarifai-11.6.3}/README.md +0 -0
  15. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/cli/README.md +0 -0
  16. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/cli/__init__.py +0 -0
  17. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/cli/__main__.py +0 -0
  18. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/cli/base.py +0 -0
  19. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/cli/compute_cluster.py +0 -0
  20. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/cli/deployment.py +0 -0
  21. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/cli/nodepool.py +0 -0
  22. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/cli/pipeline.py +0 -0
  23. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/cli/pipeline_step.py +0 -0
  24. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/cli/templates/__init__.py +0 -0
  25. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/cli/templates/pipeline_step_templates.py +0 -0
  26. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/cli/templates/pipeline_templates.py +0 -0
  27. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/cli.py +0 -0
  28. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/__init__.py +0 -0
  29. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/app.py +0 -0
  30. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/auth/__init__.py +0 -0
  31. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/auth/helper.py +0 -0
  32. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/auth/register.py +0 -0
  33. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/auth/stub.py +0 -0
  34. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/base.py +0 -0
  35. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/compute_cluster.py +0 -0
  36. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/dataset.py +0 -0
  37. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/deployment.py +0 -0
  38. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/input.py +0 -0
  39. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/lister.py +0 -0
  40. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/model.py +0 -0
  41. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/model_client.py +0 -0
  42. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/module.py +0 -0
  43. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/nodepool.py +0 -0
  44. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/pipeline.py +0 -0
  45. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/runner.py +0 -0
  46. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/search.py +0 -0
  47. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/user.py +0 -0
  48. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/client/workflow.py +0 -0
  49. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/constants/base.py +0 -0
  50. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/constants/dataset.py +0 -0
  51. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/constants/input.py +0 -0
  52. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/constants/model.py +0 -0
  53. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/constants/rag.py +0 -0
  54. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/constants/search.py +0 -0
  55. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/constants/workflow.py +0 -0
  56. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/__init__.py +0 -0
  57. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/export/__init__.py +0 -0
  58. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/export/inputs_annotations.py +0 -0
  59. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/upload/__init__.py +0 -0
  60. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/upload/base.py +0 -0
  61. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/upload/features.py +0 -0
  62. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/upload/image.py +0 -0
  63. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/upload/loaders/README.md +0 -0
  64. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/upload/loaders/__init__.py +0 -0
  65. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/upload/loaders/coco_captions.py +0 -0
  66. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/upload/loaders/coco_detection.py +0 -0
  67. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/upload/loaders/imagenet_classification.py +0 -0
  68. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/upload/loaders/xview_detection.py +0 -0
  69. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/upload/multimodal.py +0 -0
  70. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/upload/text.py +0 -0
  71. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/datasets/upload/utils.py +0 -0
  72. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/errors.py +0 -0
  73. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/models/__init__.py +0 -0
  74. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/models/api.py +0 -0
  75. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/modules/README.md +0 -0
  76. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/modules/__init__.py +0 -0
  77. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/modules/css.py +0 -0
  78. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/modules/pages.py +0 -0
  79. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/modules/style.css +0 -0
  80. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/rag/__init__.py +0 -0
  81. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/rag/rag.py +0 -0
  82. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/rag/utils.py +0 -0
  83. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/__init__.py +0 -0
  84. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/dockerfile_template/Dockerfile.template +0 -0
  85. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/models/__init__.py +0 -0
  86. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/models/dummy_openai_model.py +0 -0
  87. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/models/mcp_class.py +0 -0
  88. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/models/model_builder.py +0 -0
  89. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/models/model_class.py +0 -0
  90. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/models/model_run_locally.py +0 -0
  91. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/models/model_runner.py +0 -0
  92. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/models/model_servicer.py +0 -0
  93. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/models/openai_class.py +0 -0
  94. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/models/visual_classifier_class.py +0 -0
  95. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/models/visual_detector_class.py +0 -0
  96. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/pipeline_steps/__init__.py +0 -0
  97. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/pipelines/__init__.py +0 -0
  98. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/pipelines/pipeline_builder.py +0 -0
  99. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/utils/__init__.py +0 -0
  100. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/utils/code_script.py +0 -0
  101. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/utils/const.py +0 -0
  102. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/utils/data_types/__init__.py +0 -0
  103. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/utils/data_types/data_types.py +0 -0
  104. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/utils/data_utils.py +0 -0
  105. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/utils/loader.py +0 -0
  106. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/utils/method_signatures.py +0 -0
  107. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/utils/model_utils.py +0 -0
  108. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/utils/openai_convertor.py +0 -0
  109. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/utils/pipeline_validation.py +0 -0
  110. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/utils/serializers.py +0 -0
  111. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/runners/utils/url_fetcher.py +0 -0
  112. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/schema/search.py +0 -0
  113. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/urls/helper.py +0 -0
  114. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/utils/__init__.py +0 -0
  115. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/utils/cli.py +0 -0
  116. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/utils/config.py +0 -0
  117. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/utils/evaluation/__init__.py +0 -0
  118. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/utils/evaluation/helpers.py +0 -0
  119. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/utils/evaluation/main.py +0 -0
  120. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/utils/evaluation/testset_annotation_parser.py +0 -0
  121. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/utils/logging.py +0 -0
  122. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/utils/misc.py +0 -0
  123. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/utils/model_train.py +0 -0
  124. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/utils/protobuf.py +0 -0
  125. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/versions.py +0 -0
  126. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/workflows/__init__.py +0 -0
  127. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/workflows/export.py +0 -0
  128. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/workflows/utils.py +0 -0
  129. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai/workflows/validate.py +0 -0
  130. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai.egg-info/SOURCES.txt +0 -0
  131. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai.egg-info/dependency_links.txt +0 -0
  132. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai.egg-info/entry_points.txt +0 -0
  133. {clarifai-11.6.1 → clarifai-11.6.3}/clarifai.egg-info/top_level.txt +0 -0
  134. {clarifai-11.6.1 → clarifai-11.6.3}/pyproject.toml +0 -0
  135. {clarifai-11.6.1 → clarifai-11.6.3}/setup.cfg +0 -0
  136. {clarifai-11.6.1 → clarifai-11.6.3}/setup.py +0 -0
  137. {clarifai-11.6.1 → clarifai-11.6.3}/tests/test_app.py +0 -0
  138. {clarifai-11.6.1 → clarifai-11.6.3}/tests/test_async_stub.py +0 -0
  139. {clarifai-11.6.1 → clarifai-11.6.3}/tests/test_auth.py +0 -0
  140. {clarifai-11.6.1 → clarifai-11.6.3}/tests/test_data_upload.py +0 -0
  141. {clarifai-11.6.1 → clarifai-11.6.3}/tests/test_eval.py +0 -0
  142. {clarifai-11.6.1 → clarifai-11.6.3}/tests/test_list_models.py +0 -0
  143. {clarifai-11.6.1 → clarifai-11.6.3}/tests/test_misc.py +0 -0
  144. {clarifai-11.6.1 → clarifai-11.6.3}/tests/test_model_predict.py +0 -0
  145. {clarifai-11.6.1 → clarifai-11.6.3}/tests/test_model_train.py +0 -0
  146. {clarifai-11.6.1 → clarifai-11.6.3}/tests/test_modules.py +0 -0
  147. {clarifai-11.6.1 → clarifai-11.6.3}/tests/test_pipeline_client.py +0 -0
  148. {clarifai-11.6.1 → clarifai-11.6.3}/tests/test_rag.py +0 -0
  149. {clarifai-11.6.1 → clarifai-11.6.3}/tests/test_search.py +0 -0
  150. {clarifai-11.6.1 → clarifai-11.6.3}/tests/test_stub.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clarifai
3
- Version: 11.6.1
3
+ Version: 11.6.3
4
4
  Home-page: https://github.com/Clarifai/clarifai-python
5
5
  Author: Clarifai
6
6
  Author-email: support@clarifai.com
@@ -19,7 +19,7 @@ Classifier: Operating System :: OS Independent
19
19
  Requires-Python: >=3.8
20
20
  Description-Content-Type: text/markdown
21
21
  License-File: LICENSE
22
- Requires-Dist: clarifai-grpc>=11.6.0
22
+ Requires-Dist: clarifai-grpc>=11.6.1
23
23
  Requires-Dist: clarifai-protocol>=0.0.25
24
24
  Requires-Dist: numpy>=1.22.0
25
25
  Requires-Dist: tqdm>=4.65.0
@@ -0,0 +1 @@
1
+ __version__ = "11.6.3"
@@ -17,10 +17,7 @@ from clarifai.utils.constants import (
17
17
  DEFAULT_LOCAL_DEV_NODEPOOL_ID,
18
18
  )
19
19
  from clarifai.utils.logging import logger
20
- from clarifai.utils.misc import (
21
- clone_github_repo,
22
- format_github_repo_url,
23
- )
20
+ from clarifai.utils.misc import clone_github_repo, format_github_repo_url
24
21
 
25
22
 
26
23
  @cli.group(
@@ -60,7 +57,12 @@ def model():
60
57
  required=False,
61
58
  help='Git branch to clone from the GitHub repository. If not specified, the default branch will be used.',
62
59
  )
63
- def init(model_path, model_type_id, github_pat, github_repo, branch):
60
+ @click.option(
61
+ '--local-ollama-model',
62
+ is_flag=True,
63
+ help='Create an Ollama model template by cloning from GitHub repository.',
64
+ )
65
+ def init(model_path, model_type_id, github_pat, github_repo, branch, local_ollama_model):
64
66
  """Initialize a new model directory structure.
65
67
 
66
68
  Creates the following structure in the specified directory:
@@ -76,6 +78,15 @@ def init(model_path, model_type_id, github_pat, github_repo, branch):
76
78
 
77
79
  MODEL_PATH: Path where to create the model directory structure. If not specified, the current directory is used by default.
78
80
  """
81
+ # Handle the --local-ollama-model flag
82
+ if local_ollama_model:
83
+ if github_repo or branch:
84
+ raise click.ClickException(
85
+ "Cannot specify both --local-ollama-model and --github-repo/--branch"
86
+ )
87
+ github_repo = "https://github.com/Clarifai/runners-examples"
88
+ branch = "ollama"
89
+
79
90
  # Resolve the absolute path
80
91
  model_path = os.path.abspath(model_path)
81
92
 
@@ -407,8 +418,16 @@ def run_locally(model_path, port, mode, keep_env, keep_image, skip_dockerfile=Fa
407
418
  required=False,
408
419
  default=".",
409
420
  )
421
+ @click.option(
422
+ "--pool_size",
423
+ type=int,
424
+ is_flag=True,
425
+ default=1, # default to 1 thread for local dev runner to avoid rapid depletion of compute time.
426
+ show_default=True,
427
+ help="The number of threads to use. On community plan, the compute time allocation is drained at a rate proportional to the number of threads.",
428
+ ) # pylint: disable=range-builtin-not-iterating
410
429
  @click.pass_context
411
- def local_dev(ctx, model_path):
430
+ def local_dev(ctx, model_path, pool_size):
412
431
  """Run the model as a local dev runner to help debug your model connected to the API or to
413
432
  leverage local compute resources manually. This relies on many variables being present in the env
414
433
  of the currently selected context. If they are not present then default values will be used to
@@ -731,6 +750,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
731
750
  # This reads the config.yaml from the model_path so we alter it above first.
732
751
  serve(
733
752
  model_path,
753
+ pool_size=pool_size,
754
+ num_threads=pool_size,
734
755
  user_id=user_id,
735
756
  compute_cluster_id=compute_cluster_id,
736
757
  nodepool_id=nodepool_id,
@@ -7,7 +7,7 @@ def get_model_class_template() -> str:
7
7
  """Return the template for a basic ModelClass-based model."""
8
8
  return '''from typing import Iterator, List
9
9
  from clarifai.runners.models.model_class import ModelClass
10
- from clarifai.runners.util.data_utils import Param
10
+ from clarifai.runners.utils.data_utils import Param
11
11
 
12
12
  class MyModel(ModelClass):
13
13
  """A custom model implementation using ModelClass."""
@@ -31,7 +31,7 @@ class MyModel(ModelClass):
31
31
  """This is the method that will be called when the runner is run. It takes in an input and returns an output."""
32
32
  # TODO: please fill in
33
33
  # Implement your prediction logic here
34
- pass # Replace with your actual logic
34
+ return "This is a placeholder response. Please implement your model logic."
35
35
 
36
36
  @ModelClass.method
37
37
  def generate(
@@ -45,7 +45,7 @@ class MyModel(ModelClass):
45
45
  """Example yielding a streamed response."""
46
46
  # TODO: please fill in
47
47
  # Implement your generation logic here
48
- pass # Replace with your actual logic
48
+ yield "This is a placeholder response. Please implement your model logic."
49
49
  '''
50
50
 
51
51
 
@@ -104,7 +104,7 @@ def get_openai_model_class_template() -> str:
104
104
  return '''from typing import List
105
105
  from openai import OpenAI
106
106
  from clarifai.runners.models.openai_class import OpenAIModelClass
107
- from clarifai.runners.util.data_utils import Param
107
+ from clarifai.runners.utils.data_utils import Param
108
108
  from clarifai.runners.utils.openai_convertor import build_openai_messages
109
109
 
110
110
  class MyModel(OpenAIModelClass):
@@ -8,6 +8,7 @@ from string import Template
8
8
  import yaml
9
9
  from clarifai_grpc.grpc.api import resources_pb2, service_pb2
10
10
  from clarifai_grpc.grpc.api.status import status_code_pb2
11
+ from google.protobuf import json_format
11
12
 
12
13
  from clarifai.client.base import BaseClient
13
14
  from clarifai.utils.logging import logger
@@ -106,16 +107,16 @@ class PipelineStepBuilder:
106
107
 
107
108
  def _get_pipeline_step_compute_info(self):
108
109
  """Get pipeline step compute info from config."""
110
+ assert "pipeline_step_compute_info" in self.config, (
111
+ "pipeline_step_compute_info not found in the config file"
112
+ )
109
113
  compute_config = self.config.get("pipeline_step_compute_info", {})
110
114
 
111
- compute_info = resources_pb2.ComputeInfo()
115
+ # Ensure cpu_limit is a string if it exists and is an int
116
+ if 'cpu_limit' in compute_config and isinstance(compute_config['cpu_limit'], int):
117
+ compute_config['cpu_limit'] = str(compute_config['cpu_limit'])
112
118
 
113
- if "cpu_limit" in compute_config:
114
- compute_info.cpu_limit = compute_config["cpu_limit"]
115
- if "cpu_memory" in compute_config:
116
- compute_info.cpu_memory = compute_config["cpu_memory"]
117
- if "num_accelerators" in compute_config:
118
- compute_info.num_accelerators = compute_config["num_accelerators"]
119
+ compute_info = json_format.ParseDict(compute_config, resources_pb2.ComputeInfo())
119
120
 
120
121
  return compute_info
121
122
 
@@ -200,8 +201,11 @@ COPY --link=true requirements.txt config.yaml /home/nonroot/main/
200
201
  PYTHON_VERSION=python_version
201
202
  )
202
203
 
203
- # Write Dockerfile
204
+ # Write Dockerfile if it doesn't exist
204
205
  dockerfile_path = os.path.join(self.folder, 'Dockerfile')
206
+ if os.path.exists(dockerfile_path):
207
+ logger.info(f"Dockerfile already exists at {dockerfile_path}, skipping creation.")
208
+ return
205
209
  with open(dockerfile_path, 'w') as dockerfile:
206
210
  dockerfile.write(dockerfile_content)
207
211
 
@@ -81,6 +81,7 @@ def serve(
81
81
  model_path,
82
82
  port=8000,
83
83
  pool_size=32,
84
+ num_threads=0,
84
85
  max_queue_size=10,
85
86
  max_msg_length=1024 * 1024 * 1024,
86
87
  enable_tls=False,
@@ -98,7 +99,8 @@ def serve(
98
99
 
99
100
  # `num_threads` can be set in config.yaml or via the environment variable CLARIFAI_NUM_THREADS="<integer>".
100
101
  # Note: The value in config.yaml takes precedence over the environment variable.
101
- num_threads = builder.config.get("num_threads")
102
+ if num_threads == 0:
103
+ num_threads = builder.config.get("num_threads")
102
104
  # Setup the grpc server for local development.
103
105
  if grpc:
104
106
  # initialize the servicer with the runner so that it gets the predict(), generate(), stream() classes.
@@ -47,7 +47,7 @@ DEFAULT_LOCAL_DEV_NODEPOOL_CONFIG = {
47
47
  },
48
48
  "instance_types": [
49
49
  {
50
- "id": "local-cpu",
50
+ "id": "local",
51
51
  "compute_info": {
52
52
  "cpu_limit": str(os.cpu_count()),
53
53
  "cpu_memory": "16Gi", # made up as we don't schedule based on this for local dev.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clarifai
3
- Version: 11.6.1
3
+ Version: 11.6.3
4
4
  Home-page: https://github.com/Clarifai/clarifai-python
5
5
  Author: Clarifai
6
6
  Author-email: support@clarifai.com
@@ -19,7 +19,7 @@ Classifier: Operating System :: OS Independent
19
19
  Requires-Python: >=3.8
20
20
  Description-Content-Type: text/markdown
21
21
  License-File: LICENSE
22
- Requires-Dist: clarifai-grpc>=11.6.0
22
+ Requires-Dist: clarifai-grpc>=11.6.1
23
23
  Requires-Dist: clarifai-protocol>=0.0.25
24
24
  Requires-Dist: numpy>=1.22.0
25
25
  Requires-Dist: tqdm>=4.65.0
@@ -1,4 +1,4 @@
1
- clarifai-grpc>=11.6.0
1
+ clarifai-grpc>=11.6.1
2
2
  clarifai-protocol>=0.0.25
3
3
  numpy>=1.22.0
4
4
  tqdm>=4.65.0
@@ -1,4 +1,4 @@
1
- clarifai-grpc>=11.6.0
1
+ clarifai-grpc>=11.6.1
2
2
  clarifai-protocol>=0.0.25
3
3
  numpy>=1.22.0
4
4
  tqdm>=4.65.0
@@ -1 +0,0 @@
1
- __version__ = "11.6.1"
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
File without changes
File without changes
File without changes
File without changes