clarifai 11.1.5rc2__py3-none-any.whl → 11.1.5rc3__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.
clarifai/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "11.1.5rc2"
1
+ __version__ = "11.1.5rc3"
clarifai/client/model.py CHANGED
@@ -443,6 +443,15 @@ class Model(Lister, BaseClient):
443
443
  output_config=output_config,
444
444
  )
445
445
 
446
+ def predict2(self, inputs):
447
+ """Predicts the model based on the given inputs.
448
+
449
+ Args:
450
+ inputs (list[Input]): The inputs to predict, must be less than 128.
451
+ """
452
+
453
+ return self.model_client._predict(inputs=inputs,)
454
+
446
455
  def _check_predict_input_type(self, input_type: str) -> None:
447
456
  """Checks if the input type is valid for the model.
448
457
 
@@ -48,8 +48,10 @@ class ModelClient:
48
48
 
49
49
  request = service_pb2.PostModelOutputsRequest()
50
50
  request.CopyFrom(self.request_template)
51
- request.model.model_version.output_info.params['_method_name'] = '_GET_SIGNATURES'
52
- request.inputs.add() # empty input for this method
51
+ # request.model.model_version.output_info.params['_method_name'] = '_GET_SIGNATURES'
52
+ inp = request.inputs.add() # empty input for this method
53
+ inp.data.parts.add() # empty part for this input
54
+ inp.data.metadata['method_name'] = '_GET_SIGNATURES'
53
55
  start_time = time.time()
54
56
  backoff_iterator = BackoffIterator(10)
55
57
  while True:
@@ -65,8 +67,10 @@ class ModelClient:
65
67
  self._method_signatures = {}
66
68
  return
67
69
  if response.status.code != status_code_pb2.SUCCESS:
68
- raise Exception(f"Model failed with response {response.status!r}")
70
+ raise Exception(f"Model failed with response {response!r}")
69
71
  self._method_signatures = signatures_from_json(response.outputs[0].data.string_value)
72
+ import pdb
73
+ pdb.set_trace()
70
74
 
71
75
  def _define_functions(self):
72
76
  '''
@@ -44,8 +44,8 @@ ENV PYTHONPATH=${PYTHONPATH}:/home/nonroot/main \
44
44
  CLARIFAI_COMPUTE_CLUSTER_ID=${CLARIFAI_COMPUTE_CLUSTER_ID} \
45
45
  CLARIFAI_API_BASE=${CLARIFAI_API_BASE:-https://api.clarifai.com}
46
46
 
47
- # Write out the model function signatures
48
- RUN ["python", "-m", "clarifai.cli", "model", "signatures", "--model_path", "/home/nonroot/main", "--out_path", "/home/nonroot/main/signatures.yaml"]
47
+ # # Write out the model function signatures
48
+ # RUN ["python", "-m", "clarifai.cli", "model", "signatures", "--model_path", "/home/nonroot/main", "--out_path", "/home/nonroot/main/signatures.yaml"]
49
49
 
50
50
  # Finally run the clarifai entrypoint to start the runner loop and local dev server.
51
51
  # Note(zeiler): we may want to make this a clarifai CLI call.
@@ -70,7 +70,6 @@ class ModelClass(ABC):
70
70
 
71
71
  def load_model(self):
72
72
  """Load the model."""
73
- pass
74
73
 
75
74
  def _handle_get_signatures_request(self) -> service_pb2.MultiOutputResponse:
76
75
  methods = self._get_method_info()
@@ -98,8 +97,9 @@ class ModelClass(ABC):
98
97
  outputs = []
99
98
  try:
100
99
  # TODO add method name field to proto
101
- call_params = dict(request.model.model_version.output_info.params)
102
- method_name = call_params.get('_method_name', 'predict')
100
+ method_name = request.inputs[0].data.metadata['method_name']
101
+ # call_params = dict(request.model.model_version.output_info.params)
102
+ # method_name = call_params.get('_method_name', 'predict')
103
103
  if method_name == '_GET_SIGNATURES': # special case to fetch signatures, TODO add endpoint for this
104
104
  return self._handle_get_signatures_request()
105
105
  if method_name not in self._get_method_info():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: clarifai
3
- Version: 11.1.5rc2
3
+ Version: 11.1.5rc3
4
4
  Summary: Clarifai Python SDK
5
5
  Home-page: https://github.com/Clarifai/clarifai-python
6
6
  Author: Clarifai
@@ -1,4 +1,4 @@
1
- clarifai/__init__.py,sha256=kO0DOevIoDJN9LwerQz7F5pbvLR_IJKwxl_5djnmxio,26
1
+ clarifai/__init__.py,sha256=cQU5SXsYznf1FLV9LeeLMrjUc1vlOnCbQLM5_Z--QKI,26
2
2
  clarifai/cli.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  clarifai/errors.py,sha256=RwzTajwds51wLD0MVlMC5kcpBnzRpreDLlazPSBZxrg,2605
4
4
  clarifai/versions.py,sha256=jctnczzfGk_S3EnVqb2FjRKfSREkNmvNEwAAa_VoKiQ,222
@@ -29,8 +29,8 @@ clarifai/client/dataset.py,sha256=y3zKT_VhP1gyN3OO-b3cPeW21ZXyKbQ7ZJkEG06bsTU,32
29
29
  clarifai/client/deployment.py,sha256=w7Y6pA1rYG4KRK1SwusRZc2sQRXlG8wezuVdzSWpCo0,2586
30
30
  clarifai/client/input.py,sha256=obMAHMDU1OwfXZ8KraOnGFlWzlW-3F7Ob_2lcOQMlhY,46339
31
31
  clarifai/client/lister.py,sha256=03KGMvs5RVyYqxLsSrWhNc34I8kiF1Ph0NeyEwu7nMU,2082
32
- clarifai/client/model.py,sha256=Cs8EYUBTMfiycNMW1rO8lDEnqos69NPrEAflMBZatH8,75100
33
- clarifai/client/model_client.py,sha256=5AsB7y59V6i-oChGJqwNByWMdE52snGg5esBIvCgbmc,16506
32
+ clarifai/client/model.py,sha256=Z4cz-qXznbttETnH3W_LyyscGawvtBkRfaSCsdOgAvs,75334
33
+ clarifai/client/model_client.py,sha256=vPdNZbLV8IaTDhyi6dUV_WoPx6we-EFq5gX4MufAAD4,16653
34
34
  clarifai/client/module.py,sha256=FTkm8s9m-EaTKN7g9MnLhGJ9eETUfKG7aWZ3o1RshYs,4204
35
35
  clarifai/client/nodepool.py,sha256=la3vTFrO4LX8zm2eQ5jqf2L0-kQ63Dano8FibadoZbk,10152
36
36
  clarifai/client/search.py,sha256=GaPWN6JmTQGZaCHr6U1yv0zqR6wKFl7i9IVLg2ul1CI,14254
@@ -132,10 +132,10 @@ clarifai/runners/__pycache__/__init__.cpython-310.pyc,sha256=jVTodJyP53yeIEk2sPu
132
132
  clarifai/runners/__pycache__/server.cpython-310.pyc,sha256=HfZ6_Vrr5q78nznFqP_aWhPENplHIol_qPaf8lLlotE,3229
133
133
  clarifai/runners/dockerfile_template/Dockerfile.debug,sha256=sRlfRmSLE_TiLORcVRx-3-B0vvSNeUYgm0CCrWmLvAA,667
134
134
  clarifai/runners/dockerfile_template/Dockerfile.debug~,sha256=7YOVg3adIaiudfSkfLGeyxt-FfIBbD3UIIYccrIVJTs,426
135
- clarifai/runners/dockerfile_template/Dockerfile.template,sha256=cibinDDE4uRGt2d2ho2T7CduSeDF6R2n7U4_4MAouPw,2521
135
+ clarifai/runners/dockerfile_template/Dockerfile.template,sha256=MWGjj0My6d18v-nyhWuNbSXUzCzR6KWkohRB1yInb7Q,2525
136
136
  clarifai/runners/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
137
137
  clarifai/runners/models/model_builder.py,sha256=UCAeJiP_fRFfIuVI1sOge7LMwe-psgvdBuZ0LsJQMpM,33062
138
- clarifai/runners/models/model_class.py,sha256=V7Wf8TiZnccGRJnElr9RU6f8yxzyLXVziEKCfBnLNKU,11060
138
+ clarifai/runners/models/model_class.py,sha256=7pZ8ci4M8Qh91OW-C6yuWAhl3psLDfyvGypaGyFRkLs,11122
139
139
  clarifai/runners/models/model_run_locally.py,sha256=VZetm9Mko8MBjcjwr6PCnTU9gF3glgD5qvpbj-8tW2s,17962
140
140
  clarifai/runners/models/model_runner.py,sha256=qyc73pe4xc9BsUKHwnOyC9g-RNCARiFis4GTh-yg0vg,6219
141
141
  clarifai/runners/models/model_servicer.py,sha256=A--b1P71PBCAMJCpy_-fpNDkfCVdvdMh1LleW15dSas,3037
@@ -195,9 +195,9 @@ clarifai/workflows/__pycache__/__init__.cpython-310.pyc,sha256=oRKg6B7Z-wWQy0EW2
195
195
  clarifai/workflows/__pycache__/export.cpython-310.pyc,sha256=cNmGLnww7xVpm4htd1vRhQJoEZ1dhpN1oD8iLLAtVzM,2418
196
196
  clarifai/workflows/__pycache__/utils.cpython-310.pyc,sha256=rm2kWk4a3GOKWoerXpEAEeRvGhEe7wPd0ZZ6jHtEGqY,1925
197
197
  clarifai/workflows/__pycache__/validate.cpython-310.pyc,sha256=QA1i6YdDpY824cqtQvkEaFPpaCa2iqfOwFouqwZfAKY,2139
198
- clarifai-11.1.5rc2.dist-info/LICENSE,sha256=mUqF_d12-qE2n41g7C5_sq-BMLOcj6CNN-jevr15YHU,555
199
- clarifai-11.1.5rc2.dist-info/METADATA,sha256=nhhZDqrOJR506lzQ3Gi1leNYcT8UuJh3N9mvD1glPQQ,22229
200
- clarifai-11.1.5rc2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
201
- clarifai-11.1.5rc2.dist-info/entry_points.txt,sha256=X9FZ4Z-i_r2Ud1RpZ9sNIFYuu_-9fogzCMCRUD9hyX0,51
202
- clarifai-11.1.5rc2.dist-info/top_level.txt,sha256=wUMdCQGjkxaynZ6nZ9FAnvBUCgp5RJUVFSy2j-KYo0s,9
203
- clarifai-11.1.5rc2.dist-info/RECORD,,
198
+ clarifai-11.1.5rc3.dist-info/LICENSE,sha256=mUqF_d12-qE2n41g7C5_sq-BMLOcj6CNN-jevr15YHU,555
199
+ clarifai-11.1.5rc3.dist-info/METADATA,sha256=Zl3cY8_BDZ33bV5M1VWnPiAMUGT4EIwE3ZqFHWaW0EY,22229
200
+ clarifai-11.1.5rc3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
201
+ clarifai-11.1.5rc3.dist-info/entry_points.txt,sha256=X9FZ4Z-i_r2Ud1RpZ9sNIFYuu_-9fogzCMCRUD9hyX0,51
202
+ clarifai-11.1.5rc3.dist-info/top_level.txt,sha256=wUMdCQGjkxaynZ6nZ9FAnvBUCgp5RJUVFSy2j-KYo0s,9
203
+ clarifai-11.1.5rc3.dist-info/RECORD,,