clarifai 11.1.5rc5__py3-none-any.whl → 11.1.5rc7__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.5rc5"
1
+ __version__ = "11.1.5rc7"
@@ -51,11 +51,9 @@ class ModelClient:
51
51
  # request.model.model_version.output_info.params['_method_name'] = '_GET_SIGNATURES'
52
52
  inp = request.inputs.add() # empty input for this method
53
53
  inp.data.parts.add() # empty part for this input
54
- inp.data.metadata['method_name'] = '_GET_SIGNATURES'
54
+ inp.data.metadata['_method_name'] = '_GET_SIGNATURES'
55
55
  start_time = time.time()
56
56
  backoff_iterator = BackoffIterator(10)
57
- import pdb
58
- pdb.set_trace()
59
57
  while True:
60
58
  response = self.STUB.PostModelOutputs(request)
61
59
  if status_is_retryable(
@@ -71,6 +69,8 @@ class ModelClient:
71
69
  if response.status.code != status_code_pb2.SUCCESS:
72
70
  raise Exception(f"Model failed with response {response!r}")
73
71
  self._method_signatures = signatures_from_json(response.outputs[0].data.text.raw)
72
+ import pdb
73
+ pdb.set_trace()
74
74
 
75
75
  def _define_functions(self):
76
76
  '''
@@ -214,8 +214,10 @@ class ModelClient:
214
214
  request.inputs.extend(inputs)
215
215
 
216
216
  if method_name:
217
+ for inp in inputs:
218
+ inp.data.metadata['_method_name'] = method_name
217
219
  # TODO put in new proto field?
218
- request.model.model_version.output_info.params['_method_name'] = method_name
220
+ # request.model.model_version.output_info.params['_method_name'] = method_name
219
221
  if inference_params:
220
222
  request.model.model_version.output_info.params.update(inference_params)
221
223
  if output_config:
@@ -228,12 +230,12 @@ class ModelClient:
228
230
  response = self.STUB.PostModelOutputs(request)
229
231
  if status_is_retryable(
230
232
  response.status.code) and time.time() - start_time < 60 * 10: # 10 minutes
231
- self.logger.info(f"Model predict failed with response {response.status!r}")
233
+ self.logger.info(f"Model predict failed with response {response!r}")
232
234
  time.sleep(next(backoff_iterator))
233
235
  continue
234
236
 
235
237
  if response.status.code != status_code_pb2.SUCCESS:
236
- raise Exception(f"Model predict failed with response {response.status!r}")
238
+ raise Exception(f"Model predict failed with response {response!r}")
237
239
  break
238
240
 
239
241
  return response
@@ -296,7 +298,9 @@ class ModelClient:
296
298
 
297
299
  if method_name:
298
300
  # TODO put in new proto field?
299
- request.model.model_version.output_info.params['_method_name'] = method_name
301
+ for inp in inputs:
302
+ inp.data.metadata['_method_name'] = method_name
303
+ # request.model.model_version.output_info.params['_method_name'] = method_name
300
304
  if inference_params:
301
305
  request.model.model_version.output_info.params.update(inference_params)
302
306
  if output_config:
@@ -379,7 +383,7 @@ class ModelClient:
379
383
  output_config: Dict = {}):
380
384
  request = service_pb2.PostModelOutputsRequest()
381
385
  request.CopyFrom(self.request_template)
382
- request.model.model_version.output_info.params['_method_name'] = method_name
386
+ # request.model.model_version.output_info.params['_method_name'] = method_name
383
387
  if inference_params:
384
388
  request.model.model_version.output_info.params.update(inference_params)
385
389
  if output_config:
@@ -391,6 +395,8 @@ class ModelClient:
391
395
  req.inputs.extend(inputs)
392
396
  else:
393
397
  req.inputs.append(inputs)
398
+ for inp in req.inputs:
399
+ inp.data.metadata['_method_name'] = method_name
394
400
  yield req
395
401
 
396
402
  def _stream_by_proto(self,
@@ -99,7 +99,9 @@ class ModelClass(ABC):
99
99
  outputs = []
100
100
  try:
101
101
  # TODO add method name field to proto
102
- method_name = request.inputs[0].data.metadata['method_name']
102
+ method_name = None
103
+ if len(request.inputs) > 0 and '_method_name' in request.inputs[0].data.metadata:
104
+ method_name = request.inputs[0].data.metadata['_method_name']
103
105
  # call_params = dict(request.model.model_version.output_info.params)
104
106
  # method_name = call_params.get('_method_name', 'predict')
105
107
  if method_name == '_GET_SIGNATURES': # special case to fetch signatures, TODO add endpoint for this
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: clarifai
3
- Version: 11.1.5rc5
3
+ Version: 11.1.5rc7
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=EVdSPaKg-d4UlTX2fBLmJyUiByqmV2irRQbr1CIlTyI,26
1
+ clarifai/__init__.py,sha256=tywwbtw-s_-_zaSWpFydRfgNN3Cl1l3gmoGNpj_PQvg,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
@@ -30,7 +30,7 @@ clarifai/client/deployment.py,sha256=w7Y6pA1rYG4KRK1SwusRZc2sQRXlG8wezuVdzSWpCo0
30
30
  clarifai/client/input.py,sha256=obMAHMDU1OwfXZ8KraOnGFlWzlW-3F7Ob_2lcOQMlhY,46339
31
31
  clarifai/client/lister.py,sha256=03KGMvs5RVyYqxLsSrWhNc34I8kiF1Ph0NeyEwu7nMU,2082
32
32
  clarifai/client/model.py,sha256=Z4cz-qXznbttETnH3W_LyyscGawvtBkRfaSCsdOgAvs,75334
33
- clarifai/client/model_client.py,sha256=cI9jo1tldfTISfmyA5fVb9_XLbZ94GLfUH8VRxnLS7w,16649
33
+ clarifai/client/model_client.py,sha256=OR4n1yv9wr8MBEzR14rC-2XeFoP84SGOUlSRDo1KbH0,16889
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
@@ -135,14 +135,14 @@ clarifai/runners/dockerfile_template/Dockerfile.debug~,sha256=7YOVg3adIaiudfSkfL
135
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=SyGZWUeFHcEXR99jQMi8KHgbz2Do0FQrIIkrPGpVyQI,11187
138
+ clarifai/runners/models/model_class.py,sha256=C8nncnIkw7lHY7PTrY0hq2Kd9AI17bV2KJ9_8uVzzvE,11303
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
142
142
  clarifai/runners/models/__pycache__/__init__.cpython-310.pyc,sha256=GTFjzypyx5wnDGqxYeY01iya1CELKb5fOFBFLV031yU,171
143
143
  clarifai/runners/models/__pycache__/base_typed_model.cpython-310.pyc,sha256=rr_Pxrq9MaT1keVVxBHF59pKv8-dX53B2uLscDXfbfY,8271
144
144
  clarifai/runners/models/__pycache__/model_builder.cpython-310.pyc,sha256=0C76O8ZOXrT3y6CVs53h_9cg7XkZKbSxyd6zp0UoAug,27487
145
- clarifai/runners/models/__pycache__/model_class.cpython-310.pyc,sha256=XzSQJr2iRVgLea51EEdEW-ehzmLk-7CriEsyUDDNIFA,9494
145
+ clarifai/runners/models/__pycache__/model_class.cpython-310.pyc,sha256=X5YKyOp_3_XUczns0au1R87V-urx9HzauulAtrIRCqM,9524
146
146
  clarifai/runners/models/__pycache__/model_run_locally.cpython-310.pyc,sha256=maLshBrvhTy0C6grT26JPAA14P-nD9WDWN25E2BErsE,16976
147
147
  clarifai/runners/models/__pycache__/model_runner.cpython-310.pyc,sha256=u4ZYB_TJJgvqkQ-7_yPUoKU0tT2ycwzBXuqfORwUF3Y,4999
148
148
  clarifai/runners/models/__pycache__/model_servicer.cpython-310.pyc,sha256=9QTYk4zVHBUtlTfkH3WaE6frNdN6ba57EVj4bKe18YA,2501
@@ -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.5rc5.dist-info/LICENSE,sha256=mUqF_d12-qE2n41g7C5_sq-BMLOcj6CNN-jevr15YHU,555
199
- clarifai-11.1.5rc5.dist-info/METADATA,sha256=1IhV9kk6rj0tpNSlGl9pAMmTl58-psQxnn2Mlx4th7A,22229
200
- clarifai-11.1.5rc5.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
201
- clarifai-11.1.5rc5.dist-info/entry_points.txt,sha256=X9FZ4Z-i_r2Ud1RpZ9sNIFYuu_-9fogzCMCRUD9hyX0,51
202
- clarifai-11.1.5rc5.dist-info/top_level.txt,sha256=wUMdCQGjkxaynZ6nZ9FAnvBUCgp5RJUVFSy2j-KYo0s,9
203
- clarifai-11.1.5rc5.dist-info/RECORD,,
198
+ clarifai-11.1.5rc7.dist-info/LICENSE,sha256=mUqF_d12-qE2n41g7C5_sq-BMLOcj6CNN-jevr15YHU,555
199
+ clarifai-11.1.5rc7.dist-info/METADATA,sha256=BUQnMv-en_TmdnFCw5l8HpZUJoVC_xfcwotJt4VXhw8,22229
200
+ clarifai-11.1.5rc7.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
201
+ clarifai-11.1.5rc7.dist-info/entry_points.txt,sha256=X9FZ4Z-i_r2Ud1RpZ9sNIFYuu_-9fogzCMCRUD9hyX0,51
202
+ clarifai-11.1.5rc7.dist-info/top_level.txt,sha256=wUMdCQGjkxaynZ6nZ9FAnvBUCgp5RJUVFSy2j-KYo0s,9
203
+ clarifai-11.1.5rc7.dist-info/RECORD,,