clarifai 11.5.1__tar.gz → 11.5.2__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-11.5.1/clarifai.egg-info → clarifai-11.5.2}/PKG-INFO +1 -1
- clarifai-11.5.2/clarifai/__init__.py +1 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/cli/model.py +9 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/auth/helper.py +23 -21
- {clarifai-11.5.1 → clarifai-11.5.2/clarifai.egg-info}/PKG-INFO +1 -1
- {clarifai-11.5.1 → clarifai-11.5.2}/tests/test_auth.py +17 -9
- clarifai-11.5.1/clarifai/__init__.py +0 -1
- {clarifai-11.5.1 → clarifai-11.5.2}/LICENSE +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/MANIFEST.in +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/README.md +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/cli/README.md +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/cli/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/cli/__main__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/cli/base.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/cli/compute_cluster.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/cli/deployment.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/cli/model_templates.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/cli/nodepool.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/cli.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/app.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/auth/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/auth/register.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/auth/stub.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/base.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/compute_cluster.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/dataset.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/deployment.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/input.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/lister.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/model.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/model_client.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/module.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/nodepool.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/runner.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/search.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/user.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/client/workflow.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/constants/base.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/constants/dataset.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/constants/input.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/constants/model.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/constants/rag.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/constants/search.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/constants/workflow.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/export/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/export/inputs_annotations.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/upload/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/upload/base.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/upload/features.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/upload/image.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/upload/loaders/README.md +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/upload/loaders/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/upload/loaders/coco_captions.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/upload/loaders/coco_detection.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/upload/loaders/imagenet_classification.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/upload/loaders/xview_detection.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/upload/multimodal.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/upload/text.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/datasets/upload/utils.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/errors.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/models/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/models/api.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/modules/README.md +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/modules/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/modules/css.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/modules/pages.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/modules/style.css +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/rag/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/rag/rag.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/rag/utils.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/dockerfile_template/Dockerfile.template +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/models/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/models/dummy_openai_model.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/models/mcp_class.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/models/model_builder.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/models/model_class.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/models/model_run_locally.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/models/model_runner.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/models/model_servicer.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/models/openai_class.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/models/visual_classifier_class.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/models/visual_detector_class.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/server.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/utils/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/utils/code_script.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/utils/const.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/utils/data_types/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/utils/data_types/data_types.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/utils/data_utils.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/utils/loader.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/utils/method_signatures.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/utils/openai_convertor.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/utils/serializers.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/utils/url_fetcher.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/schema/search.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/urls/helper.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/utils/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/utils/cli.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/utils/config.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/utils/constants.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/utils/evaluation/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/utils/evaluation/helpers.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/utils/evaluation/main.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/utils/evaluation/testset_annotation_parser.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/utils/logging.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/utils/misc.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/utils/model_train.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/utils/protobuf.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/versions.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/workflows/__init__.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/workflows/export.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/workflows/utils.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai/workflows/validate.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai.egg-info/SOURCES.txt +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai.egg-info/dependency_links.txt +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai.egg-info/entry_points.txt +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai.egg-info/requires.txt +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/clarifai.egg-info/top_level.txt +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/pyproject.toml +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/requirements.txt +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/setup.cfg +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/setup.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/tests/test_app.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/tests/test_data_upload.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/tests/test_eval.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/tests/test_misc.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/tests/test_model_predict.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/tests/test_model_train.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/tests/test_modules.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/tests/test_rag.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/tests/test_search.py +0 -0
- {clarifai-11.5.1 → clarifai-11.5.2}/tests/test_stub.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "11.5.2"
|
@@ -520,6 +520,10 @@ def local_dev(ctx, model_path):
|
|
520
520
|
|
521
521
|
try:
|
522
522
|
runner = nodepool.runner(runner_id)
|
523
|
+
# ensure the deployment is using the latest version.
|
524
|
+
if runner.worker.model.model_version.id != version.id:
|
525
|
+
nodepool.delete_runners([runner_id])
|
526
|
+
raise AttributeError("Deleted runner that was for an old model version ID.")
|
523
527
|
except Exception as e:
|
524
528
|
raise AttributeError("Runner not found in nodepool.") from e
|
525
529
|
except AttributeError:
|
@@ -549,6 +553,10 @@ def local_dev(ctx, model_path):
|
|
549
553
|
deployment_id = DEFAULT_LOCAL_DEV_DEPLOYMENT_ID
|
550
554
|
try:
|
551
555
|
deployment = nodepool.deployment(deployment_id)
|
556
|
+
# ensure the deployment is using the latest version.
|
557
|
+
if deployment.worker.model.model_version.id != version.id:
|
558
|
+
nodepool.delete_deployments([deployment_id])
|
559
|
+
raise Exception("Deleted deployment that was for an old model version ID.")
|
552
560
|
try:
|
553
561
|
deployment_id = ctx.obj.current.deployment_id
|
554
562
|
except AttributeError: # doesn't exist in context but does in API then update the context.
|
@@ -576,6 +584,7 @@ def local_dev(ctx, model_path):
|
|
576
584
|
},
|
577
585
|
}
|
578
586
|
],
|
587
|
+
"deploy_latest_version": True,
|
579
588
|
}
|
580
589
|
},
|
581
590
|
)
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import os
|
2
2
|
import urllib.request
|
3
3
|
from typing import Any, Dict
|
4
|
-
from urllib.parse import urlparse
|
5
4
|
|
6
5
|
from clarifai_grpc.channel.clarifai_channel import ClarifaiChannel
|
7
6
|
from clarifai_grpc.grpc.api import resources_pb2, service_pb2_grpc
|
@@ -42,28 +41,31 @@ def https_cache(cache: dict, url: str) -> str:
|
|
42
41
|
elif url.startswith("http://"):
|
43
42
|
url = url.replace("http://", "")
|
44
43
|
cache[url] = HTTP
|
45
|
-
elif url
|
44
|
+
elif url.endswith(":443"):
|
45
|
+
# If it ends with :443 then we know it's https.
|
46
|
+
# trim it off the right
|
47
|
+
url = url[:-4]
|
48
|
+
cache[url] = HTTPS
|
49
|
+
elif url.find('.clarifai.com') >= 0:
|
46
50
|
# We know our endpoints are https.
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
if ":" not in url:
|
59
|
-
raise Exception(
|
60
|
-
"When providing an insecure url it must have both host:port format"
|
61
|
-
)
|
62
|
-
else:
|
51
|
+
cache[url] = HTTPS
|
52
|
+
elif url not in cache:
|
53
|
+
# need to test ones that we don't have in the cache yet.
|
54
|
+
try: # make request to https endpoint.
|
55
|
+
urllib.request.urlopen("https://%s/v2/auth/methods" % url, timeout=5)
|
56
|
+
cache[url] = HTTPS # cache it.
|
57
|
+
except Exception as e:
|
58
|
+
if "SSL" in str(e): # if ssl error then we know it's http.
|
59
|
+
cache[url] = HTTP
|
60
|
+
# For http urls we need host:port format.
|
61
|
+
if ":" not in url:
|
63
62
|
raise Exception(
|
64
|
-
"
|
65
|
-
|
66
|
-
|
63
|
+
"When providing an insecure url it must have both host:port format"
|
64
|
+
)
|
65
|
+
else:
|
66
|
+
raise Exception(
|
67
|
+
"Could not get a valid response from url: %s, is the API running there?" % url
|
68
|
+
) from e
|
67
69
|
return url
|
68
70
|
|
69
71
|
|
@@ -22,6 +22,14 @@ def test_ui_default_url():
|
|
22
22
|
(
|
23
23
|
("http://localhost:3002", "http://localhost:3002"),
|
24
24
|
("https://localhost:3002", "https://localhost:3002"),
|
25
|
+
("https://localhost", "https://localhost"),
|
26
|
+
("http://localhost", "http://localhost"),
|
27
|
+
("http://10.4.5.6", "http://10.4.5.6"),
|
28
|
+
("http://10.5.6.7", "http://10.5.6.7"),
|
29
|
+
("10.5.6.7:443", "https://10.5.6.7"),
|
30
|
+
("http://10.5.6.7:443", "http://10.5.6.7:443"),
|
31
|
+
("something.clarifai.com", "https://something.clarifai.com"),
|
32
|
+
("something.clarifai.com:443", "https://something.clarifai.com"),
|
25
33
|
("https://clarifai.com", "https://clarifai.com"),
|
26
34
|
),
|
27
35
|
)
|
@@ -39,6 +47,15 @@ def test_passing_no_schema_url_use_https_when_server_is_running():
|
|
39
47
|
assert helper.ui == "https://server"
|
40
48
|
|
41
49
|
|
50
|
+
def test_passing_no_schema_url_detect_http_when_SSL_in_error():
|
51
|
+
def raise_exception():
|
52
|
+
return Mock(side_effect=Exception("Has SSL in error"))
|
53
|
+
|
54
|
+
with mock.patch('urllib.request.urlopen', new_callable=raise_exception):
|
55
|
+
helper = ClarifaiAuthHelper("clarifai", "main", "fake_pat", ui="localhost:3002")
|
56
|
+
assert helper.ui == "http://localhost:3002"
|
57
|
+
|
58
|
+
|
42
59
|
def test_passing_no_schema_url_show_error_when_not_server_running():
|
43
60
|
def raise_exception():
|
44
61
|
return Mock(side_effect=Exception("http_exception"))
|
@@ -51,15 +68,6 @@ def test_passing_no_schema_url_show_error_when_not_server_running():
|
|
51
68
|
ClarifaiAuthHelper("clarifai", "main", "fake_pat", ui="localhost:3002")
|
52
69
|
|
53
70
|
|
54
|
-
def test_passing_no_schema_url_detect_http_when_SSL_in_error():
|
55
|
-
def raise_exception():
|
56
|
-
return Mock(side_effect=Exception("Has SSL in error"))
|
57
|
-
|
58
|
-
with mock.patch('urllib.request.urlopen', new_callable=raise_exception):
|
59
|
-
helper = ClarifaiAuthHelper("clarifai", "main", "fake_pat", ui="localhost:3002")
|
60
|
-
assert helper.ui == "http://localhost:3002"
|
61
|
-
|
62
|
-
|
63
71
|
def test_passing_no_schema_url_require_port():
|
64
72
|
def raise_exception():
|
65
73
|
return Mock(side_effect=Exception("Has SSL in error"))
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "11.5.1"
|
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
|
File without changes
|
{clarifai-11.5.1 → clarifai-11.5.2}/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
|
{clarifai-11.5.1 → clarifai-11.5.2}/clarifai/runners/dockerfile_template/Dockerfile.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
|
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
|