clarifai 11.2.3rc6__py3-none-any.whl → 11.2.3rc7__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 +1 -1
- clarifai/runners/models/model_class.py +6 -3
- clarifai/runners/utils/data_utils.py +10 -10
- {clarifai-11.2.3rc6.dist-info → clarifai-11.2.3rc7.dist-info}/METADATA +1 -1
- {clarifai-11.2.3rc6.dist-info → clarifai-11.2.3rc7.dist-info}/RECORD +9 -9
- {clarifai-11.2.3rc6.dist-info → clarifai-11.2.3rc7.dist-info}/LICENSE +0 -0
- {clarifai-11.2.3rc6.dist-info → clarifai-11.2.3rc7.dist-info}/WHEEL +0 -0
- {clarifai-11.2.3rc6.dist-info → clarifai-11.2.3rc7.dist-info}/entry_points.txt +0 -0
- {clarifai-11.2.3rc6.dist-info → clarifai-11.2.3rc7.dist-info}/top_level.txt +0 -0
clarifai/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "11.2.
|
1
|
+
__version__ = "11.2.3rc7"
|
@@ -107,7 +107,8 @@ class ModelClass(ABC):
|
|
107
107
|
is_convert = DataConverter.is_old_format(input.data)
|
108
108
|
if is_convert:
|
109
109
|
# convert to new format
|
110
|
-
new_data = DataConverter.convert_input_data_to_new_format(input.data,
|
110
|
+
new_data = DataConverter.convert_input_data_to_new_format(input.data,
|
111
|
+
signature.input_fields)
|
111
112
|
input.data.CopyFrom(new_data)
|
112
113
|
# convert inputs to python types
|
113
114
|
inputs = self._convert_input_protos_to_python(request.inputs, inference_params,
|
@@ -153,7 +154,8 @@ class ModelClass(ABC):
|
|
153
154
|
is_convert = DataConverter.is_old_format(input.data)
|
154
155
|
if is_convert:
|
155
156
|
# convert to new format
|
156
|
-
new_data = DataConverter.convert_input_data_to_new_format(input.data,
|
157
|
+
new_data = DataConverter.convert_input_data_to_new_format(input.data,
|
158
|
+
signature.input_fields)
|
157
159
|
input.data.CopyFrom(new_data)
|
158
160
|
inputs = self._convert_input_protos_to_python(request.inputs, inference_params,
|
159
161
|
signature.input_fields, python_param_types)
|
@@ -214,7 +216,8 @@ class ModelClass(ABC):
|
|
214
216
|
is_convert = DataConverter.is_old_format(input.data)
|
215
217
|
if is_convert:
|
216
218
|
# convert to new format
|
217
|
-
new_data = DataConverter.convert_input_data_to_new_format(input.data,
|
219
|
+
new_data = DataConverter.convert_input_data_to_new_format(input.data,
|
220
|
+
signature.input_fields)
|
218
221
|
input.data.CopyFrom(new_data)
|
219
222
|
# convert all inputs for the first request, including the first stream value
|
220
223
|
inputs = self._convert_input_protos_to_python(request.inputs, inference_params,
|
@@ -1,13 +1,13 @@
|
|
1
1
|
from io import BytesIO
|
2
|
+
from typing import List
|
2
3
|
|
4
|
+
from clarifai_grpc.grpc.api import resources_pb2
|
3
5
|
from clarifai_grpc.grpc.api.resources_pb2 import ModelTypeEnumOption
|
4
6
|
from clarifai_grpc.grpc.api.resources_pb2 import ModelTypeField as InputFieldProto
|
5
7
|
from clarifai_grpc.grpc.api.resources_pb2 import ModelTypeRangeInfo
|
6
8
|
from PIL import Image
|
7
9
|
|
8
10
|
from clarifai.runners.utils.data_types import MessageData
|
9
|
-
from clarifai_grpc.grpc.api import resources_pb2
|
10
|
-
from typing import List
|
11
11
|
|
12
12
|
|
13
13
|
def image_to_bytes(img: Image.Image, format="JPEG") -> bytes:
|
@@ -202,7 +202,7 @@ class DataConverter:
|
|
202
202
|
if field.required:
|
203
203
|
raise ValueError(f"Field {field.name} is required but not set")
|
204
204
|
return new_data
|
205
|
-
|
205
|
+
|
206
206
|
@classmethod
|
207
207
|
def _convert_field(cls, old_data: resources_pb2.Data,
|
208
208
|
field: resources_pb2.ModelTypeField) -> resources_pb2.Data:
|
@@ -221,19 +221,19 @@ class DataConverter:
|
|
221
221
|
new_data.video.CopyFrom(old_data.video)
|
222
222
|
return new_data
|
223
223
|
elif data_type == resources_pb2.ModelTypeField.DataType.BOOL:
|
224
|
-
if old_data.
|
224
|
+
if old_data.bool_value != False:
|
225
225
|
new_data.bool_value = old_data.bool_value
|
226
226
|
return new_data
|
227
227
|
elif data_type == resources_pb2.ModelTypeField.DataType.INT:
|
228
|
-
if old_data.
|
228
|
+
if old_data.int_value != 0:
|
229
229
|
new_data.int_value = old_data.int_value
|
230
230
|
return new_data
|
231
231
|
elif data_type == resources_pb2.ModelTypeField.DataType.FLOAT:
|
232
|
-
if old_data.
|
232
|
+
if old_data.float_value != 0.0:
|
233
233
|
new_data.float_value = old_data.float_value
|
234
234
|
return new_data
|
235
235
|
elif data_type == resources_pb2.ModelTypeField.DataType.BYTES:
|
236
|
-
if old_data.
|
236
|
+
if old_data.bytes_value != b"":
|
237
237
|
new_data.bytes_value = old_data.bytes_value
|
238
238
|
return new_data
|
239
239
|
elif data_type == resources_pb2.ModelTypeField.DataType.NDARRAY:
|
@@ -299,7 +299,7 @@ class DataConverter:
|
|
299
299
|
return True
|
300
300
|
|
301
301
|
return False
|
302
|
-
|
302
|
+
|
303
303
|
@classmethod
|
304
304
|
def convert_output_data_to_old_format(cls, data: resources_pb2.Data) -> resources_pb2.Data:
|
305
305
|
"""Convert output data to old format."""
|
@@ -311,7 +311,7 @@ class DataConverter:
|
|
311
311
|
old_data.text.raw = old_data.string_value
|
312
312
|
|
313
313
|
return old_data
|
314
|
-
|
314
|
+
|
315
315
|
@classmethod
|
316
316
|
def _is_data_set(cls, data_msg):
|
317
317
|
# Singular message fields
|
@@ -334,4 +334,4 @@ class DataConverter:
|
|
334
334
|
data_msg.bool_value is True or data_msg.string_value != ""):
|
335
335
|
return True
|
336
336
|
|
337
|
-
return False
|
337
|
+
return False
|
@@ -1,4 +1,4 @@
|
|
1
|
-
clarifai/__init__.py,sha256=
|
1
|
+
clarifai/__init__.py,sha256=h2DeEucugdY0uLWmoAofTR6ESxYfmPbOqpFlfRxLZKU,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
|
@@ -139,7 +139,7 @@ clarifai/runners/dockerfile_template/Dockerfile.template,sha256=5cjv7U8PmWa3DB_5
|
|
139
139
|
clarifai/runners/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
140
140
|
clarifai/runners/models/base_typed_model.py,sha256=0QCWxch8CcyJSKvE1D4PILd2RSnQZHTmx4DXlQQ6dpo,7856
|
141
141
|
clarifai/runners/models/model_builder.py,sha256=vJXYrxBwuayanMquAPwFOv9z7U5EQ2aIdppl8DfTGgQ,36900
|
142
|
-
clarifai/runners/models/model_class.py,sha256=
|
142
|
+
clarifai/runners/models/model_class.py,sha256=3pS-OQA0cvaWQ0IB2M3K-kylp1gtY2V9il_J8Mb_kOM,14662
|
143
143
|
clarifai/runners/models/model_class_refract.py,sha256=HxuozxSW7ag5yWCPxjNwgLArQ6dORhyGXlnpPaZz2-c,3211
|
144
144
|
clarifai/runners/models/model_run_locally.py,sha256=m5uLlXpWVGuQIJv-XBt-sHGx1gD8w6d77f9b85DOZqs,18170
|
145
145
|
clarifai/runners/models/model_runner.py,sha256=T4Qn_x0vky7XdeS54bvipzEmKZMra1tQdAu_u01yyjc,6503
|
@@ -161,7 +161,7 @@ clarifai/runners/utils/const.py,sha256=bwj-Pcw558-pasdIFbNhnkn-9oiCdojYH1fNTTUG2
|
|
161
161
|
clarifai/runners/utils/data_handler.py,sha256=b7k6MWYPXSgjrfw6wsDf82xFYa0D7UjYmjE4mw5HzHM,8499
|
162
162
|
clarifai/runners/utils/data_handler_refract.py,sha256=3M-V4hkOoF-9Ix4hE6ocXWiTJPc9dewtu6FMtddd-jQ,6343
|
163
163
|
clarifai/runners/utils/data_types.py,sha256=bFRKVl2s6Mmx0bQn_lKwbqxBET9wtIEf0Tk6PAIc6ko,12465
|
164
|
-
clarifai/runners/utils/data_utils.py,sha256=
|
164
|
+
clarifai/runners/utils/data_utils.py,sha256=7njBh0-_WzwvLgwd-JkALt9s6rjvhEEPgkWn5qAMyfo,11350
|
165
165
|
clarifai/runners/utils/loader.py,sha256=SgNHMwRmCCymFQm8aDp73NmIUHhM-N60CBlTKbPzmVc,7470
|
166
166
|
clarifai/runners/utils/logger.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
167
167
|
clarifai/runners/utils/method_signatures.py,sha256=mr0d0hs-og2icwZn7DmiZqzOMnEqY-ZBW0mheselsZE,18134
|
@@ -230,9 +230,9 @@ clarifai/workflows/__pycache__/__init__.cpython-39.pyc,sha256=9nA--jULSW7OFrYOcs
|
|
230
230
|
clarifai/workflows/__pycache__/export.cpython-310.pyc,sha256=phEGwi2gAojCUhRTqjZVeTDn7Gk6LCVBeSTjAj4m9iY,2418
|
231
231
|
clarifai/workflows/__pycache__/utils.cpython-310.pyc,sha256=M9_KTM7GOOS5SPrWwAzqHDqyGvgKi3xuSGvyw6MNf-I,1925
|
232
232
|
clarifai/workflows/__pycache__/validate.cpython-310.pyc,sha256=c18Jgp_-CAm8RD_tmUpDCPoqZeexaoWELG0yBzb9rjw,2149
|
233
|
-
clarifai-11.2.
|
234
|
-
clarifai-11.2.
|
235
|
-
clarifai-11.2.
|
236
|
-
clarifai-11.2.
|
237
|
-
clarifai-11.2.
|
238
|
-
clarifai-11.2.
|
233
|
+
clarifai-11.2.3rc7.dist-info/LICENSE,sha256=mUqF_d12-qE2n41g7C5_sq-BMLOcj6CNN-jevr15YHU,555
|
234
|
+
clarifai-11.2.3rc7.dist-info/METADATA,sha256=P-5SeZiUhgGMdQ3p3t25w-N295aclXp5sZQ0jM5tcuc,22453
|
235
|
+
clarifai-11.2.3rc7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
236
|
+
clarifai-11.2.3rc7.dist-info/entry_points.txt,sha256=X9FZ4Z-i_r2Ud1RpZ9sNIFYuu_-9fogzCMCRUD9hyX0,51
|
237
|
+
clarifai-11.2.3rc7.dist-info/top_level.txt,sha256=wUMdCQGjkxaynZ6nZ9FAnvBUCgp5RJUVFSy2j-KYo0s,9
|
238
|
+
clarifai-11.2.3rc7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|