clarifai 11.6.3__py3-none-any.whl → 11.6.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 +30 -1
- clarifai/cli/model.py +41 -38
- clarifai/client/nodepool.py +1 -1
- clarifai/runners/dockerfile_template/Dockerfile.template +1 -1
- clarifai/runners/models/model_builder.py +1 -1
- clarifai/utils/cli.py +50 -1
- clarifai/utils/constants.py +16 -16
- {clarifai-11.6.3.dist-info → clarifai-11.6.4.dist-info}/METADATA +1 -1
- {clarifai-11.6.3.dist-info → clarifai-11.6.4.dist-info}/RECORD +14 -14
- {clarifai-11.6.3.dist-info → clarifai-11.6.4.dist-info}/WHEEL +0 -0
- {clarifai-11.6.3.dist-info → clarifai-11.6.4.dist-info}/entry_points.txt +0 -0
- {clarifai-11.6.3.dist-info → clarifai-11.6.4.dist-info}/licenses/LICENSE +0 -0
- {clarifai-11.6.3.dist-info → clarifai-11.6.4.dist-info}/top_level.txt +0 -0
clarifai/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "11.6.
|
1
|
+
__version__ = "11.6.4"
|
clarifai/cli/base.py
CHANGED
@@ -154,11 +154,12 @@ def env(ctx_obj):
|
|
154
154
|
|
155
155
|
|
156
156
|
@cli.command()
|
157
|
-
@click.argument('api_url', default=
|
157
|
+
@click.argument('api_url', default=DEFAULT_BASE)
|
158
158
|
@click.option('--user_id', required=False, help='User ID')
|
159
159
|
@click.pass_context
|
160
160
|
def login(ctx, api_url, user_id):
|
161
161
|
"""Login command to set PAT and other configurations."""
|
162
|
+
from clarifai.utils.cli import validate_pat_token
|
162
163
|
|
163
164
|
name = input('context name (default: "default"): ')
|
164
165
|
user_id = user_id if user_id is not None else input('user id: ')
|
@@ -167,6 +168,18 @@ def login(ctx, api_url, user_id):
|
|
167
168
|
'ENVVAR',
|
168
169
|
)
|
169
170
|
|
171
|
+
# Validate the PAT token if it's not "ENVVAR"
|
172
|
+
if pat != "ENVVAR":
|
173
|
+
print("Validating PAT token...")
|
174
|
+
is_valid, error_message = validate_pat_token(pat, user_id, api_url)
|
175
|
+
|
176
|
+
if not is_valid:
|
177
|
+
print(f"❌ PAT token validation failed: {error_message}")
|
178
|
+
print("Please check your token and try again.")
|
179
|
+
return # Exit without saving the configuration
|
180
|
+
else:
|
181
|
+
print("✓ PAT token is valid")
|
182
|
+
|
170
183
|
context = Context(
|
171
184
|
name,
|
172
185
|
CLARIFAI_API_BASE=api_url,
|
@@ -181,6 +194,7 @@ def login(ctx, api_url, user_id):
|
|
181
194
|
ctx.obj.current_context = context.name
|
182
195
|
|
183
196
|
ctx.obj.to_yaml()
|
197
|
+
print(f"✓ Configuration saved successfully for context '{context.name}'")
|
184
198
|
|
185
199
|
|
186
200
|
@cli.group(cls=AliasedGroup)
|
@@ -211,6 +225,8 @@ def create(
|
|
211
225
|
pat=None,
|
212
226
|
):
|
213
227
|
"""Create a new context"""
|
228
|
+
from clarifai.utils.cli import validate_pat_token
|
229
|
+
|
214
230
|
if name in ctx.obj.contexts:
|
215
231
|
print(f'{name} already exists')
|
216
232
|
sys.exit(1)
|
@@ -226,9 +242,22 @@ def create(
|
|
226
242
|
'ENVVAR',
|
227
243
|
)
|
228
244
|
|
245
|
+
# Validate the PAT token if it's not "ENVVAR"
|
246
|
+
if pat != "ENVVAR":
|
247
|
+
print("Validating PAT token...")
|
248
|
+
is_valid, error_message = validate_pat_token(pat, user_id, base_url)
|
249
|
+
|
250
|
+
if not is_valid:
|
251
|
+
print(f"❌ PAT token validation failed: {error_message}")
|
252
|
+
print("Please check your token and try again.")
|
253
|
+
return # Exit without saving the configuration
|
254
|
+
else:
|
255
|
+
print("✓ PAT token is valid")
|
256
|
+
|
229
257
|
context = Context(name, CLARIFAI_USER_ID=user_id, CLARIFAI_API_BASE=base_url, CLARIFAI_PAT=pat)
|
230
258
|
ctx.obj.contexts[context.name] = context
|
231
259
|
ctx.obj.to_yaml()
|
260
|
+
print(f"✓ Context '{name}' created successfully")
|
232
261
|
|
233
262
|
|
234
263
|
# write a click command to delete a context
|
clarifai/cli/model.py
CHANGED
@@ -7,14 +7,14 @@ import click
|
|
7
7
|
from clarifai.cli.base import cli
|
8
8
|
from clarifai.utils.cli import validate_context
|
9
9
|
from clarifai.utils.constants import (
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
10
|
+
DEFAULT_LOCAL_RUNNER_APP_ID,
|
11
|
+
DEFAULT_LOCAL_RUNNER_COMPUTE_CLUSTER_CONFIG,
|
12
|
+
DEFAULT_LOCAL_RUNNER_COMPUTE_CLUSTER_ID,
|
13
|
+
DEFAULT_LOCAL_RUNNER_DEPLOYMENT_ID,
|
14
|
+
DEFAULT_LOCAL_RUNNER_MODEL_ID,
|
15
|
+
DEFAULT_LOCAL_RUNNER_MODEL_TYPE,
|
16
|
+
DEFAULT_LOCAL_RUNNER_NODEPOOL_CONFIG,
|
17
|
+
DEFAULT_LOCAL_RUNNER_NODEPOOL_ID,
|
18
18
|
)
|
19
19
|
from clarifai.utils.logging import logger
|
20
20
|
from clarifai.utils.misc import clone_github_repo, format_github_repo_url
|
@@ -421,17 +421,16 @@ def run_locally(model_path, port, mode, keep_env, keep_image, skip_dockerfile=Fa
|
|
421
421
|
@click.option(
|
422
422
|
"--pool_size",
|
423
423
|
type=int,
|
424
|
-
|
425
|
-
default=1, # default to 1 thread for local dev runner to avoid rapid depletion of compute time.
|
424
|
+
default=1, # default to 1 thread for local runner to avoid rapid depletion of compute time.
|
426
425
|
show_default=True,
|
427
426
|
help="The number of threads to use. On community plan, the compute time allocation is drained at a rate proportional to the number of threads.",
|
428
427
|
) # pylint: disable=range-builtin-not-iterating
|
429
428
|
@click.pass_context
|
430
|
-
def
|
431
|
-
"""Run the model as a local
|
429
|
+
def local_runner(ctx, model_path, pool_size):
|
430
|
+
"""Run the model as a local runner to help debug your model connected to the API or to
|
432
431
|
leverage local compute resources manually. This relies on many variables being present in the env
|
433
432
|
of the currently selected context. If they are not present then default values will be used to
|
434
|
-
ease the setup of a local
|
433
|
+
ease the setup of a local runner and your context yaml will be updated in place. The required
|
435
434
|
env vars are:
|
436
435
|
|
437
436
|
\b
|
@@ -445,7 +444,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
445
444
|
CLARIFAI_MODEL_ID:
|
446
445
|
|
447
446
|
\b
|
448
|
-
# for where the local
|
447
|
+
# for where the local runner should be in a compute cluster
|
449
448
|
# note the user_id of the compute cluster is the same as the user_id of the model.
|
450
449
|
|
451
450
|
\b
|
@@ -460,7 +459,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
460
459
|
Additionally using the provided model path, if the config.yaml file does not contain the model
|
461
460
|
information that matches the above CLARIFAI_USER_ID, CLARIFAI_APP_ID, CLARIFAI_MODEL_ID then the
|
462
461
|
config.yaml will be updated to include the model information. This is to ensure that the model
|
463
|
-
that starts up in the local
|
462
|
+
that starts up in the local runner is the same as the one you intend to call in the API.
|
464
463
|
|
465
464
|
MODEL_PATH: Path to the model directory. If not specified, the current directory is used by default.
|
466
465
|
"""
|
@@ -469,25 +468,29 @@ def local_dev(ctx, model_path, pool_size):
|
|
469
468
|
from clarifai.runners.server import serve
|
470
469
|
|
471
470
|
validate_context(ctx)
|
472
|
-
logger.info("Checking setup for local
|
471
|
+
logger.info("Checking setup for local runner...")
|
473
472
|
logger.info(f"Current context: {ctx.obj.current.name}")
|
474
473
|
user_id = ctx.obj.current.user_id
|
475
|
-
user = User(user_id=user_id, pat=ctx.obj.current.pat, base_url=ctx.obj.current.api_base)
|
476
474
|
logger.info(f"Current user_id: {user_id}")
|
477
|
-
|
475
|
+
if not user_id:
|
476
|
+
raise ValueError(
|
477
|
+
f"User with ID '{user_id}' not found. Use 'clarifai login' to setup context."
|
478
|
+
)
|
479
|
+
user = User(user_id=user_id, pat=ctx.obj.current.pat, base_url=ctx.obj.current.api_base)
|
480
|
+
logger.debug("Checking if a local runner compute cluster exists...")
|
478
481
|
|
479
482
|
# see if ctx has CLARIFAI_COMPUTE_CLUSTER_ID, if not use default
|
480
483
|
try:
|
481
484
|
compute_cluster_id = ctx.obj.current.compute_cluster_id
|
482
485
|
except AttributeError:
|
483
|
-
compute_cluster_id =
|
486
|
+
compute_cluster_id = DEFAULT_LOCAL_RUNNER_COMPUTE_CLUSTER_ID
|
484
487
|
logger.info(f"Current compute_cluster_id: {compute_cluster_id}")
|
485
488
|
|
486
489
|
try:
|
487
490
|
compute_cluster = user.compute_cluster(compute_cluster_id)
|
488
491
|
if compute_cluster.cluster_type != 'local-dev':
|
489
492
|
raise ValueError(
|
490
|
-
f"Compute cluster {user_id}/{compute_cluster_id} is not a local-
|
493
|
+
f"Compute cluster {user_id}/{compute_cluster_id} is not a local-runner compute cluster. Please create a local-runner compute cluster."
|
491
494
|
)
|
492
495
|
try:
|
493
496
|
compute_cluster_id = ctx.obj.current.compute_cluster_id
|
@@ -503,10 +506,10 @@ def local_dev(ctx, model_path, pool_size):
|
|
503
506
|
)
|
504
507
|
if y.lower() != 'y':
|
505
508
|
raise click.Abort()
|
506
|
-
# Create a compute cluster with default configuration for local
|
509
|
+
# Create a compute cluster with default configuration for local runner.
|
507
510
|
compute_cluster = user.create_compute_cluster(
|
508
511
|
compute_cluster_id=compute_cluster_id,
|
509
|
-
compute_cluster_config=
|
512
|
+
compute_cluster_config=DEFAULT_LOCAL_RUNNER_COMPUTE_CLUSTER_CONFIG,
|
510
513
|
)
|
511
514
|
ctx.obj.current.CLARIFAI_COMPUTE_CLUSTER_ID = compute_cluster_id
|
512
515
|
ctx.obj.to_yaml() # save to yaml file.
|
@@ -515,7 +518,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
515
518
|
try:
|
516
519
|
nodepool_id = ctx.obj.current.nodepool_id
|
517
520
|
except AttributeError:
|
518
|
-
nodepool_id =
|
521
|
+
nodepool_id = DEFAULT_LOCAL_RUNNER_NODEPOOL_ID
|
519
522
|
logger.info(f"Current nodepool_id: {nodepool_id}")
|
520
523
|
|
521
524
|
try:
|
@@ -533,7 +536,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
533
536
|
if y.lower() != 'y':
|
534
537
|
raise click.Abort()
|
535
538
|
nodepool = compute_cluster.create_nodepool(
|
536
|
-
nodepool_config=
|
539
|
+
nodepool_config=DEFAULT_LOCAL_RUNNER_NODEPOOL_CONFIG, nodepool_id=nodepool_id
|
537
540
|
)
|
538
541
|
ctx.obj.current.CLARIFAI_NODEPOOL_ID = nodepool_id
|
539
542
|
ctx.obj.to_yaml() # save to yaml file.
|
@@ -543,7 +546,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
543
546
|
try:
|
544
547
|
app_id = ctx.obj.current.app_id
|
545
548
|
except AttributeError:
|
546
|
-
app_id =
|
549
|
+
app_id = DEFAULT_LOCAL_RUNNER_APP_ID
|
547
550
|
logger.info(f"Current app_id: {app_id}")
|
548
551
|
|
549
552
|
try:
|
@@ -562,11 +565,11 @@ def local_dev(ctx, model_path, pool_size):
|
|
562
565
|
ctx.obj.current.CLARIFAI_APP_ID = app_id
|
563
566
|
ctx.obj.to_yaml() # save to yaml file.
|
564
567
|
|
565
|
-
# Within this app we now need a model to call as the local
|
568
|
+
# Within this app we now need a model to call as the local runner.
|
566
569
|
try:
|
567
570
|
model_id = ctx.obj.current.model_id
|
568
571
|
except AttributeError:
|
569
|
-
model_id =
|
572
|
+
model_id = DEFAULT_LOCAL_RUNNER_MODEL_ID
|
570
573
|
logger.info(f"Current model_id: {model_id}")
|
571
574
|
|
572
575
|
try:
|
@@ -586,7 +589,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
586
589
|
try:
|
587
590
|
model_type_id = ctx.obj.current.model_type_id
|
588
591
|
except AttributeError:
|
589
|
-
model_type_id =
|
592
|
+
model_type_id = DEFAULT_LOCAL_RUNNER_MODEL_TYPE
|
590
593
|
|
591
594
|
model = app.create_model(model_id, model_type_id=model_type_id)
|
592
595
|
ctx.obj.current.CLARIFAI_MODEL_TYPE_ID = model_type_id
|
@@ -594,10 +597,10 @@ def local_dev(ctx, model_path, pool_size):
|
|
594
597
|
ctx.obj.to_yaml() # save to yaml file.
|
595
598
|
|
596
599
|
# Now we need to create a version for the model if no version exists. Only need one version that
|
597
|
-
# mentions it's a local
|
600
|
+
# mentions it's a local runner.
|
598
601
|
model_versions = [v for v in model.list_versions()]
|
599
602
|
if len(model_versions) == 0:
|
600
|
-
logger.info("No model versions found. Creating a new version for local
|
603
|
+
logger.info("No model versions found. Creating a new version for local runner.")
|
601
604
|
version = model.create_version(pretrained_model_config={"local_dev": True}).model_version
|
602
605
|
logger.info(f"Created model version {version.id}")
|
603
606
|
else:
|
@@ -631,12 +634,12 @@ def local_dev(ctx, model_path, pool_size):
|
|
631
634
|
raise AttributeError("Runner not found in nodepool.") from e
|
632
635
|
except AttributeError:
|
633
636
|
logger.info(
|
634
|
-
f"Create the local
|
637
|
+
f"Create the local runner tying this\n {user_id}/{app_id}/models/{model.id} model (version: {version.id}) to the\n {user_id}/{compute_cluster_id}/{nodepool_id} nodepool."
|
635
638
|
)
|
636
639
|
runner = nodepool.create_runner(
|
637
640
|
runner_config={
|
638
641
|
"runner": {
|
639
|
-
"description": "
|
642
|
+
"description": "local runner for model testing",
|
640
643
|
"worker": worker,
|
641
644
|
"num_replicas": 1,
|
642
645
|
}
|
@@ -653,7 +656,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
653
656
|
try:
|
654
657
|
deployment_id = ctx.obj.current.deployment_id
|
655
658
|
except AttributeError:
|
656
|
-
deployment_id =
|
659
|
+
deployment_id = DEFAULT_LOCAL_RUNNER_DEPLOYMENT_ID
|
657
660
|
try:
|
658
661
|
deployment = nodepool.deployment(deployment_id)
|
659
662
|
# ensure the deployment is using the latest version.
|
@@ -708,7 +711,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
708
711
|
f"config.yaml not found in {model_path}. Please ensure you are passing the correct directory."
|
709
712
|
)
|
710
713
|
config = ModelBuilder._load_config(config_file)
|
711
|
-
model_type_id = config.get('model', {}).get('model_type_id',
|
714
|
+
model_type_id = config.get('model', {}).get('model_type_id', DEFAULT_LOCAL_RUNNER_MODEL_TYPE)
|
712
715
|
# The config.yaml doens't match what we created above.
|
713
716
|
if 'model' in config and model_id != config['model'].get('id'):
|
714
717
|
logger.info(f"Current model section of config.yaml: {config.get('model', {})}")
|
@@ -717,14 +720,14 @@ def local_dev(ctx, model_path, pool_size):
|
|
717
720
|
)
|
718
721
|
if y.lower() != 'y':
|
719
722
|
raise click.Abort()
|
720
|
-
config = ModelBuilder.
|
723
|
+
config = ModelBuilder._set_local_runner_model(
|
721
724
|
config, user_id, app_id, model_id, model_type_id
|
722
725
|
)
|
723
726
|
ModelBuilder._backup_config(config_file)
|
724
727
|
ModelBuilder._save_config(config_file, config)
|
725
728
|
|
726
729
|
builder = ModelBuilder(model_path, download_validation_only=True)
|
727
|
-
# don't mock for local
|
730
|
+
# don't mock for local runner since you need the dependencies to run the code anyways.
|
728
731
|
method_signatures = builder.get_method_signatures(mocking=False)
|
729
732
|
|
730
733
|
from clarifai.runners.utils import code_script
|
@@ -740,12 +743,12 @@ def local_dev(ctx, model_path, pool_size):
|
|
740
743
|
|
741
744
|
logger.info("""\n
|
742
745
|
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
743
|
-
# About to start up the local
|
746
|
+
# About to start up the local runner in this terminal...
|
744
747
|
# Here is a code snippet to call this model once it start from another terminal:
|
745
748
|
""")
|
746
749
|
logger.info(snippet)
|
747
750
|
|
748
|
-
logger.info("Now starting the local
|
751
|
+
logger.info("Now starting the local runner...")
|
749
752
|
|
750
753
|
# This reads the config.yaml from the model_path so we alter it above first.
|
751
754
|
serve(
|
clarifai/client/nodepool.py
CHANGED
@@ -280,7 +280,7 @@ class Nodepool(Lister, BaseClient):
|
|
280
280
|
def create_runner(
|
281
281
|
self, config_filepath: str = None, runner_config: Dict[str, Any] = None
|
282
282
|
) -> Runner:
|
283
|
-
"""Creates a runner for the nodepool. Only needed for local
|
283
|
+
"""Creates a runner for the nodepool. Only needed for local runners.
|
284
284
|
|
285
285
|
Args:
|
286
286
|
config_filepath (str): The path to the runner config file.
|
@@ -48,7 +48,7 @@ ENV PYTHONPATH=${PYTHONPATH}:/home/nonroot/main \
|
|
48
48
|
CLARIFAI_COMPUTE_CLUSTER_ID=${CLARIFAI_COMPUTE_CLUSTER_ID} \
|
49
49
|
CLARIFAI_API_BASE=${CLARIFAI_API_BASE:-https://api.clarifai.com}
|
50
50
|
|
51
|
-
# Finally run the clarifai entrypoint to start the runner loop and local
|
51
|
+
# Finally run the clarifai entrypoint to start the runner loop and local runner server.
|
52
52
|
# Note(zeiler): we may want to make this a clarifai CLI call.
|
53
53
|
ENTRYPOINT ["python", "-m", "clarifai.runners.server"]
|
54
54
|
CMD ["--model_path", "/home/nonroot/main"]
|
@@ -383,7 +383,7 @@ class ModelBuilder:
|
|
383
383
|
sys.exit(1)
|
384
384
|
|
385
385
|
@staticmethod
|
386
|
-
def
|
386
|
+
def _set_local_runner_model(config, user_id, app_id, model_id, model_type_id):
|
387
387
|
"""
|
388
388
|
Sets the model configuration for local development.
|
389
389
|
This is used when running the model locally without uploading it to Clarifai.
|
clarifai/utils/cli.py
CHANGED
@@ -4,7 +4,7 @@ import pkgutil
|
|
4
4
|
import sys
|
5
5
|
import typing as t
|
6
6
|
from collections import defaultdict
|
7
|
-
from typing import OrderedDict
|
7
|
+
from typing import OrderedDict, Tuple
|
8
8
|
|
9
9
|
import click
|
10
10
|
import yaml
|
@@ -172,3 +172,52 @@ def validate_context(ctx):
|
|
172
172
|
if ctx.obj == {}:
|
173
173
|
logger.error("CLI config file missing. Run `clarifai login` to set up the CLI config.")
|
174
174
|
sys.exit(1)
|
175
|
+
|
176
|
+
|
177
|
+
def validate_pat_token(pat: str, user_id: str, api_base: str = None) -> Tuple[bool, str]:
|
178
|
+
"""
|
179
|
+
Validate a Personal Access Token (PAT) by making a test API call.
|
180
|
+
|
181
|
+
Args:
|
182
|
+
pat (str): The Personal Access Token to validate
|
183
|
+
user_id (str): The user ID associated with the token
|
184
|
+
api_base (str): The API base URL. Defaults to None (uses default).
|
185
|
+
|
186
|
+
Returns:
|
187
|
+
tuple[bool, str]: A tuple of (is_valid, error_message)
|
188
|
+
If valid: (True, "")
|
189
|
+
If invalid: (False, error_description)
|
190
|
+
"""
|
191
|
+
try:
|
192
|
+
from clarifai_grpc.grpc.api.status import status_code_pb2
|
193
|
+
|
194
|
+
from clarifai.client.user import User
|
195
|
+
|
196
|
+
# Create user client for validation
|
197
|
+
if api_base:
|
198
|
+
user_client = User(user_id=user_id, pat=pat, base_url=api_base)
|
199
|
+
else:
|
200
|
+
user_client = User(user_id=user_id, pat=pat)
|
201
|
+
|
202
|
+
# Try to get user info as a test API call
|
203
|
+
response = user_client.get_user_info()
|
204
|
+
|
205
|
+
if response.status.code == status_code_pb2.SUCCESS:
|
206
|
+
return True, ""
|
207
|
+
else:
|
208
|
+
return False, f"Authentication failed: {response.status.description}"
|
209
|
+
|
210
|
+
except Exception as e:
|
211
|
+
error_msg = str(e)
|
212
|
+
|
213
|
+
# Check for common authentication errors and provide user-friendly messages
|
214
|
+
if "PERMISSION_DENIED" in error_msg or "Unauthorized" in error_msg:
|
215
|
+
return False, "Invalid PAT token or insufficient permissions"
|
216
|
+
elif "UNAUTHENTICATED" in error_msg:
|
217
|
+
return False, "Invalid PAT token"
|
218
|
+
elif "SSL" in error_msg or "certificate" in error_msg:
|
219
|
+
return False, f"SSL/Certificate error: {error_msg}"
|
220
|
+
elif "Connection" in error_msg or "timeout" in error_msg:
|
221
|
+
return False, f"Network connection error: {error_msg}"
|
222
|
+
else:
|
223
|
+
return False, f"Validation error: {error_msg}"
|
clarifai/utils/constants.py
CHANGED
@@ -14,20 +14,20 @@ CLARIFAI_USER_ID_ENV_VAR = "CLARIFAI_USER_ID"
|
|
14
14
|
HOME_PATH = Path.home()
|
15
15
|
DEFAULT_CONFIG = HOME_PATH / '.config/clarifai/config'
|
16
16
|
|
17
|
-
# Default clusters, etc. for local
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
17
|
+
# Default clusters, etc. for local runner easy setup
|
18
|
+
DEFAULT_LOCAL_RUNNER_COMPUTE_CLUSTER_ID = "local-runner-compute-cluster"
|
19
|
+
DEFAULT_LOCAL_RUNNER_NODEPOOL_ID = "local-runner-nodepool"
|
20
|
+
DEFAULT_LOCAL_RUNNER_DEPLOYMENT_ID = "local-runner-deployment"
|
21
|
+
DEFAULT_LOCAL_RUNNER_MODEL_ID = "local-runner-model"
|
22
|
+
DEFAULT_LOCAL_RUNNER_APP_ID = "local-runner-app"
|
23
23
|
|
24
24
|
# FIXME: should have any-to-any for these cases.
|
25
|
-
|
25
|
+
DEFAULT_LOCAL_RUNNER_MODEL_TYPE = "text-to-text"
|
26
26
|
|
27
|
-
|
27
|
+
DEFAULT_LOCAL_RUNNER_COMPUTE_CLUSTER_CONFIG = {
|
28
28
|
"compute_cluster": {
|
29
|
-
"id":
|
30
|
-
"description": "Default Local
|
29
|
+
"id": DEFAULT_LOCAL_RUNNER_COMPUTE_CLUSTER_ID,
|
30
|
+
"description": "Default Local Runner Compute Cluster",
|
31
31
|
"cloud_provider": {
|
32
32
|
"id": "local",
|
33
33
|
},
|
@@ -37,12 +37,12 @@ DEFAULT_LOCAL_DEV_COMPUTE_CLUSTER_CONFIG = {
|
|
37
37
|
}
|
38
38
|
}
|
39
39
|
|
40
|
-
|
40
|
+
DEFAULT_LOCAL_RUNNER_NODEPOOL_CONFIG = {
|
41
41
|
"nodepool": {
|
42
|
-
"id":
|
43
|
-
"description": "Default Local
|
42
|
+
"id": DEFAULT_LOCAL_RUNNER_NODEPOOL_ID,
|
43
|
+
"description": "Default Local Runner Nodepool",
|
44
44
|
"compute_cluster": {
|
45
|
-
"id":
|
45
|
+
"id": DEFAULT_LOCAL_RUNNER_COMPUTE_CLUSTER_ID,
|
46
46
|
"user_id": None, # This will be set when creating the compute cluster
|
47
47
|
},
|
48
48
|
"instance_types": [
|
@@ -50,8 +50,8 @@ DEFAULT_LOCAL_DEV_NODEPOOL_CONFIG = {
|
|
50
50
|
"id": "local",
|
51
51
|
"compute_info": {
|
52
52
|
"cpu_limit": str(os.cpu_count()),
|
53
|
-
"cpu_memory": "16Gi", # made up as we don't schedule based on this for local
|
54
|
-
"num_accelerators": 0, # TODO if we need accelerator detection for local
|
53
|
+
"cpu_memory": "16Gi", # made up as we don't schedule based on this for local runner.
|
54
|
+
"num_accelerators": 0, # TODO if we need accelerator detection for local runner.
|
55
55
|
},
|
56
56
|
}
|
57
57
|
],
|
@@ -1,14 +1,14 @@
|
|
1
|
-
clarifai/__init__.py,sha256=
|
1
|
+
clarifai/__init__.py,sha256=ZgNVXF1GLofttgM7cPO7UPsDF57tUzFuRSAVIqizp9I,23
|
2
2
|
clarifai/cli.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
clarifai/errors.py,sha256=GXa6D4v_L404J83jnRNFPH7s-1V9lk7w6Ws99f1g-AY,2772
|
4
4
|
clarifai/versions.py,sha256=ecSuEB_nOL2XSoYHDw2n23XUbm_KPOGjudMXmQrGdS8,224
|
5
5
|
clarifai/cli/README.md,sha256=YGApHfeUyu5P0Pdth-mqQCQftWHDxz6bugDlvDXDhOE,1942
|
6
6
|
clarifai/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
7
|
clarifai/cli/__main__.py,sha256=7nPbLW7Jr2shkgMPvnxpn4xYGMvIcnqluJ69t9w4H_k,74
|
8
|
-
clarifai/cli/base.py,sha256=
|
8
|
+
clarifai/cli/base.py,sha256=c13duXsBWnUJO2bsg-vKtCQqRKRUFWaq8eaGn5uvlvs,9496
|
9
9
|
clarifai/cli/compute_cluster.py,sha256=8Xss0Obrp6l1XuxJe0luOqU_pf8vXGDRi6jyIe8qR6k,2282
|
10
10
|
clarifai/cli/deployment.py,sha256=9C4I6_kyMxRkWl6h681wc79-3mAtDHtTUaxRv05OZMs,4262
|
11
|
-
clarifai/cli/model.py,sha256=
|
11
|
+
clarifai/cli/model.py,sha256=hULNQp3YIX-L6VsehkdNX0p3VLt6WCcwalFvDClULWw,36728
|
12
12
|
clarifai/cli/nodepool.py,sha256=H6OIdUW_EiyDUwZogzEDoYmVwEjLMsgoDlPyE7gjIuU,4245
|
13
13
|
clarifai/cli/pipeline.py,sha256=smWPCK9kLCqnjTCb3w8BAeiAcowY20Bdxfk-OCzCi0I,10601
|
14
14
|
clarifai/cli/pipeline_step.py,sha256=Unrq63w5rjwyhHHmRhV-enztO1HuVTnimAXltNCotQs,3814
|
@@ -27,7 +27,7 @@ clarifai/client/lister.py,sha256=1YEm2suNxPaJO4x9V5szgD_YX6N_00vgSO-7m0HagY8,220
|
|
27
27
|
clarifai/client/model.py,sha256=rGNeMgL8kgEUsB3Y1lSl6CfE1XuXY0me57-8_o2TNn4,90726
|
28
28
|
clarifai/client/model_client.py,sha256=4gIS0mKBdiNMA1x_6Wo6H7WbfLsmQix64EpONcQjQV4,37129
|
29
29
|
clarifai/client/module.py,sha256=jLViQYvVV3FmRN_ivvbk83uwsx7CgYGeEx4dYAr6yD4,4537
|
30
|
-
clarifai/client/nodepool.py,sha256
|
30
|
+
clarifai/client/nodepool.py,sha256=-pFewsdbDa5_2Xo3vm3edAVdBp80ANDzQsQ6DMBlOcg,16411
|
31
31
|
clarifai/client/pipeline.py,sha256=Hy3qnSX1pcoi-OAtdzr-qxkRYi1CxsaUzsfS3GDtETM,14358
|
32
32
|
clarifai/client/runner.py,sha256=5xCiqByGGscfNm0IjHelhDTx8-9l8G0C3HL-3YZogK8,2253
|
33
33
|
clarifai/client/search.py,sha256=3LLfATrdU43a0mRNITmJV-E53bhfafZkYsbwkTtlnyU,15661
|
@@ -72,11 +72,11 @@ clarifai/rag/rag.py,sha256=EG3GoFrHFCmA70Tz49_0Jo1-3WIaHSgWGHecPeErcdc,14170
|
|
72
72
|
clarifai/rag/utils.py,sha256=_gVZdABuMnraCKViLruV75x0F3IpgFXN6amYSGE5_xc,4462
|
73
73
|
clarifai/runners/__init__.py,sha256=wXLaSljH7qLeJCrZdKEnlQh2tNqTQAIZKWOu2rZ6wGs,279
|
74
74
|
clarifai/runners/server.py,sha256=ic1qI-ZhlePCpJDP94hWIf8X-_D1fiEp2CdtaMvFFMk,4780
|
75
|
-
clarifai/runners/dockerfile_template/Dockerfile.template,sha256=
|
75
|
+
clarifai/runners/dockerfile_template/Dockerfile.template,sha256=nEnIMqzhAXDbd0Ht7QQm0U7AVPIHWQD6kYnFZ0TKJUM,2428
|
76
76
|
clarifai/runners/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
77
77
|
clarifai/runners/models/dummy_openai_model.py,sha256=pcmAVbqTTGG4J3BLVjKfvM_SQ-GET_XexIUdLcr9Zvo,8373
|
78
78
|
clarifai/runners/models/mcp_class.py,sha256=RdKn7rW4vYol0VRDZiLTSMfkqjLhO1ijXAQ0Rq0Jfnw,6647
|
79
|
-
clarifai/runners/models/model_builder.py,sha256=
|
79
|
+
clarifai/runners/models/model_builder.py,sha256=6DEwMo-Aq5CSWxTgMNgQISq2H37HXlkPauOgnmSWhZk,64704
|
80
80
|
clarifai/runners/models/model_class.py,sha256=Ndh437BNMkpFBo6B108GuKL8sGYaGnSplZ6FxOgd_v8,20010
|
81
81
|
clarifai/runners/models/model_run_locally.py,sha256=6-6WjEKc0ba3gAv4wOLdMs2XOzS3b-2bZHJS0wdVqJY,20088
|
82
82
|
clarifai/runners/models/model_runner.py,sha256=tZTX1XKMlniJEmd1WMjcwGfej5NCWqv23HZ4xrG8YV8,9153
|
@@ -104,9 +104,9 @@ clarifai/runners/utils/data_types/data_types.py,sha256=UBHTNPshr94qUs2KqkYis0VlA
|
|
104
104
|
clarifai/schema/search.py,sha256=o9-ct8ulLZByB3RCVwZWPgaDwdcW7cM5s-g8oyAz89s,2421
|
105
105
|
clarifai/urls/helper.py,sha256=z6LnLGgLHxD8scFtyRdxqYIRJNhxqPkfLe53UtTLUBY,11727
|
106
106
|
clarifai/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
107
|
-
clarifai/utils/cli.py,sha256=
|
107
|
+
clarifai/utils/cli.py,sha256=jj3YayqyKwS8LbD32yUHWscS-kkVO4lqXWCrsMX8w8k,7321
|
108
108
|
clarifai/utils/config.py,sha256=jMSWYxJfp_D8eoGqz-HTdsngn5bg_1ymjLidYz6rdLA,7073
|
109
|
-
clarifai/utils/constants.py,sha256=
|
109
|
+
clarifai/utils/constants.py,sha256=q_RbmFltlMipzBc9SasLafH1HFrVK1D048i_PlACAv4,2194
|
110
110
|
clarifai/utils/logging.py,sha256=0we53uTqUvzrulC86whu-oeWNxn1JjJL0OQ98Bwf9vo,15198
|
111
111
|
clarifai/utils/misc.py,sha256=ug5A7m_WdLtFip5_U1jbvT6ZsmsCzFQatjE3B-KcaAQ,5387
|
112
112
|
clarifai/utils/model_train.py,sha256=0XSAoTkSsrwf4f-W9yw2mkXZtkal7LBLJSoi86CFCn4,9250
|
@@ -119,9 +119,9 @@ clarifai/workflows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
119
119
|
clarifai/workflows/export.py,sha256=HvUYG9N_-UZoRR0-_tdGbZ950_AeBqawSppgUxQebR0,1913
|
120
120
|
clarifai/workflows/utils.py,sha256=ESL3INcouNcLKCh-nMpfXX-YbtCzX7tz7hT57_RGQ3M,2079
|
121
121
|
clarifai/workflows/validate.py,sha256=UhmukyHkfxiMFrPPeBdUTiCOHQT5-shqivlBYEyKTlU,2931
|
122
|
-
clarifai-11.6.
|
123
|
-
clarifai-11.6.
|
124
|
-
clarifai-11.6.
|
125
|
-
clarifai-11.6.
|
126
|
-
clarifai-11.6.
|
127
|
-
clarifai-11.6.
|
122
|
+
clarifai-11.6.4.dist-info/licenses/LICENSE,sha256=mUqF_d12-qE2n41g7C5_sq-BMLOcj6CNN-jevr15YHU,555
|
123
|
+
clarifai-11.6.4.dist-info/METADATA,sha256=ZJBmCLCyDjc2RFSLOhPvMZO4cfbEB_m1wMJTucFqZjs,22737
|
124
|
+
clarifai-11.6.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
125
|
+
clarifai-11.6.4.dist-info/entry_points.txt,sha256=X9FZ4Z-i_r2Ud1RpZ9sNIFYuu_-9fogzCMCRUD9hyX0,51
|
126
|
+
clarifai-11.6.4.dist-info/top_level.txt,sha256=wUMdCQGjkxaynZ6nZ9FAnvBUCgp5RJUVFSy2j-KYo0s,9
|
127
|
+
clarifai-11.6.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|