clarifai 11.0.1__tar.gz → 11.0.3__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.0.1/clarifai.egg-info → clarifai-11.0.3}/PKG-INFO +1 -1
- clarifai-11.0.3/clarifai/__init__.py +1 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/runners/models/model_upload.py +9 -1
- clarifai-11.0.3/clarifai/runners/utils/const.py +42 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/runners/utils/loader.py +11 -2
- {clarifai-11.0.1 → clarifai-11.0.3/clarifai.egg-info}/PKG-INFO +1 -1
- clarifai-11.0.1/clarifai/__init__.py +0 -1
- clarifai-11.0.1/clarifai/runners/utils/const.py +0 -40
- {clarifai-11.0.1 → clarifai-11.0.3}/LICENSE +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/MANIFEST.in +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/README.md +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/cli/README.md +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/cli/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/cli/base.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/cli/compute_cluster.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/cli/deployment.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/cli/model.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/cli/nodepool.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/cli.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/app.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/auth/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/auth/helper.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/auth/register.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/auth/stub.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/base.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/compute_cluster.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/dataset.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/deployment.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/input.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/lister.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/model.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/module.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/nodepool.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/search.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/user.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/client/workflow.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/constants/base.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/constants/dataset.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/constants/input.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/constants/model.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/constants/rag.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/constants/search.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/constants/workflow.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/export/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/export/inputs_annotations.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/upload/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/upload/base.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/upload/features.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/upload/image.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/upload/loaders/README.md +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/upload/loaders/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/upload/loaders/coco_captions.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/upload/loaders/coco_detection.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/upload/loaders/imagenet_classification.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/upload/loaders/xview_detection.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/upload/multimodal.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/upload/text.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/datasets/upload/utils.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/errors.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/models/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/models/api.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/modules/README.md +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/modules/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/modules/css.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/modules/pages.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/modules/style.css +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/rag/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/rag/rag.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/rag/utils.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/runners/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/runners/dockerfile_template/Dockerfile.template +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/runners/models/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/runners/models/base_typed_model.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/runners/models/model_class.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/runners/models/model_run_locally.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/runners/models/model_runner.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/runners/models/model_servicer.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/runners/server.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/runners/utils/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/runners/utils/data_handler.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/runners/utils/data_utils.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/runners/utils/url_fetcher.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/schema/search.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/urls/helper.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/utils/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/utils/cli.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/utils/constants.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/utils/evaluation/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/utils/evaluation/helpers.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/utils/evaluation/main.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/utils/evaluation/testset_annotation_parser.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/utils/logging.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/utils/misc.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/utils/model_train.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/versions.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/workflows/__init__.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/workflows/export.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/workflows/utils.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai/workflows/validate.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai.egg-info/SOURCES.txt +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai.egg-info/dependency_links.txt +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai.egg-info/entry_points.txt +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai.egg-info/requires.txt +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/clarifai.egg-info/top_level.txt +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/pyproject.toml +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/requirements.txt +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/setup.cfg +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/setup.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/tests/test_app.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/tests/test_auth.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/tests/test_data_upload.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/tests/test_eval.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/tests/test_misc.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/tests/test_model_predict.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/tests/test_model_train.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/tests/test_modules.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/tests/test_rag.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/tests/test_search.py +0 -0
- {clarifai-11.0.1 → clarifai-11.0.3}/tests/test_stub.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "11.0.3"
|
@@ -29,10 +29,16 @@ def _clear_line(n: int = 1) -> None:
|
|
29
29
|
|
30
30
|
class ModelUploader:
|
31
31
|
|
32
|
-
def __init__(self, folder: str):
|
32
|
+
def __init__(self, folder: str, validate_api_ids: bool = True):
|
33
|
+
"""
|
34
|
+
:param folder: The folder containing the model.py, config.yaml, requirements.txt and
|
35
|
+
checkpoints.
|
36
|
+
:param validate_api_ids: Whether to validate the user_id and app_id in the config file.
|
37
|
+
"""
|
33
38
|
self._client = None
|
34
39
|
self.folder = self._validate_folder(folder)
|
35
40
|
self.config = self._load_config(os.path.join(self.folder, 'config.yaml'))
|
41
|
+
self.validate_api_ids = validate_api_ids
|
36
42
|
self._validate_config()
|
37
43
|
self.model_proto = self._get_model_proto()
|
38
44
|
self.model_id = self.model_proto.id
|
@@ -76,6 +82,8 @@ class ModelUploader:
|
|
76
82
|
return repo_id, hf_token
|
77
83
|
|
78
84
|
def _check_app_exists(self):
|
85
|
+
if not self.validate_api_ids:
|
86
|
+
return True
|
79
87
|
resp = self.client.STUB.GetApp(service_pb2.GetAppRequest(user_app_id=self.client.user_app_id))
|
80
88
|
if resp.status.code == status_code_pb2.SUCCESS:
|
81
89
|
return True
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import os
|
2
|
+
|
3
|
+
registry = os.environ.get('CLARIFAI_BASE_IMAGE_REGISTRY', 'public.ecr.aws/clarifai-models')
|
4
|
+
|
5
|
+
PYTHON_BASE_IMAGE = registry + '/python-base:{python_version}'
|
6
|
+
TORCH_BASE_IMAGE = registry + '/torch:{torch_version}-py{python_version}-cuda{cuda_version}'
|
7
|
+
|
8
|
+
# List of available python base images
|
9
|
+
AVAILABLE_PYTHON_IMAGES = ['3.11', '3.12', '3.13']
|
10
|
+
|
11
|
+
DEFAULT_PYTHON_VERSION = 3.12
|
12
|
+
|
13
|
+
# List of available torch images
|
14
|
+
AVAILABLE_TORCH_IMAGES = [
|
15
|
+
'2.2.2-py3.11-cuda121',
|
16
|
+
'2.3.1-py3.11-cuda121',
|
17
|
+
'2.4.0-py3.11-cuda121',
|
18
|
+
'2.4.0-py3.11-cuda124',
|
19
|
+
'2.4.1-py3.11-cuda121',
|
20
|
+
'2.4.1-py3.11-cuda124',
|
21
|
+
'2.5.1-py3.11-cuda121',
|
22
|
+
'2.5.1-py3.11-cuda124',
|
23
|
+
'2.2.2-py3.12-cuda121',
|
24
|
+
'2.3.1-py3.12-cuda121',
|
25
|
+
'2.4.0-py3.12-cuda121',
|
26
|
+
'2.4.0-py3.12-cuda124',
|
27
|
+
'2.4.1-py3.12-cuda121',
|
28
|
+
'2.4.1-py3.12-cuda124',
|
29
|
+
'2.5.1-py3.12-cuda121',
|
30
|
+
'2.5.1-py3.12-cuda124',
|
31
|
+
# '2.2.2-py3.13-cuda121',
|
32
|
+
# '2.3.1-py3.13-cuda121',
|
33
|
+
# '2.4.0-py3.13-cuda121',
|
34
|
+
# '2.4.0-py3.13-cuda124',
|
35
|
+
# '2.4.1-py3.13-cuda121',
|
36
|
+
# '2.4.1-py3.13-cuda124',
|
37
|
+
# '2.5.1-py3.13-cuda121',
|
38
|
+
# '2.5.1-py3.13-cuda124',
|
39
|
+
]
|
40
|
+
CONCEPTS_REQUIRED_MODEL_TYPE = [
|
41
|
+
'visual-classifier', 'visual-detector', 'visual-segmenter', 'text-classifier'
|
42
|
+
]
|
@@ -39,7 +39,7 @@ class HuggingFaceLoader:
|
|
39
39
|
def download_checkpoints(self, checkpoint_path: str):
|
40
40
|
# throw error if huggingface_hub wasn't installed
|
41
41
|
try:
|
42
|
-
from huggingface_hub import snapshot_download
|
42
|
+
from huggingface_hub import list_repo_files, snapshot_download
|
43
43
|
except ImportError:
|
44
44
|
raise ImportError(self.HF_DOWNLOAD_TEXT)
|
45
45
|
if os.path.exists(checkpoint_path) and self.validate_download(checkpoint_path):
|
@@ -52,8 +52,17 @@ class HuggingFaceLoader:
|
|
52
52
|
if not is_hf_model_exists:
|
53
53
|
logger.error("Model %s not found on Hugging Face" % (self.repo_id))
|
54
54
|
return False
|
55
|
+
|
56
|
+
ignore_patterns = None # Download everything.
|
57
|
+
repo_files = list_repo_files(repo_id=self.repo_id, token=self.token)
|
58
|
+
if any(f.endswith(".safetensors") for f in repo_files):
|
59
|
+
logger.info(f"SafeTensors found in {self.repo_id}, downloading only .safetensors files.")
|
60
|
+
ignore_patterns = ["original/*", "*.pth", "*.bin"]
|
55
61
|
snapshot_download(
|
56
|
-
repo_id=self.repo_id,
|
62
|
+
repo_id=self.repo_id,
|
63
|
+
local_dir=checkpoint_path,
|
64
|
+
local_dir_use_symlinks=False,
|
65
|
+
ignore_patterns=ignore_patterns)
|
57
66
|
except Exception as e:
|
58
67
|
logger.error(f"Error downloading model checkpoints {e}")
|
59
68
|
return False
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "11.0.1"
|
@@ -1,40 +0,0 @@
|
|
1
|
-
PYTHON_BASE_IMAGE = 'public.ecr.aws/clarifai-models/python-base:{python_version}'
|
2
|
-
TORCH_BASE_IMAGE = 'public.ecr.aws/clarifai-models/torch:{torch_version}-py{python_version}-cuda{cuda_version}'
|
3
|
-
|
4
|
-
# List of available python base images
|
5
|
-
AVAILABLE_PYTHON_IMAGES = ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
|
6
|
-
|
7
|
-
DEFAULT_PYTHON_VERSION = 3.11
|
8
|
-
|
9
|
-
# List of available torch images
|
10
|
-
AVAILABLE_TORCH_IMAGES = [
|
11
|
-
'1.13.1-py3.8-cuda117',
|
12
|
-
'1.13.1-py3.9-cuda117',
|
13
|
-
'1.13.1-py3.10-cuda117',
|
14
|
-
'2.1.2-py3.8-cuda121',
|
15
|
-
'2.1.2-py3.9-cuda121',
|
16
|
-
'2.1.2-py3.10-cuda121',
|
17
|
-
'2.1.2-py3.11-cuda121',
|
18
|
-
'2.2.2-py3.8-cuda121',
|
19
|
-
'2.2.2-py3.9-cuda121',
|
20
|
-
'2.2.2-py3.10-cuda121',
|
21
|
-
'2.2.2-py3.11-cuda121',
|
22
|
-
'2.2.2-py3.12-cuda121',
|
23
|
-
'2.3.1-py3.8-cuda121',
|
24
|
-
'2.3.1-py3.9-cuda121',
|
25
|
-
'2.3.1-py3.10-cuda121',
|
26
|
-
'2.3.1-py3.11-cuda121',
|
27
|
-
'2.3.1-py3.12-cuda121',
|
28
|
-
'2.4.1-py3.8-cuda124',
|
29
|
-
'2.4.1-py3.9-cuda124',
|
30
|
-
'2.4.1-py3.10-cuda124',
|
31
|
-
'2.4.1-py3.11-cuda124',
|
32
|
-
'2.4.1-py3.12-cuda124',
|
33
|
-
'2.5.1-py3.9-cuda124',
|
34
|
-
'2.5.1-py3.10-cuda124',
|
35
|
-
'2.5.1-py3.11-cuda124',
|
36
|
-
'2.5.1-py3.12-cuda124',
|
37
|
-
]
|
38
|
-
CONCEPTS_REQUIRED_MODEL_TYPE = [
|
39
|
-
'visual-classifier', 'visual-detector', 'visual-segmenter', 'text-classifier'
|
40
|
-
]
|
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.0.1 → clarifai-11.0.3}/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.0.1 → clarifai-11.0.3}/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
|