clarifai 11.4.3rc1__py3-none-any.whl → 11.4.4__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/cli/base.py +1 -2
- clarifai/cli/model.py +0 -2
- clarifai/client/app.py +2 -1
- clarifai/client/auth/helper.py +6 -4
- clarifai/client/compute_cluster.py +2 -1
- clarifai/client/dataset.py +2 -1
- clarifai/client/deployment.py +2 -1
- clarifai/client/input.py +2 -1
- clarifai/client/model.py +2 -1
- clarifai/client/model_client.py +2 -2
- clarifai/client/module.py +2 -1
- clarifai/client/nodepool.py +2 -1
- clarifai/client/runner.py +2 -1
- clarifai/client/search.py +2 -1
- clarifai/client/user.py +2 -1
- clarifai/client/workflow.py +2 -1
- clarifai/runners/models/mcp_class.py +6 -35
- clarifai/runners/models/model_builder.py +46 -42
- clarifai/runners/utils/code_script.py +40 -11
- clarifai/runners/utils/data_types/data_types.py +48 -0
- clarifai/runners/utils/data_utils.py +67 -43
- clarifai/runners/utils/method_signatures.py +0 -20
- clarifai/runners/utils/openai_convertor.py +103 -0
- clarifai/urls/helper.py +80 -12
- clarifai/utils/config.py +1 -1
- clarifai/utils/constants.py +4 -0
- {clarifai-11.4.3rc1.dist-info → clarifai-11.4.4.dist-info}/METADATA +13 -2
- clarifai-11.4.4.dist-info/RECORD +112 -0
- {clarifai-11.4.3rc1.dist-info → clarifai-11.4.4.dist-info}/WHEEL +1 -1
- clarifai/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai/__pycache__/errors.cpython-312.pyc +0 -0
- clarifai/__pycache__/errors.cpython-39.pyc +0 -0
- clarifai/__pycache__/versions.cpython-312.pyc +0 -0
- clarifai/__pycache__/versions.cpython-39.pyc +0 -0
- clarifai/cli/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/cli/__pycache__/base.cpython-312.pyc +0 -0
- clarifai/cli/__pycache__/compute_cluster.cpython-312.pyc +0 -0
- clarifai/cli/__pycache__/deployment.cpython-312.pyc +0 -0
- clarifai/cli/__pycache__/model.cpython-312.pyc +0 -0
- clarifai/cli/__pycache__/nodepool.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai/client/__pycache__/app.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/app.cpython-39.pyc +0 -0
- clarifai/client/__pycache__/base.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/base.cpython-39.pyc +0 -0
- clarifai/client/__pycache__/compute_cluster.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/dataset.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/deployment.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/input.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/lister.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/model.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/model_client.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/module.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/nodepool.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/runner.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/search.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/user.cpython-312.pyc +0 -0
- clarifai/client/__pycache__/workflow.cpython-312.pyc +0 -0
- clarifai/client/auth/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/client/auth/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai/client/auth/__pycache__/helper.cpython-312.pyc +0 -0
- clarifai/client/auth/__pycache__/helper.cpython-39.pyc +0 -0
- clarifai/client/auth/__pycache__/register.cpython-312.pyc +0 -0
- clarifai/client/auth/__pycache__/register.cpython-39.pyc +0 -0
- clarifai/client/auth/__pycache__/stub.cpython-312.pyc +0 -0
- clarifai/client/auth/__pycache__/stub.cpython-39.pyc +0 -0
- clarifai/constants/__pycache__/base.cpython-312.pyc +0 -0
- clarifai/constants/__pycache__/base.cpython-39.pyc +0 -0
- clarifai/constants/__pycache__/dataset.cpython-312.pyc +0 -0
- clarifai/constants/__pycache__/input.cpython-312.pyc +0 -0
- clarifai/constants/__pycache__/model.cpython-312.pyc +0 -0
- clarifai/constants/__pycache__/rag.cpython-312.pyc +0 -0
- clarifai/constants/__pycache__/search.cpython-312.pyc +0 -0
- clarifai/constants/__pycache__/workflow.cpython-312.pyc +0 -0
- clarifai/datasets/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/datasets/export/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/datasets/export/__pycache__/inputs_annotations.cpython-312.pyc +0 -0
- clarifai/datasets/upload/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/datasets/upload/__pycache__/base.cpython-312.pyc +0 -0
- clarifai/datasets/upload/__pycache__/features.cpython-312.pyc +0 -0
- clarifai/datasets/upload/__pycache__/image.cpython-312.pyc +0 -0
- clarifai/datasets/upload/__pycache__/multimodal.cpython-312.pyc +0 -0
- clarifai/datasets/upload/__pycache__/text.cpython-312.pyc +0 -0
- clarifai/datasets/upload/__pycache__/utils.cpython-312.pyc +0 -0
- clarifai/datasets/upload/loaders/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/datasets/upload/loaders/__pycache__/coco_detection.cpython-312.pyc +0 -0
- clarifai/datasets/upload/loaders/__pycache__/imagenet_classification.cpython-312.pyc +0 -0
- clarifai/modules/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/modules/__pycache__/css.cpython-312.pyc +0 -0
- clarifai/rag/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/rag/__pycache__/rag.cpython-312.pyc +0 -0
- clarifai/rag/__pycache__/utils.cpython-312.pyc +0 -0
- clarifai/runners/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/runners/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai/runners/__pycache__/server.cpython-312.pyc +0 -0
- clarifai/runners/models/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/runners/models/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai/runners/models/__pycache__/base_typed_model.cpython-312.pyc +0 -0
- clarifai/runners/models/__pycache__/mcp_class.cpython-312.pyc +0 -0
- clarifai/runners/models/__pycache__/model_builder.cpython-312.pyc +0 -0
- clarifai/runners/models/__pycache__/model_builder.cpython-39.pyc +0 -0
- clarifai/runners/models/__pycache__/model_class.cpython-312.pyc +0 -0
- clarifai/runners/models/__pycache__/model_run_locally.cpython-312.pyc +0 -0
- clarifai/runners/models/__pycache__/model_runner.cpython-312.pyc +0 -0
- clarifai/runners/models/__pycache__/model_servicer.cpython-312.pyc +0 -0
- clarifai/runners/models/__pycache__/test_model_builder.cpython-312-pytest-8.3.5.pyc +0 -0
- clarifai/runners/models/base_typed_model.py +0 -238
- clarifai/runners/models/example_mcp_server.py +0 -44
- clarifai/runners/models/mcp_class.py~ +0 -149
- clarifai/runners/models/test_model_builder.py +0 -89
- clarifai/runners/utils/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/runners/utils/__pycache__/code_script.cpython-312.pyc +0 -0
- clarifai/runners/utils/__pycache__/const.cpython-312.pyc +0 -0
- clarifai/runners/utils/__pycache__/data_handler.cpython-312.pyc +0 -0
- clarifai/runners/utils/__pycache__/data_types.cpython-312.pyc +0 -0
- clarifai/runners/utils/__pycache__/data_utils.cpython-312.pyc +0 -0
- clarifai/runners/utils/__pycache__/loader.cpython-312.pyc +0 -0
- clarifai/runners/utils/__pycache__/method_signatures.cpython-312.pyc +0 -0
- clarifai/runners/utils/__pycache__/serializers.cpython-312.pyc +0 -0
- clarifai/runners/utils/__pycache__/url_fetcher.cpython-312.pyc +0 -0
- clarifai/runners/utils/data_handler.py +0 -231
- clarifai/runners/utils/data_types/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/runners/utils/data_types/__pycache__/data_types.cpython-312.pyc +0 -0
- clarifai/schema/__pycache__/search.cpython-312.pyc +0 -0
- clarifai/urls/__pycache__/helper.cpython-312.pyc +0 -0
- clarifai/utils/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/utils/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai/utils/__pycache__/cli.cpython-312.pyc +0 -0
- clarifai/utils/__pycache__/config.cpython-312.pyc +0 -0
- clarifai/utils/__pycache__/constants.cpython-312.pyc +0 -0
- clarifai/utils/__pycache__/constants.cpython-39.pyc +0 -0
- clarifai/utils/__pycache__/logging.cpython-312.pyc +0 -0
- clarifai/utils/__pycache__/logging.cpython-39.pyc +0 -0
- clarifai/utils/__pycache__/misc.cpython-312.pyc +0 -0
- clarifai/utils/__pycache__/misc.cpython-39.pyc +0 -0
- clarifai/utils/__pycache__/model_train.cpython-312.pyc +0 -0
- clarifai/utils/__pycache__/protobuf.cpython-312.pyc +0 -0
- clarifai/utils/config.py~ +0 -145
- clarifai/utils/evaluation/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/utils/evaluation/__pycache__/helpers.cpython-312.pyc +0 -0
- clarifai/utils/evaluation/__pycache__/main.cpython-312.pyc +0 -0
- clarifai/workflows/__pycache__/__init__.cpython-312.pyc +0 -0
- clarifai/workflows/__pycache__/export.cpython-312.pyc +0 -0
- clarifai/workflows/__pycache__/utils.cpython-312.pyc +0 -0
- clarifai/workflows/__pycache__/validate.cpython-312.pyc +0 -0
- clarifai-11.4.3rc1.dist-info/RECORD +0 -230
- {clarifai-11.4.3rc1.dist-info → clarifai-11.4.4.dist-info}/entry_points.txt +0 -0
- {clarifai-11.4.3rc1.dist-info → clarifai-11.4.4.dist-info/licenses}/LICENSE +0 -0
- {clarifai-11.4.3rc1.dist-info → clarifai-11.4.4.dist-info}/top_level.txt +0 -0
@@ -395,6 +395,22 @@ class Image(MessageData):
|
|
395
395
|
raise ValueError("Image has no bytes")
|
396
396
|
return PILImage.open(io.BytesIO(self.proto.base64))
|
397
397
|
|
398
|
+
def to_base64_str(self) -> str:
|
399
|
+
if not self.proto.base64:
|
400
|
+
raise ValueError("Image has no bytes")
|
401
|
+
if isinstance(self.proto.base64, str):
|
402
|
+
return self.proto.base64
|
403
|
+
if isinstance(self.proto.base64, bytes):
|
404
|
+
try:
|
405
|
+
# trying direct decode (if already a base64 bytes)
|
406
|
+
return self.proto.base64.decode('utf-8')
|
407
|
+
except UnicodeDecodeError:
|
408
|
+
import base64
|
409
|
+
|
410
|
+
return base64.b64encode(self.proto.base64).decode('utf-8')
|
411
|
+
else:
|
412
|
+
raise TypeError("Expected str or bytes for Image.base64")
|
413
|
+
|
398
414
|
def to_numpy(self) -> np.ndarray:
|
399
415
|
return np.asarray(self.to_pil())
|
400
416
|
|
@@ -466,6 +482,22 @@ class Audio(MessageData):
|
|
466
482
|
def to_proto(self) -> AudioProto:
|
467
483
|
return self.proto
|
468
484
|
|
485
|
+
def to_base64_str(self) -> str:
|
486
|
+
if not self.proto.base64:
|
487
|
+
raise ValueError("Audio has no bytes")
|
488
|
+
if isinstance(self.proto.base64, str):
|
489
|
+
return self.proto.base64
|
490
|
+
if isinstance(self.proto.base64, bytes):
|
491
|
+
try:
|
492
|
+
# trying direct decode (if already a base64 bytes)
|
493
|
+
return self.proto.base64.decode('utf-8')
|
494
|
+
except UnicodeDecodeError:
|
495
|
+
import base64
|
496
|
+
|
497
|
+
return base64.b64encode(self.proto.base64).decode('utf-8')
|
498
|
+
else:
|
499
|
+
raise TypeError("Expected str or bytes for Audio.base64")
|
500
|
+
|
469
501
|
@classmethod
|
470
502
|
def from_proto(cls, proto: AudioProto) -> "Audio":
|
471
503
|
return cls(proto)
|
@@ -578,6 +610,22 @@ class Video(MessageData):
|
|
578
610
|
def to_proto(self) -> VideoProto:
|
579
611
|
return self.proto
|
580
612
|
|
613
|
+
def to_base64_str(self) -> str:
|
614
|
+
if not self.proto.base64:
|
615
|
+
raise ValueError("Video has no bytes")
|
616
|
+
if isinstance(self.proto.base64, str):
|
617
|
+
return self.proto.base64
|
618
|
+
if isinstance(self.proto.base64, bytes):
|
619
|
+
try:
|
620
|
+
# trying direct decode (if already a base64 bytes)
|
621
|
+
return self.proto.base64.decode('utf-8')
|
622
|
+
except UnicodeDecodeError:
|
623
|
+
import base64
|
624
|
+
|
625
|
+
return base64.b64encode(self.proto.base64).decode('utf-8')
|
626
|
+
else:
|
627
|
+
raise TypeError("Expected str or bytes for Video.base64")
|
628
|
+
|
581
629
|
@classmethod
|
582
630
|
def from_proto(cls, proto: VideoProto) -> "Video":
|
583
631
|
return cls(proto)
|
@@ -1,63 +1,89 @@
|
|
1
|
+
import base64
|
1
2
|
import json
|
2
3
|
import math
|
3
4
|
import operator
|
4
5
|
from io import BytesIO
|
5
|
-
from typing import List
|
6
|
+
from typing import Dict, List
|
6
7
|
|
8
|
+
import requests
|
7
9
|
from clarifai_grpc.grpc.api import resources_pb2
|
8
10
|
from clarifai_grpc.grpc.api.resources_pb2 import ModelTypeEnumOption, ModelTypeRangeInfo
|
9
11
|
from clarifai_grpc.grpc.api.resources_pb2 import ModelTypeField as ParamProto
|
10
|
-
from PIL import Image
|
12
|
+
from PIL import Image as PILImage
|
11
13
|
|
12
|
-
from clarifai.runners.utils.data_types import MessageData
|
14
|
+
from clarifai.runners.utils.data_types import Audio, Image, MessageData, Video
|
13
15
|
|
14
16
|
|
15
|
-
def image_to_bytes(img:
|
17
|
+
def image_to_bytes(img: PILImage.Image, format="JPEG") -> bytes:
|
16
18
|
buffered = BytesIO()
|
17
19
|
img.save(buffered, format=format)
|
18
20
|
img_str = buffered.getvalue()
|
19
21
|
return img_str
|
20
22
|
|
21
23
|
|
22
|
-
def bytes_to_image(bytes_img) ->
|
23
|
-
img =
|
24
|
+
def bytes_to_image(bytes_img) -> PILImage.Image:
|
25
|
+
img = PILImage.open(BytesIO(bytes_img))
|
24
26
|
return img
|
25
27
|
|
26
28
|
|
27
|
-
def
|
28
|
-
"""
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
return
|
29
|
+
def process_image(image: Image) -> Dict:
|
30
|
+
"""Convert Clarifai Image object to OpenAI image format."""
|
31
|
+
|
32
|
+
if image.bytes:
|
33
|
+
b64_img = image.to_base64_str()
|
34
|
+
return {'type': 'image_url', 'image_url': {'url': f"data:image/jpeg;base64,{b64_img}"}}
|
35
|
+
elif image.url:
|
36
|
+
return {'type': 'image_url', 'image_url': {'url': image.url}}
|
37
|
+
else:
|
38
|
+
raise ValueError("Image must contain either bytes or URL")
|
39
|
+
|
40
|
+
|
41
|
+
def process_audio(audio: Audio) -> Dict:
|
42
|
+
"""Convert Clarifai Audio object to OpenAI audio format."""
|
43
|
+
|
44
|
+
if audio.bytes:
|
45
|
+
audio = audio.to_base64_str()
|
46
|
+
audio = {
|
47
|
+
"type": "input_audio",
|
48
|
+
"input_audio": {"data": audio, "format": "wav"},
|
49
|
+
}
|
50
|
+
elif audio.url:
|
51
|
+
response = requests.get(audio.url)
|
52
|
+
if response.status_code != 200:
|
53
|
+
raise ValueError(f"Failed to fetch audio from URL: {audio.url}")
|
54
|
+
audio_base64_str = base64.b64encode(response.content).decode('utf-8')
|
55
|
+
audio = {
|
56
|
+
"type": "input_audio",
|
57
|
+
"input_audio": {"data": audio_base64_str, "format": "wav"},
|
58
|
+
}
|
59
|
+
else:
|
60
|
+
raise ValueError("Audio must contain either bytes or URL")
|
61
|
+
|
62
|
+
return audio
|
63
|
+
|
64
|
+
|
65
|
+
def process_video(video: Video) -> Dict:
|
66
|
+
"""Convert Clarifai Video object to OpenAI video format."""
|
67
|
+
|
68
|
+
if video.bytes:
|
69
|
+
video = "data:video/mp4;base64," + video.to_base64_str()
|
70
|
+
video = {
|
71
|
+
"type": "video_url",
|
72
|
+
"video_url": {"url": video},
|
73
|
+
}
|
74
|
+
elif video.url:
|
75
|
+
response = requests.get(video.url)
|
76
|
+
if response.status_code != 200:
|
77
|
+
raise ValueError(f"Failed to fetch video from URL: {video.url}")
|
78
|
+
video_base64_str = base64.b64encode(response.content).decode('utf-8')
|
79
|
+
video = {
|
80
|
+
"type": "video_url",
|
81
|
+
"video_url": {"url": video_base64_str},
|
82
|
+
}
|
83
|
+
else:
|
84
|
+
raise ValueError("Video must contain either bytes or URL")
|
85
|
+
|
86
|
+
return video
|
61
87
|
|
62
88
|
|
63
89
|
class Param(MessageData):
|
@@ -294,9 +320,7 @@ class Param(MessageData):
|
|
294
320
|
proto.model_type_range_info.CopyFrom(range_info)
|
295
321
|
proto.is_param = self.is_param
|
296
322
|
|
297
|
-
|
298
|
-
proto = self.set_default(proto, self.default)
|
299
|
-
|
323
|
+
proto = self.set_default(proto, self.default)
|
300
324
|
return proto
|
301
325
|
|
302
326
|
@classmethod
|
@@ -74,32 +74,12 @@ def build_function_signature(func):
|
|
74
74
|
assert method_type in ('UNARY_UNARY', 'UNARY_STREAMING', 'STREAMING_STREAMING')
|
75
75
|
# method_signature.method_type = method_type
|
76
76
|
method_signature.description = inspect.cleandoc(func.__doc__ or '')
|
77
|
-
# method_signature.annotations_json = json.dumps(_get_annotations_source(func))
|
78
77
|
|
79
78
|
method_signature.input_fields.extend(input_sigs)
|
80
79
|
method_signature.output_fields.append(output_sig)
|
81
80
|
return method_signature
|
82
81
|
|
83
82
|
|
84
|
-
# def _get_annotations_source(func):
|
85
|
-
# """Extracts raw annotation strings from the function source."""
|
86
|
-
# source = inspect.getsource(func) # Get function source code
|
87
|
-
# source = textwrap.dedent(source) # Dedent source code
|
88
|
-
# tree = ast.parse(source) # Parse into AST
|
89
|
-
# func_node = next(node for node in tree.body
|
90
|
-
# if isinstance(node, ast.FunctionDef)) # Get function node
|
91
|
-
|
92
|
-
# annotations = {}
|
93
|
-
# for arg in func_node.args.args: # Process arguments
|
94
|
-
# if arg.annotation:
|
95
|
-
# annotations[arg.arg] = ast.unparse(arg.annotation) # Get raw annotation string
|
96
|
-
|
97
|
-
# if func_node.returns: # Process return type
|
98
|
-
# annotations["return"] = ast.unparse(func_node.returns)
|
99
|
-
|
100
|
-
# return annotations
|
101
|
-
|
102
|
-
|
103
83
|
def _process_input_field(field: resources_pb2.ModelTypeField) -> str:
|
104
84
|
base_type = _get_base_type(field)
|
105
85
|
if field.iterator:
|
@@ -1,5 +1,9 @@
|
|
1
1
|
import time
|
2
2
|
import uuid
|
3
|
+
from typing import Dict, List
|
4
|
+
|
5
|
+
from clarifai.runners.utils.data_types import Audio, Image, Video
|
6
|
+
from clarifai.runners.utils.data_utils import process_audio, process_image, process_video
|
3
7
|
|
4
8
|
|
5
9
|
def generate_id():
|
@@ -164,3 +168,102 @@ def openai_to_hf_messages(openai_messages):
|
|
164
168
|
hf_messages.append({'role': role, 'content': hf_content})
|
165
169
|
|
166
170
|
return hf_messages
|
171
|
+
|
172
|
+
|
173
|
+
def build_openai_messages(
|
174
|
+
prompt: str = None,
|
175
|
+
image: Image = None,
|
176
|
+
images: List[Image] = None,
|
177
|
+
audio: Audio = None,
|
178
|
+
audios: List[Audio] = None,
|
179
|
+
video: Video = None,
|
180
|
+
videos: List[Video] = None,
|
181
|
+
messages: List[Dict] = None,
|
182
|
+
) -> List[Dict]:
|
183
|
+
"""
|
184
|
+
Construct OpenAI-compatible messages from input components.
|
185
|
+
Args:
|
186
|
+
prompt (str): The prompt text.
|
187
|
+
image (Image): Clarifai Image object.
|
188
|
+
images (List[Image]): List of Clarifai Image objects.
|
189
|
+
audio (Audio): Clarifai Audio object.
|
190
|
+
audios (List[Audio]): List of Clarifai Audio objects.
|
191
|
+
video (Video): Clarifai Video object.
|
192
|
+
videos (List[Video]): List of Clarifai Video objects.
|
193
|
+
messages (List[Dict]): List of chat messages.
|
194
|
+
Returns:
|
195
|
+
List[Dict]: Formatted chat messages.
|
196
|
+
"""
|
197
|
+
|
198
|
+
openai_messages = []
|
199
|
+
# Add previous conversation history
|
200
|
+
if messages and is_openai_chat_format(messages):
|
201
|
+
openai_messages.extend(messages)
|
202
|
+
|
203
|
+
content = []
|
204
|
+
if prompt.strip():
|
205
|
+
# Build content array for current message
|
206
|
+
content.append({'type': 'text', 'text': prompt})
|
207
|
+
# Add single image if present
|
208
|
+
if image:
|
209
|
+
content.append(process_image(image))
|
210
|
+
# Add multiple images if present
|
211
|
+
if images:
|
212
|
+
for img in images:
|
213
|
+
content.append(process_image(img))
|
214
|
+
# Add single audio if present
|
215
|
+
if audio:
|
216
|
+
content.append(process_audio(audio))
|
217
|
+
# Add multiple audios if present
|
218
|
+
if audios:
|
219
|
+
for audio in audios:
|
220
|
+
content.append(process_audio(audio))
|
221
|
+
# Add single video if present
|
222
|
+
if video:
|
223
|
+
content.append(process_video(video))
|
224
|
+
# Add multiple videos if present
|
225
|
+
if videos:
|
226
|
+
for video in videos:
|
227
|
+
content.append(process_video(video))
|
228
|
+
|
229
|
+
if content:
|
230
|
+
# Append complete user message
|
231
|
+
openai_messages.append({'role': 'user', 'content': content})
|
232
|
+
|
233
|
+
return openai_messages
|
234
|
+
|
235
|
+
|
236
|
+
def is_openai_chat_format(messages):
|
237
|
+
"""
|
238
|
+
Verify if the given argument follows the OpenAI chat messages format.
|
239
|
+
|
240
|
+
Args:
|
241
|
+
messages (list): A list of dictionaries representing chat messages.
|
242
|
+
|
243
|
+
Returns:
|
244
|
+
bool: True if valid, False otherwise.
|
245
|
+
"""
|
246
|
+
if not isinstance(messages, list):
|
247
|
+
return False
|
248
|
+
|
249
|
+
valid_roles = {"system", "user", "assistant", "function"}
|
250
|
+
|
251
|
+
for msg in messages:
|
252
|
+
if not isinstance(msg, dict):
|
253
|
+
return False
|
254
|
+
if "role" not in msg or "content" not in msg:
|
255
|
+
return False
|
256
|
+
if msg["role"] not in valid_roles:
|
257
|
+
return False
|
258
|
+
|
259
|
+
content = msg["content"]
|
260
|
+
|
261
|
+
# Content should be either a string (text message) or a multimodal list
|
262
|
+
if isinstance(content, str):
|
263
|
+
continue # Valid text message
|
264
|
+
|
265
|
+
elif isinstance(content, list):
|
266
|
+
for item in content:
|
267
|
+
if not isinstance(item, dict):
|
268
|
+
return False
|
269
|
+
return True
|
clarifai/urls/helper.py
CHANGED
@@ -1,10 +1,25 @@
|
|
1
|
+
import os
|
2
|
+
from collections import namedtuple
|
1
3
|
from urllib.parse import urlparse
|
2
4
|
|
5
|
+
from clarifai.utils.constants import DEFAULT_BASE, DEFAULT_UI
|
6
|
+
|
7
|
+
# To help with using ClarifaiUrlHelper with defaults as ClarifaiUrlHelper()
|
8
|
+
auth_obj = namedtuple("auth", ["ui", "base"])
|
9
|
+
default_auth = auth_obj(
|
10
|
+
ui=os.environ.get("CLARIFAI_UI", DEFAULT_UI),
|
11
|
+
base=os.environ.get("CLARIFAI_API_BASE", DEFAULT_BASE),
|
12
|
+
)
|
13
|
+
|
3
14
|
|
4
15
|
class ClarifaiUrlHelper(object):
|
5
16
|
"""Lots of helper functionality for dealing with urls around modules."""
|
6
17
|
|
7
|
-
def __init__(
|
18
|
+
def __init__(
|
19
|
+
self,
|
20
|
+
auth=default_auth,
|
21
|
+
module_manager_imv_id: str = "module_manager_install",
|
22
|
+
):
|
8
23
|
"""
|
9
24
|
Args:
|
10
25
|
auth: a ClarifaiAuthHelper object.
|
@@ -13,13 +28,17 @@ class ClarifaiUrlHelper(object):
|
|
13
28
|
self._module_manager_imv_id = module_manager_imv_id
|
14
29
|
|
15
30
|
@property
|
16
|
-
def
|
17
|
-
return self._auth
|
31
|
+
def ui(self):
|
32
|
+
return self._auth.ui
|
33
|
+
|
34
|
+
@property
|
35
|
+
def base(self):
|
36
|
+
return self._auth.base
|
18
37
|
|
19
38
|
def module_ui_url(self, user_id, app_id, module_id, module_version_id):
|
20
39
|
"""This is the path to the module in community."""
|
21
40
|
return "%s/%s/%s/modules/%s/versions/%s" % (
|
22
|
-
self.
|
41
|
+
self.ui,
|
23
42
|
user_id,
|
24
43
|
app_id,
|
25
44
|
module_id,
|
@@ -30,7 +49,7 @@ class ClarifaiUrlHelper(object):
|
|
30
49
|
"""This is a url that allows for installation of the module from the community at 'module_url'
|
31
50
|
into the destination app_id of the destination user_id."""
|
32
51
|
return "%s/%s/%s/installed_module_versions/%s/install?install=%s" % (
|
33
|
-
self.
|
52
|
+
self.ui,
|
34
53
|
dest_user_id,
|
35
54
|
dest_app_id,
|
36
55
|
self._module_manager_imv_id,
|
@@ -39,22 +58,51 @@ class ClarifaiUrlHelper(object):
|
|
39
58
|
|
40
59
|
def imv_ui_url(self, dest_user_id, dest_app_id, imv_id):
|
41
60
|
return "%s/%s/%s/installed_module_versions/%s" % (
|
42
|
-
self.
|
61
|
+
self.ui,
|
43
62
|
dest_user_id,
|
44
63
|
dest_app_id,
|
45
64
|
imv_id,
|
46
65
|
)
|
47
66
|
|
48
|
-
def
|
49
|
-
"""This is the path to the resource in
|
67
|
+
def api_url(self, user_id, app_id, resource_type, resource_id, version_id: str = None):
|
68
|
+
"""This is the path to the resource in the API.
|
69
|
+
|
70
|
+
Example:
|
71
|
+
https://api.clarifai.com/v2/zeiler/app/modules/module1/versions/2
|
72
|
+
https://api.clarifai.com/v2/zeiler/app/models/model1/versions/2
|
73
|
+
https://api.clarifai.com/v2/zeiler/app/concepts/concept1
|
74
|
+
https://api.clarifai.com/v2/zeiler/app/workflows/workflow1
|
75
|
+
https://api.clarifai.com/v2/zeiler/app/tasks/task1
|
76
|
+
https://api.clarifai.com/v2/zeiler/app/installed_module_versions/module_manager_install
|
50
77
|
|
51
78
|
Args:
|
52
79
|
user_id: the author of the resource.
|
53
80
|
app_id: the author's app the resource was created in.
|
54
|
-
resource_type: the type of resource. One of "modules", "models", "concepts", "inputs", "workflows", "tasks"
|
81
|
+
resource_type: the type of resource. One of "modules", "models", "concepts", "inputs", "workflows", "tasks"
|
55
82
|
resource_id: the resource ID
|
56
|
-
version_id: the version of the resource.
|
57
83
|
"""
|
84
|
+
self._validate_resource_type(resource_type)
|
85
|
+
if version_id is None:
|
86
|
+
return "%s/v2/users/%s/apps/%s/%s/%s" % (
|
87
|
+
self.base,
|
88
|
+
user_id,
|
89
|
+
app_id,
|
90
|
+
resource_type,
|
91
|
+
resource_id,
|
92
|
+
)
|
93
|
+
|
94
|
+
if resource_type in ["concepts", "tasks", "installed_module_versions"]:
|
95
|
+
raise ValueError(f"{resource_type} do not have versions.")
|
96
|
+
return "%s/v2/users/%s/apps/%s/%s/%s/versions/%s" % (
|
97
|
+
self.base,
|
98
|
+
user_id,
|
99
|
+
app_id,
|
100
|
+
resource_type,
|
101
|
+
resource_id,
|
102
|
+
version_id,
|
103
|
+
)
|
104
|
+
|
105
|
+
def _validate_resource_type(self, resource_type):
|
58
106
|
if resource_type not in [
|
59
107
|
"modules",
|
60
108
|
"models",
|
@@ -68,10 +116,30 @@ class ClarifaiUrlHelper(object):
|
|
68
116
|
"resource_type must be one of modules, models, concepts, inputs, workflows, tasks, installed_module_versions but was %s"
|
69
117
|
% resource_type
|
70
118
|
)
|
119
|
+
|
120
|
+
def clarifai_url(self, user_id, app_id, resource_type, resource_id, version_id: str = None):
|
121
|
+
"""This is the path to the resource in community UI.
|
122
|
+
|
123
|
+
Example:
|
124
|
+
https://clarifai.com/zeiler/modules/module1/versions/2
|
125
|
+
https://clarifai.com/zeiler/models/model1/versions/2
|
126
|
+
https://clarifai.com/zeiler/concepts/concept1
|
127
|
+
https://clarifai.com/zeiler/workflows/workflow1
|
128
|
+
https://clarifai.com/zeiler/tasks/task1
|
129
|
+
https://clarifai.com/zeiler/installed_module_versions/module_manager_install
|
130
|
+
|
131
|
+
Args:
|
132
|
+
user_id: the author of the resource.
|
133
|
+
app_id: the author's app the resource was created in.
|
134
|
+
resource_type: the type of resource. One of "modules", "models", "concepts", "inputs", "workflows", "tasks", "installed_module_versions"
|
135
|
+
resource_id: the resource ID
|
136
|
+
version_id: the version of the resource.
|
137
|
+
"""
|
138
|
+
self._validate_resource_type(resource_type)
|
71
139
|
if version_id is None:
|
72
|
-
return "%s/%s/%s/%s/%s" % (self.
|
140
|
+
return "%s/%s/%s/%s/%s" % (self.ui, user_id, app_id, resource_type, resource_id)
|
73
141
|
return "%s/%s/%s/%s/%s/versions/%s" % (
|
74
|
-
self.
|
142
|
+
self.ui,
|
75
143
|
user_id,
|
76
144
|
app_id,
|
77
145
|
resource_type,
|
clarifai/utils/config.py
CHANGED
clarifai/utils/constants.py
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
import os
|
2
2
|
|
3
|
+
DEFAULT_UI = os.environ.get("CLARIFAI_UI", "https://clarifai.com")
|
4
|
+
DEFAULT_BASE = os.environ.get("CLARIFAI_API_BASE", "https://api.clarifai.com")
|
5
|
+
|
6
|
+
|
3
7
|
CLARIFAI_PAT_ENV_VAR = "CLARIFAI_PAT"
|
4
8
|
CLARIFAI_SESSION_TOKEN_ENV_VAR = "CLARIFAI_SESSION_TOKEN"
|
5
9
|
CLARIFAI_USER_ID_ENV_VAR = "CLARIFAI_USER_ID"
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: clarifai
|
3
|
-
Version: 11.4.
|
3
|
+
Version: 11.4.4
|
4
4
|
Home-page: https://github.com/Clarifai/clarifai-python
|
5
5
|
Author: Clarifai
|
6
6
|
Author-email: support@clarifai.com
|
@@ -33,6 +33,17 @@ Requires-Dist: requests>=2.32.3
|
|
33
33
|
Requires-Dist: aiohttp>=3.10.0
|
34
34
|
Provides-Extra: all
|
35
35
|
Requires-Dist: pycocotools>=2.0.7; extra == "all"
|
36
|
+
Dynamic: author
|
37
|
+
Dynamic: author-email
|
38
|
+
Dynamic: classifier
|
39
|
+
Dynamic: description
|
40
|
+
Dynamic: description-content-type
|
41
|
+
Dynamic: home-page
|
42
|
+
Dynamic: license
|
43
|
+
Dynamic: license-file
|
44
|
+
Dynamic: provides-extra
|
45
|
+
Dynamic: requires-dist
|
46
|
+
Dynamic: requires-python
|
36
47
|
|
37
48
|
<h1 align="center">
|
38
49
|
<a href="https://www.clarifai.com/"><img alt="Clarifai" title="Clarifai" src="https://github.com/user-attachments/assets/623b883b-7fe5-4b95-bbfa-8691f5779af4"></a>
|
@@ -0,0 +1,112 @@
|
|
1
|
+
clarifai/__init__.py,sha256=sUX_44ac6i5WHivSDqnx8WOTpwJ2J_D46SUoKT-SUh4,23
|
2
|
+
clarifai/cli.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
+
clarifai/errors.py,sha256=GXa6D4v_L404J83jnRNFPH7s-1V9lk7w6Ws99f1g-AY,2772
|
4
|
+
clarifai/versions.py,sha256=ecSuEB_nOL2XSoYHDw2n23XUbm_KPOGjudMXmQrGdS8,224
|
5
|
+
clarifai/cli/README.md,sha256=YGApHfeUyu5P0Pdth-mqQCQftWHDxz6bugDlvDXDhOE,1942
|
6
|
+
clarifai/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
+
clarifai/cli/__main__.py,sha256=7nPbLW7Jr2shkgMPvnxpn4xYGMvIcnqluJ69t9w4H_k,74
|
8
|
+
clarifai/cli/base.py,sha256=Rk87oliNs3q-pVX2ubyjycgo4Gtd0hcDSgr9MqDxyko,8227
|
9
|
+
clarifai/cli/compute_cluster.py,sha256=8Xss0Obrp6l1XuxJe0luOqU_pf8vXGDRi6jyIe8qR6k,2282
|
10
|
+
clarifai/cli/deployment.py,sha256=9C4I6_kyMxRkWl6h681wc79-3mAtDHtTUaxRv05OZMs,4262
|
11
|
+
clarifai/cli/model.py,sha256=M1O0QCdIyTcn2GzrkROAtgWR-8SX2WV9nz0l84rkiG4,27375
|
12
|
+
clarifai/cli/nodepool.py,sha256=H6OIdUW_EiyDUwZogzEDoYmVwEjLMsgoDlPyE7gjIuU,4245
|
13
|
+
clarifai/client/__init__.py,sha256=NhpNFRJY6mTi8ca-5hUeTEmYeDKHDNXY48FN63pDuos,703
|
14
|
+
clarifai/client/app.py,sha256=D0FG9v07g1dExLnQsYt0OQjsJCkVvuw76BOpcqaCzfM,41380
|
15
|
+
clarifai/client/base.py,sha256=zOmB5HJP_-NmF2BPka14W7VUeJ1OF-fNxeacLsaRj3E,8775
|
16
|
+
clarifai/client/compute_cluster.py,sha256=ViPyh-FibXL1J0ypsVOTaQnR1ymKohmZEuA13RwA-hc,10254
|
17
|
+
clarifai/client/dataset.py,sha256=OgdpZkQ_vYmRxL8-qphcNozpvPV1bWTlte9Jv6UkKb8,35299
|
18
|
+
clarifai/client/deployment.py,sha256=QBf0tzkKBEpzNgmOEmWUJMOlVWdFEFc70Y44o8y75Gs,2875
|
19
|
+
clarifai/client/input.py,sha256=jpX47qwn7aUBBIEuSSLHF5jk70XaWEh0prD065c9b-E,51205
|
20
|
+
clarifai/client/lister.py,sha256=1YEm2suNxPaJO4x9V5szgD_YX6N_00vgSO-7m0HagY8,2208
|
21
|
+
clarifai/client/model.py,sha256=XptnbfvNnaRCvv6Sdc7hfZnEPL8z9_-nFB3OmKujfAE,86267
|
22
|
+
clarifai/client/model_client.py,sha256=XOrrm1xOZt62eLX5KbvV-zKSpK4EJOPUTUrGnH8z_KE,22392
|
23
|
+
clarifai/client/module.py,sha256=jLViQYvVV3FmRN_ivvbk83uwsx7CgYGeEx4dYAr6yD4,4537
|
24
|
+
clarifai/client/nodepool.py,sha256=Y5zQ0JLdTjAp2TmVnx7AAOwaB2YUslk3nl7s6BQ90FQ,16415
|
25
|
+
clarifai/client/runner.py,sha256=5xCiqByGGscfNm0IjHelhDTx8-9l8G0C3HL-3YZogK8,2253
|
26
|
+
clarifai/client/search.py,sha256=3LLfATrdU43a0mRNITmJV-E53bhfafZkYsbwkTtlnyU,15661
|
27
|
+
clarifai/client/user.py,sha256=VqY5j75wJqw1AeaWpZLvbNfSjQHGQm_bdjknDjX_fQY,18394
|
28
|
+
clarifai/client/workflow.py,sha256=Bqh8lAmJcSbviJebckchTxucYlU11UQEhFSov7elpsk,13417
|
29
|
+
clarifai/client/auth/__init__.py,sha256=7EwR0NrozkAUwpUnCsqXvE_p0wqx_SelXlSpKShKJK0,136
|
30
|
+
clarifai/client/auth/helper.py,sha256=kHBi8GTX19EUiD9n_QgCqilv127TDIpP0_o5MMtzFdY,15167
|
31
|
+
clarifai/client/auth/register.py,sha256=pyY-Kg_64WpN6rXz1SyEzfqL14BS4yADtuYMxLJ4jx4,554
|
32
|
+
clarifai/client/auth/stub.py,sha256=pU4FYeghooCBZmCRyNTdDfJaVe4WyeRBqE3xVwfmMTY,5388
|
33
|
+
clarifai/constants/base.py,sha256=ogmFSZYoF0YhGjHg5aiOc3MLqPr_poKAls6xaD0_C3U,89
|
34
|
+
clarifai/constants/dataset.py,sha256=9saFE_VxCTCMlPTQbOU4KM_SzN_TQjwsrsFnpsc_Epo,556
|
35
|
+
clarifai/constants/input.py,sha256=WcHwToUVIK9ItAhDefaSohQHCLNeR55PSjZ0BFnoZ3U,28
|
36
|
+
clarifai/constants/model.py,sha256=ghcdvKIbx-g22H9RwxmMfUt1CrKz5Oa-iTExt0VpUVU,463
|
37
|
+
clarifai/constants/rag.py,sha256=WcHwToUVIK9ItAhDefaSohQHCLNeR55PSjZ0BFnoZ3U,28
|
38
|
+
clarifai/constants/search.py,sha256=yYEqTaFg-KdnpJE_Ytp-EPVHIIC395iNtZrpVlLIf4o,101
|
39
|
+
clarifai/constants/workflow.py,sha256=cECq1xdvf44MCdtK2AbkiuuwhyL-6OWZdQfYbsLKy_o,33
|
40
|
+
clarifai/datasets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
41
|
+
clarifai/datasets/export/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
42
|
+
clarifai/datasets/export/inputs_annotations.py,sha256=1PFjIw30dRO9NSUa_yvox_07W30tlAnrk4mEAVgfXBY,10980
|
43
|
+
clarifai/datasets/upload/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
44
|
+
clarifai/datasets/upload/base.py,sha256=8b13tmAokgZVH0d-HRpU-O15Swa46eJy2Fp6zU7jQkU,2441
|
45
|
+
clarifai/datasets/upload/features.py,sha256=Yy0MP1F_ev2IbWnEyXDLt5SaEb11bXSUu5ux8tD1oxY,2115
|
46
|
+
clarifai/datasets/upload/image.py,sha256=0Fs02KK1WuDE24RAJ2ZOdktva1iOqzE25J9jJJYJUDk,10122
|
47
|
+
clarifai/datasets/upload/multimodal.py,sha256=IZYjmyxVJpNjwyNyzptQENZcCKDbdTU_t70QSdK23Ec,2762
|
48
|
+
clarifai/datasets/upload/text.py,sha256=L2IEbickNhZcmrhbBfQciCXQf4JPcqWulRWJ7HDpJLc,2482
|
49
|
+
clarifai/datasets/upload/utils.py,sha256=VdTn7AqIWB8D60rX9YD4T-4fi-7xMEocHATJvvaPjxQ,10508
|
50
|
+
clarifai/datasets/upload/loaders/README.md,sha256=aNRutSCTzLp2ruIZx74ZkN5AxpzwKOxMa7OzabnKpwg,2980
|
51
|
+
clarifai/datasets/upload/loaders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
52
|
+
clarifai/datasets/upload/loaders/coco_captions.py,sha256=v6e8lh6BCUFOlurnvDfBEY-drl6JhpIE9nt2Qnz7XQ8,1623
|
53
|
+
clarifai/datasets/upload/loaders/coco_detection.py,sha256=0FsGV84MT0IkerXoe9hdxQSr9wd96j9cPOne-rhzBPw,3190
|
54
|
+
clarifai/datasets/upload/loaders/imagenet_classification.py,sha256=w2Tiot_YK0QYiyAVbWSxoKthZgUsRo9LiWWY2lVzPrQ,2247
|
55
|
+
clarifai/datasets/upload/loaders/xview_detection.py,sha256=dukodZRdyVH-s5MtmCDtKwseKGwSCWAK2Uwuwa6kJu4,8035
|
56
|
+
clarifai/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
57
|
+
clarifai/models/api.py,sha256=YhbGqZMC5mH_ZqnbaEmgfJdrIhSkLevpWih8ZqC3BL4,12193
|
58
|
+
clarifai/modules/README.md,sha256=mx8pVx6cPp-pP4LcFPT_nX3ngGmhygVK0WiXeD3cbIo,367
|
59
|
+
clarifai/modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
60
|
+
clarifai/modules/css.py,sha256=Jg67jXo2mZoGQp7M-At74ywyk4cN90s-aJTLjfqsaB4,2176
|
61
|
+
clarifai/modules/pages.py,sha256=DZVO7YjIjYQdUyHYF-zxLkc5qkYC5KNnUxGiKQGo3Uk,1509
|
62
|
+
clarifai/modules/style.css,sha256=j7FNPZVhLPj35vvBksAJ90RuX5sLuqzDR5iM2WIEhiA,6073
|
63
|
+
clarifai/rag/__init__.py,sha256=wu3PzAzo7uqgrEzuaC9lY_3gj1HFiR3GU3elZIKTT5g,40
|
64
|
+
clarifai/rag/rag.py,sha256=EG3GoFrHFCmA70Tz49_0Jo1-3WIaHSgWGHecPeErcdc,14170
|
65
|
+
clarifai/rag/utils.py,sha256=_gVZdABuMnraCKViLruV75x0F3IpgFXN6amYSGE5_xc,4462
|
66
|
+
clarifai/runners/__init__.py,sha256=cDJ31l41dDsqW4Xn6sFMkKxxdIMTnGH9IW6sVkq0TNw,207
|
67
|
+
clarifai/runners/server.py,sha256=9qVAs8pRHmtyY0RCNIQ1uP8nqDADIFZ03LnkoDt1h4U,4692
|
68
|
+
clarifai/runners/dockerfile_template/Dockerfile.template,sha256=5cjv7U8PmWa3DB_5B1CqSYh_6GE0E0np52TIAa7EIDE,2312
|
69
|
+
clarifai/runners/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
70
|
+
clarifai/runners/models/mcp_class.py,sha256=trtChVaesNSrb-Z3hdr0sdJjX7U7TlX4EMuO00vznTA,5960
|
71
|
+
clarifai/runners/models/model_builder.py,sha256=PiqPyTGPSKsYvOQNpBzs4e1_wuEbtE-P3yEkLE4Py10,49231
|
72
|
+
clarifai/runners/models/model_class.py,sha256=OHVd0tMOXDyl9v1vWeHOmYGx_dvP77N4zlLGMyTakag,15575
|
73
|
+
clarifai/runners/models/model_run_locally.py,sha256=6-6WjEKc0ba3gAv4wOLdMs2XOzS3b-2bZHJS0wdVqJY,20088
|
74
|
+
clarifai/runners/models/model_runner.py,sha256=SccX-RxTgruSpQaM21uMSl-z1x6fOa13fQZMQW8NNRY,7297
|
75
|
+
clarifai/runners/models/model_servicer.py,sha256=rRd_fNEXwqiBSzTUtPI2r07EBdcCPd8tcSPHeqTe0_I,3445
|
76
|
+
clarifai/runners/models/visual_classifier_class.py,sha256=f9ZP8KFamMUdMpUG3AlL9nVCdcggy_E5n9RJY3ixR1U,2739
|
77
|
+
clarifai/runners/models/visual_detector_class.py,sha256=ky4oFAkGCKPpGPdgaOso-n6D3HcmnbKee_8hBsNiV8U,2883
|
78
|
+
clarifai/runners/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
79
|
+
clarifai/runners/utils/code_script.py,sha256=qU5B3vJmIjQnB_nQJI_aUfj8glezmNWgaPonZsE0_Xo,11278
|
80
|
+
clarifai/runners/utils/const.py,sha256=Q4Ps6gIEJCyTdQCfmT6PaS61WHmhT25XigV1NugWz-E,1544
|
81
|
+
clarifai/runners/utils/data_utils.py,sha256=4M4n-cGprBEBV5UkgOWaUlVfZ3WBTmegdffGQ3SfYCU,20750
|
82
|
+
clarifai/runners/utils/loader.py,sha256=K5Y8MPbIe5STw2gDnrL8KqFgKNxEo7bz-RV0ip1T4PM,10900
|
83
|
+
clarifai/runners/utils/method_signatures.py,sha256=qdHaO8ZIgP6BBXXMhMPhcQ46dse-XMP2t4VJCNG7O3Q,18335
|
84
|
+
clarifai/runners/utils/openai_convertor.py,sha256=ZlIrvvfHttD_DavLvmKZdL8gNq_TQvQtZVnYamwdWz4,8248
|
85
|
+
clarifai/runners/utils/serializers.py,sha256=pI7GqMTC0T3Lu_X8v8TO4RiplO-gC_49Ns37jYwsPtg,7908
|
86
|
+
clarifai/runners/utils/url_fetcher.py,sha256=Segkvi-ktPa3-koOpUu8DNZeWOaK6G82Ya9b7_oIKwo,1778
|
87
|
+
clarifai/runners/utils/data_types/__init__.py,sha256=iBtmPkIoLK9ew6ZiXElGt2YBBTDLEA0fmxE_eOYzvhk,478
|
88
|
+
clarifai/runners/utils/data_types/data_types.py,sha256=UBHTNPshr94qUs2KqkYis0VlArm23rcSG_EyO_Uetgc,19823
|
89
|
+
clarifai/schema/search.py,sha256=o9-ct8ulLZByB3RCVwZWPgaDwdcW7cM5s-g8oyAz89s,2421
|
90
|
+
clarifai/urls/helper.py,sha256=UshKiEnBAZfMyoWiM3Xx6USXEYmXRFTd4kNpuQSQQM8,7868
|
91
|
+
clarifai/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
92
|
+
clarifai/utils/cli.py,sha256=7lHajIsWzyEU7jfgH1nykwYG63wcHCZ3ep7a6amWZH4,5413
|
93
|
+
clarifai/utils/config.py,sha256=AguQ4UPFxNwDT8hTBrdV4grQ0t4m-pW2V9XKxBWfnNg,5177
|
94
|
+
clarifai/utils/constants.py,sha256=RYfDVFpaW7V5ISIvY7uvu5nqTvQ2NEwFOd0dcCytyGk,2030
|
95
|
+
clarifai/utils/logging.py,sha256=0we53uTqUvzrulC86whu-oeWNxn1JjJL0OQ98Bwf9vo,15198
|
96
|
+
clarifai/utils/misc.py,sha256=x7JP8oxU672Z9yAav47Y1anFiL4RD8WvlKBHMVlbyZM,3137
|
97
|
+
clarifai/utils/model_train.py,sha256=0XSAoTkSsrwf4f-W9yw2mkXZtkal7LBLJSoi86CFCn4,9250
|
98
|
+
clarifai/utils/protobuf.py,sha256=VMhnNsPuWQ16VarKm8BOr5zccXMe26UlrxdJxIzEZNM,6220
|
99
|
+
clarifai/utils/evaluation/__init__.py,sha256=PYkurUrXrGevByj7RFb6CoU1iC7fllyQSfnnlo9WnY8,69
|
100
|
+
clarifai/utils/evaluation/helpers.py,sha256=0t6eIDXeZEoiVvnmHTnsIF_-v4BzrQW1hFaqc_psifU,21079
|
101
|
+
clarifai/utils/evaluation/main.py,sha256=N_sfRuMjHrUeuWN0Pzms65M1PbkQkgYg3WoQVaDR1Jw,17764
|
102
|
+
clarifai/utils/evaluation/testset_annotation_parser.py,sha256=Nmodfi5BYFYEbybWcC8tmU5-wtwRBsWIbnpd3OvKSmA,5414
|
103
|
+
clarifai/workflows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
104
|
+
clarifai/workflows/export.py,sha256=Oq3RVNKvv1iH46U6oIjXa-MXWJ4sTlXr_NSfwoxr3H4,2149
|
105
|
+
clarifai/workflows/utils.py,sha256=ESL3INcouNcLKCh-nMpfXX-YbtCzX7tz7hT57_RGQ3M,2079
|
106
|
+
clarifai/workflows/validate.py,sha256=UhmukyHkfxiMFrPPeBdUTiCOHQT5-shqivlBYEyKTlU,2931
|
107
|
+
clarifai-11.4.4.dist-info/licenses/LICENSE,sha256=mUqF_d12-qE2n41g7C5_sq-BMLOcj6CNN-jevr15YHU,555
|
108
|
+
clarifai-11.4.4.dist-info/METADATA,sha256=PPC2dIigq8LyS79SNag-OWUK5oMM9BCU24_KFRv4AF0,22398
|
109
|
+
clarifai-11.4.4.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
110
|
+
clarifai-11.4.4.dist-info/entry_points.txt,sha256=X9FZ4Z-i_r2Ud1RpZ9sNIFYuu_-9fogzCMCRUD9hyX0,51
|
111
|
+
clarifai-11.4.4.dist-info/top_level.txt,sha256=wUMdCQGjkxaynZ6nZ9FAnvBUCgp5RJUVFSy2j-KYo0s,9
|
112
|
+
clarifai-11.4.4.dist-info/RECORD,,
|