clarifai 11.1.7rc4__py3-none-any.whl → 11.1.7rc5__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_builder.py +9 -8
- {clarifai-11.1.7rc4.dist-info → clarifai-11.1.7rc5.dist-info}/METADATA +1 -1
- {clarifai-11.1.7rc4.dist-info → clarifai-11.1.7rc5.dist-info}/RECORD +8 -8
- {clarifai-11.1.7rc4.dist-info → clarifai-11.1.7rc5.dist-info}/LICENSE +0 -0
- {clarifai-11.1.7rc4.dist-info → clarifai-11.1.7rc5.dist-info}/WHEEL +0 -0
- {clarifai-11.1.7rc4.dist-info → clarifai-11.1.7rc5.dist-info}/entry_points.txt +0 -0
- {clarifai-11.1.7rc4.dist-info → clarifai-11.1.7rc5.dist-info}/top_level.txt +0 -0
clarifai/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "11.1.
|
1
|
+
__version__ = "11.1.7rc5"
|
@@ -68,11 +68,11 @@ class ModelBuilder:
|
|
68
68
|
self.inference_compute_info = self._get_inference_compute_info()
|
69
69
|
self.is_v3 = True # Do model build for v3
|
70
70
|
|
71
|
-
def create_model_instance(self, load_model=True):
|
71
|
+
def create_model_instance(self, load_model=True, mocking=False):
|
72
72
|
"""
|
73
73
|
Create an instance of the model class, as specified in the config file.
|
74
74
|
"""
|
75
|
-
model_class = self.load_model_class()
|
75
|
+
model_class = self.load_model_class(mocking=mocking)
|
76
76
|
|
77
77
|
# initialize the model
|
78
78
|
model = model_class()
|
@@ -80,7 +80,7 @@ class ModelBuilder:
|
|
80
80
|
model.load_model()
|
81
81
|
return model
|
82
82
|
|
83
|
-
def load_model_class(self):
|
83
|
+
def load_model_class(self, mocking=False):
|
84
84
|
"""
|
85
85
|
Import the model class from the model.py file, dynamically handling missing dependencies
|
86
86
|
"""
|
@@ -108,9 +108,10 @@ class ModelBuilder:
|
|
108
108
|
|
109
109
|
# Mock all third-party imports to avoid ImportErrors or other issues
|
110
110
|
return MagicMock()
|
111
|
-
|
112
|
-
|
113
|
-
|
111
|
+
|
112
|
+
if mocking:
|
113
|
+
# Replace the built-in __import__ function with our custom one
|
114
|
+
builtins.__import__ = custom_import
|
114
115
|
|
115
116
|
try:
|
116
117
|
spec.loader.exec_module(module)
|
@@ -306,7 +307,7 @@ class ModelBuilder:
|
|
306
307
|
"""
|
307
308
|
Returns the method signatures for the model class in YAML format.
|
308
309
|
"""
|
309
|
-
model_class = self.load_model_class()
|
310
|
+
model_class = self.load_model_class(mocking=True)
|
310
311
|
method_info = model_class._get_method_info()
|
311
312
|
signatures = {method.name: method.signature for method in method_info.values()}
|
312
313
|
return signatures_to_yaml(signatures)
|
@@ -315,7 +316,7 @@ class ModelBuilder:
|
|
315
316
|
"""
|
316
317
|
Returns the method signatures for the model class.
|
317
318
|
"""
|
318
|
-
model_class = self.load_model_class()
|
319
|
+
model_class = self.load_model_class(mocking=True)
|
319
320
|
method_info = model_class._get_method_info()
|
320
321
|
signatures = [method.signature for method in method_info.values()]
|
321
322
|
return signatures
|
@@ -1,4 +1,4 @@
|
|
1
|
-
clarifai/__init__.py,sha256=
|
1
|
+
clarifai/__init__.py,sha256=L7ecgzwVF1qIM4sX3JzNrp3tI1YSfegldgbqVv-b-HQ,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
|
@@ -138,7 +138,7 @@ clarifai/runners/dockerfile_template/Dockerfile.nim,sha256=CSdUAehj3uOwminioLnT5
|
|
138
138
|
clarifai/runners/dockerfile_template/Dockerfile.template,sha256=5cjv7U8PmWa3DB_5B1CqSYh_6GE0E0np52TIAa7EIDE,2312
|
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
|
-
clarifai/runners/models/model_builder.py,sha256=
|
141
|
+
clarifai/runners/models/model_builder.py,sha256=DDE4s1yzomsGyl4PbpjKdiofM6VhL0sgZujCP6wvF2k,34881
|
142
142
|
clarifai/runners/models/model_class.py,sha256=qK5qk4geoFpqrRtl4VmKK90CIJKyWmD_vjJMqLWR_CQ,11854
|
143
143
|
clarifai/runners/models/model_class_refract.py,sha256=HxuozxSW7ag5yWCPxjNwgLArQ6dORhyGXlnpPaZz2-c,3211
|
144
144
|
clarifai/runners/models/model_run_locally.py,sha256=VZetm9Mko8MBjcjwr6PCnTU9gF3glgD5qvpbj-8tW2s,17962
|
@@ -229,9 +229,9 @@ clarifai/workflows/__pycache__/__init__.cpython-39.pyc,sha256=9nA--jULSW7OFrYOcs
|
|
229
229
|
clarifai/workflows/__pycache__/export.cpython-310.pyc,sha256=phEGwi2gAojCUhRTqjZVeTDn7Gk6LCVBeSTjAj4m9iY,2418
|
230
230
|
clarifai/workflows/__pycache__/utils.cpython-310.pyc,sha256=M9_KTM7GOOS5SPrWwAzqHDqyGvgKi3xuSGvyw6MNf-I,1925
|
231
231
|
clarifai/workflows/__pycache__/validate.cpython-310.pyc,sha256=c18Jgp_-CAm8RD_tmUpDCPoqZeexaoWELG0yBzb9rjw,2149
|
232
|
-
clarifai-11.1.
|
233
|
-
clarifai-11.1.
|
234
|
-
clarifai-11.1.
|
235
|
-
clarifai-11.1.
|
236
|
-
clarifai-11.1.
|
237
|
-
clarifai-11.1.
|
232
|
+
clarifai-11.1.7rc5.dist-info/LICENSE,sha256=mUqF_d12-qE2n41g7C5_sq-BMLOcj6CNN-jevr15YHU,555
|
233
|
+
clarifai-11.1.7rc5.dist-info/METADATA,sha256=tOQbvNsbo_DjwJRDarrhk1uAgnSjSCDfdlcaUucYhI8,22215
|
234
|
+
clarifai-11.1.7rc5.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
235
|
+
clarifai-11.1.7rc5.dist-info/entry_points.txt,sha256=X9FZ4Z-i_r2Ud1RpZ9sNIFYuu_-9fogzCMCRUD9hyX0,51
|
236
|
+
clarifai-11.1.7rc5.dist-info/top_level.txt,sha256=wUMdCQGjkxaynZ6nZ9FAnvBUCgp5RJUVFSy2j-KYo0s,9
|
237
|
+
clarifai-11.1.7rc5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|