clarifai 10.8.3__tar.gz → 10.8.4__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.
- {clarifai-10.8.3/clarifai.egg-info → clarifai-10.8.4}/PKG-INFO +1 -1
- clarifai-10.8.4/clarifai/__init__.py +1 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/utils/data_handler.py +31 -44
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/utils/loader.py +6 -5
- {clarifai-10.8.3 → clarifai-10.8.4/clarifai.egg-info}/PKG-INFO +1 -1
- clarifai-10.8.3/clarifai/__init__.py +0 -1
- {clarifai-10.8.3 → clarifai-10.8.4}/LICENSE +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/MANIFEST.in +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/README.md +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/cli.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/client/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/client/app.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/client/auth/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/client/auth/helper.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/client/auth/register.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/client/auth/stub.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/client/base.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/client/dataset.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/client/input.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/client/lister.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/client/model.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/client/module.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/client/search.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/client/user.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/client/workflow.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/constants/dataset.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/constants/input.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/constants/model.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/constants/rag.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/constants/search.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/constants/workflow.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/export/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/export/inputs_annotations.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/upload/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/upload/base.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/upload/features.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/upload/image.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/upload/loaders/README.md +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/upload/loaders/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/upload/loaders/coco_captions.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/upload/loaders/coco_detection.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/upload/loaders/imagenet_classification.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/upload/loaders/xview_detection.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/upload/text.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/upload/utils.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/errors.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/api.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/README.md +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/cli/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/cli/_utils.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/cli/base.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/cli/build.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/cli/clarifai_clis.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/cli/create.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/cli/example_cli.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/cli/login.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/cli/upload.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/constants.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/docs/cli.md +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/docs/concepts.md +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/docs/dependencies.md +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/docs/inference_parameters.md +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/docs/model_types.md +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/base.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/config.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/inference_parameter.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/model_types_config/multimodal-embedder.yaml +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/model_types_config/text-classifier.yaml +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/model_types_config/text-embedder.yaml +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/model_types_config/text-to-image.yaml +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/model_types_config/text-to-text.yaml +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/model_types_config/visual-classifier.yaml +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/model_types_config/visual-detector.yaml +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/model_types_config/visual-embedder.yaml +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/model_types_config/visual-segmenter.yaml +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/output.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/triton/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/triton/serializer.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/triton/triton_config.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/triton/wrappers.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/repo_build/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/repo_build/build.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/repo_build/static_files/_requirements.txt +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/repo_build/static_files/base_test.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/repo_build/static_files/inference.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/repo_build/static_files/sample_clarifai_config.yaml +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/repo_build/static_files/test.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/repo_build/static_files/triton/model.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/utils.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/modules/README.md +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/modules/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/modules/css.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/modules/pages.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/modules/style.css +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/rag/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/rag/rag.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/rag/utils.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/dockerfile_template/Dockerfile.cpu.template +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/dockerfile_template/Dockerfile.cuda.template +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/models/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/models/base_typed_model.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/models/model_class.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/models/model_runner.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/models/model_servicer.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/models/model_upload.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/server.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/utils/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/utils/data_utils.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/utils/logging.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/utils/url_fetcher.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/schema/search.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/urls/helper.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/utils/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/utils/constants.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/utils/evaluation/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/utils/evaluation/helpers.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/utils/evaluation/main.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/utils/evaluation/testset_annotation_parser.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/utils/logging.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/utils/misc.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/utils/model_train.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/versions.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/workflows/__init__.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/workflows/export.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/workflows/utils.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai/workflows/validate.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai.egg-info/SOURCES.txt +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai.egg-info/dependency_links.txt +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai.egg-info/entry_points.txt +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai.egg-info/requires.txt +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/clarifai.egg-info/top_level.txt +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/pyproject.toml +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/requirements.txt +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/setup.cfg +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/setup.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/tests/test_app.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/tests/test_auth.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/tests/test_data_upload.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/tests/test_eval.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/tests/test_misc.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/tests/test_model_predict.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/tests/test_model_train.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/tests/test_modules.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/tests/test_rag.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/tests/test_search.py +0 -0
- {clarifai-10.8.3 → clarifai-10.8.4}/tests/test_stub.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "10.8.4"
|
@@ -4,18 +4,19 @@ import numpy as np
|
|
4
4
|
from clarifai_grpc.grpc.api import resources_pb2
|
5
5
|
from clarifai_grpc.grpc.api.status import status_code_pb2, status_pb2
|
6
6
|
from PIL import Image
|
7
|
-
from pydantic import BaseModel, ConfigDict, PrivateAttr, computed_field
|
8
7
|
|
9
8
|
from clarifai.client.auth.helper import ClarifaiAuthHelper
|
10
9
|
|
11
10
|
from .data_utils import bytes_to_image, image_to_bytes
|
12
11
|
|
13
12
|
|
14
|
-
class BaseDataHandler
|
15
|
-
_proto: Union[resources_pb2.Input, resources_pb2.Output]
|
16
|
-
_auth: ClarifaiAuthHelper = PrivateAttr(default=None)
|
13
|
+
class BaseDataHandler:
|
17
14
|
|
18
|
-
|
15
|
+
def __init__(self,
|
16
|
+
proto: Union[resources_pb2.Input, resources_pb2.Output],
|
17
|
+
auth: ClarifaiAuthHelper = None):
|
18
|
+
self._proto = proto
|
19
|
+
self._auth = auth
|
19
20
|
|
20
21
|
#
|
21
22
|
def to_python(self):
|
@@ -27,11 +28,8 @@ class BaseDataHandler(BaseModel):
|
|
27
28
|
def proto(self):
|
28
29
|
return self._proto
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
# status
|
34
|
-
@computed_field
|
31
|
+
# Status
|
32
|
+
@property
|
35
33
|
def status(self) -> status_pb2.Status:
|
36
34
|
return self._proto.status
|
37
35
|
|
@@ -40,7 +38,7 @@ class BaseDataHandler(BaseModel):
|
|
40
38
|
self._proto.status.description = description
|
41
39
|
|
42
40
|
# Text
|
43
|
-
@
|
41
|
+
@property
|
44
42
|
def text(self) -> Union[None, str]:
|
45
43
|
data = self._proto.data.text
|
46
44
|
text = None
|
@@ -48,16 +46,14 @@ class BaseDataHandler(BaseModel):
|
|
48
46
|
if data.raw:
|
49
47
|
text = data.raw
|
50
48
|
else:
|
51
|
-
# url = data.url
|
52
49
|
raise NotImplementedError
|
53
|
-
|
54
50
|
return text
|
55
51
|
|
56
52
|
def set_text(self, text: str):
|
57
53
|
self._proto.data.text.raw = text
|
58
54
|
|
59
55
|
# Image
|
60
|
-
@
|
56
|
+
@property
|
61
57
|
def image(self, format: str = "np") -> Union[None, Image.Image, np.ndarray]:
|
62
58
|
data = self._proto.data.image
|
63
59
|
image = None
|
@@ -66,13 +62,9 @@ class BaseDataHandler(BaseModel):
|
|
66
62
|
if data.base64:
|
67
63
|
image = data.base64
|
68
64
|
elif data.url:
|
69
|
-
# download url
|
70
|
-
# url = data.url
|
71
|
-
image = ...
|
72
65
|
raise NotImplementedError
|
73
66
|
image = bytes_to_image(image)
|
74
67
|
image = image if not format == "np" else np.asarray(image).astype("uint8")
|
75
|
-
|
76
68
|
return image
|
77
69
|
|
78
70
|
def set_image(self, image: Union[Image.Image, np.ndarray]):
|
@@ -81,21 +73,20 @@ class BaseDataHandler(BaseModel):
|
|
81
73
|
self._proto.data.image.base64 = image_to_bytes(image)
|
82
74
|
|
83
75
|
# Audio
|
84
|
-
@
|
76
|
+
@property
|
85
77
|
def audio(self) -> bytes:
|
86
78
|
data = self._proto.data.audio
|
87
79
|
audio = None
|
88
80
|
if data.ByteSize():
|
89
81
|
if data.base64:
|
90
82
|
audio = data.base64
|
91
|
-
|
92
83
|
return audio
|
93
84
|
|
94
85
|
def set_audio(self, audio: bytes):
|
95
86
|
self._proto.data.audio.base64 = audio
|
96
87
|
|
97
88
|
# Bboxes
|
98
|
-
@
|
89
|
+
@property
|
99
90
|
def bboxes(self, real_coord: bool = False, image_width: int = None,
|
100
91
|
image_height: int = None) -> Tuple[List, List, List]:
|
101
92
|
if real_coord:
|
@@ -123,15 +114,13 @@ class BaseDataHandler(BaseModel):
|
|
123
114
|
|
124
115
|
return xyxy, scores, concepts
|
125
116
|
|
126
|
-
def set_bboxes(
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
image_height: int = None,
|
134
|
-
):
|
117
|
+
def set_bboxes(self,
|
118
|
+
boxes: list,
|
119
|
+
scores: list,
|
120
|
+
concepts: list,
|
121
|
+
real_coord: bool = False,
|
122
|
+
image_width: int = None,
|
123
|
+
image_height: int = None):
|
135
124
|
if real_coord:
|
136
125
|
assert (image_height and
|
137
126
|
image_width), "image_height and image_width are required when `real_coord` is set"
|
@@ -159,7 +148,7 @@ class BaseDataHandler(BaseModel):
|
|
159
148
|
self._proto.data.regions = regions
|
160
149
|
|
161
150
|
# Concepts
|
162
|
-
@
|
151
|
+
@property
|
163
152
|
def concepts(self) -> Dict[str, float]:
|
164
153
|
con_scores = {}
|
165
154
|
for each in self.proto.data.concepts:
|
@@ -177,7 +166,7 @@ class BaseDataHandler(BaseModel):
|
|
177
166
|
self._proto.data.concepts.append(each)
|
178
167
|
|
179
168
|
# Embeddings
|
180
|
-
@
|
169
|
+
@property
|
181
170
|
def embeddings(self) -> List[List[float]]:
|
182
171
|
return [each.vector for each in self.proto.data.embeddings]
|
183
172
|
|
@@ -193,8 +182,7 @@ class BaseDataHandler(BaseModel):
|
|
193
182
|
# Constructors
|
194
183
|
@classmethod
|
195
184
|
def from_proto(cls, proto):
|
196
|
-
clss = cls()
|
197
|
-
clss.set_proto(proto)
|
185
|
+
clss = cls(proto=proto)
|
198
186
|
return clss
|
199
187
|
|
200
188
|
@classmethod
|
@@ -209,7 +197,7 @@ class BaseDataHandler(BaseModel):
|
|
209
197
|
concepts: Dict[str, float] = {},
|
210
198
|
embeddings: List[List[float]] = [],
|
211
199
|
) -> 'OutputDataHandler':
|
212
|
-
clss = cls()
|
200
|
+
clss = cls(proto=resources_pb2.Output())
|
213
201
|
if isinstance(image, Image.Image) or isinstance(image, np.ndarray):
|
214
202
|
clss.set_image(image)
|
215
203
|
if text:
|
@@ -224,21 +212,20 @@ class BaseDataHandler(BaseModel):
|
|
224
212
|
clss.set_embeddings(embeddings)
|
225
213
|
|
226
214
|
clss.set_status(code=status_code, description=status_description)
|
227
|
-
|
228
215
|
return clss
|
229
216
|
|
230
217
|
|
231
218
|
class InputDataHandler(BaseDataHandler):
|
232
|
-
_proto: resources_pb2.Input = resources_pb2.Input()
|
233
219
|
|
234
|
-
def
|
235
|
-
|
236
|
-
|
220
|
+
def __init__(self,
|
221
|
+
proto: resources_pb2.Input = resources_pb2.Input(),
|
222
|
+
auth: ClarifaiAuthHelper = None):
|
223
|
+
super().__init__(proto=proto, auth=auth)
|
237
224
|
|
238
225
|
|
239
226
|
class OutputDataHandler(BaseDataHandler):
|
240
|
-
_proto: resources_pb2.Output = resources_pb2.Output()
|
241
227
|
|
242
|
-
def
|
243
|
-
|
244
|
-
|
228
|
+
def __init__(self,
|
229
|
+
proto: resources_pb2.Output = resources_pb2.Output(),
|
230
|
+
auth: ClarifaiAuthHelper = None):
|
231
|
+
super().__init__(proto=proto, auth=auth)
|
@@ -28,7 +28,7 @@ class HuggingFaceLoarder:
|
|
28
28
|
raise ImportError(
|
29
29
|
"The 'huggingface_hub' package is not installed. Please install it using 'pip install huggingface_hub'."
|
30
30
|
)
|
31
|
-
if os.path.exists(checkpoint_path):
|
31
|
+
if os.path.exists(checkpoint_path) and self.validate_download(checkpoint_path):
|
32
32
|
print("Checkpoints already exist")
|
33
33
|
else:
|
34
34
|
os.makedirs(checkpoint_path, exist_ok=True)
|
@@ -41,10 +41,11 @@ class HuggingFaceLoarder:
|
|
41
41
|
except Exception as e:
|
42
42
|
print("Error downloading model checkpoints ", e)
|
43
43
|
return False
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
44
|
+
finally:
|
45
|
+
is_downloaded = self.validate_download(checkpoint_path)
|
46
|
+
if not is_downloaded:
|
47
|
+
print("Error downloading model checkpoints")
|
48
|
+
return False
|
48
49
|
return True
|
49
50
|
|
50
51
|
def validate_hf_model(self,):
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "10.8.3"
|
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
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{clarifai-10.8.3 → clarifai-10.8.4}/clarifai/datasets/upload/loaders/imagenet_classification.py
RENAMED
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/docs/inference_parameters.md
RENAMED
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
|
File without changes
|
{clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/triton/__init__.py
RENAMED
File without changes
|
{clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/triton/serializer.py
RENAMED
File without changes
|
File without changes
|
{clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/model_config/triton/wrappers.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{clarifai-10.8.3 → clarifai-10.8.4}/clarifai/models/model_serving/repo_build/static_files/test.py
RENAMED
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
|
{clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/dockerfile_template/Dockerfile.cpu.template
RENAMED
File without changes
|
{clarifai-10.8.3 → clarifai-10.8.4}/clarifai/runners/dockerfile_template/Dockerfile.cuda.template
RENAMED
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
|
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
|
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
|
File without changes
|
File without changes
|
File without changes
|