clarifai 11.6.3__tar.gz → 11.6.4rc1__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.6.3/clarifai.egg-info → clarifai-11.6.4rc1}/PKG-INFO +1 -1
- clarifai-11.6.4rc1/clarifai/__init__.py +1 -0
- clarifai-11.6.4rc1/clarifai/__pycache__/__init__.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/__pycache__/errors.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/__pycache__/errors.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/__pycache__/versions.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/__pycache__/versions.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/cli/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/cli/__pycache__/base.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/cli/__pycache__/compute_cluster.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/cli/__pycache__/deployment.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/cli/__pycache__/model.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/cli/__pycache__/nodepool.cpython-39.pyc +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/cli/base.py +15 -2
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/cli/model.py +210 -77
- clarifai-11.6.4rc1/clarifai/client/__pycache__/__init__.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/app.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/app.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/base.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/base.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/compute_cluster.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/dataset.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/dataset.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/deployment.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/deployment.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/input.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/input.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/lister.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/lister.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/model.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/model.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/model_client.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/model_client.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/module.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/nodepool.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/runner.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/search.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/user.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/__pycache__/workflow.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/auth/__pycache__/__init__.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/auth/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/auth/__pycache__/helper.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/auth/__pycache__/helper.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/auth/__pycache__/register.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/auth/__pycache__/register.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/auth/__pycache__/stub.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/client/auth/__pycache__/stub.cpython-39.pyc +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/nodepool.py +1 -1
- clarifai-11.6.4rc1/clarifai/constants/__pycache__/base.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/constants/__pycache__/base.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/constants/__pycache__/dataset.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/constants/__pycache__/dataset.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/constants/__pycache__/input.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/constants/__pycache__/input.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/constants/__pycache__/model.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/constants/__pycache__/model.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/constants/__pycache__/search.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/constants/__pycache__/workflow.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/__pycache__/__init__.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/export/__pycache__/__init__.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/export/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/export/__pycache__/inputs_annotations.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/export/__pycache__/inputs_annotations.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/upload/__pycache__/__init__.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/upload/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/upload/__pycache__/base.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/upload/__pycache__/base.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/upload/__pycache__/features.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/upload/__pycache__/features.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/upload/__pycache__/image.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/upload/__pycache__/image.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/upload/__pycache__/multimodal.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/upload/__pycache__/multimodal.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/upload/__pycache__/text.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/upload/__pycache__/text.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/upload/__pycache__/utils.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/datasets/upload/__pycache__/utils.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/__pycache__/__init__.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/__pycache__/__init__.cpython-39.pyc +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/dockerfile_template/Dockerfile.template +1 -1
- clarifai-11.6.4rc1/clarifai/runners/models/__pycache__/__init__.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/models/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/models/__pycache__/mcp_class.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/models/__pycache__/model_builder.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/models/__pycache__/model_builder.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/models/__pycache__/model_class.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/models/__pycache__/model_runner.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/models/__pycache__/openai_class.cpython-311.pyc +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/models/model_builder.py +1 -1
- clarifai-11.6.4rc1/clarifai/runners/utils/__pycache__/__init__.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/__pycache__/code_script.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/__pycache__/code_script.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/__pycache__/const.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/__pycache__/data_utils.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/__pycache__/data_utils.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/__pycache__/loader.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/__pycache__/method_signatures.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/__pycache__/model_utils.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/__pycache__/openai_convertor.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/__pycache__/serializers.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/__pycache__/url_fetcher.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/data_types/__pycache__/__init__.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/data_types/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/data_types/__pycache__/data_types.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/runners/utils/data_types/__pycache__/data_types.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/schema/__pycache__/search.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/urls/__pycache__/helper.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/urls/__pycache__/helper.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/utils/__pycache__/__init__.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/utils/__pycache__/__init__.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/utils/__pycache__/cli.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/utils/__pycache__/config.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/utils/__pycache__/config.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/utils/__pycache__/constants.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/utils/__pycache__/constants.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/utils/__pycache__/logging.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/utils/__pycache__/logging.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/utils/__pycache__/misc.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/utils/__pycache__/misc.cpython-39.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/utils/__pycache__/model_train.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/utils/__pycache__/protobuf.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/utils/__pycache__/protobuf.cpython-39.pyc +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/utils/cli.py +48 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/utils/constants.py +18 -16
- clarifai-11.6.4rc1/clarifai/utils/misc.py +548 -0
- clarifai-11.6.4rc1/clarifai/workflows/__pycache__/__init__.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/workflows/__pycache__/export.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/workflows/__pycache__/utils.cpython-311.pyc +0 -0
- clarifai-11.6.4rc1/clarifai/workflows/__pycache__/validate.cpython-311.pyc +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1/clarifai.egg-info}/PKG-INFO +1 -1
- clarifai-11.6.4rc1/clarifai.egg-info/SOURCES.txt +270 -0
- clarifai-11.6.3/clarifai/__init__.py +0 -1
- clarifai-11.6.3/clarifai/utils/misc.py +0 -168
- clarifai-11.6.3/clarifai.egg-info/SOURCES.txt +0 -147
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/LICENSE +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/MANIFEST.in +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/README.md +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/cli/README.md +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/cli/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/cli/__main__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/cli/compute_cluster.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/cli/deployment.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/cli/nodepool.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/cli/pipeline.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/cli/pipeline_step.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/cli/templates/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/cli/templates/model_templates.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/cli/templates/pipeline_step_templates.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/cli/templates/pipeline_templates.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/cli.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/app.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/auth/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/auth/helper.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/auth/register.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/auth/stub.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/base.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/compute_cluster.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/dataset.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/deployment.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/input.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/lister.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/model.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/model_client.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/module.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/pipeline.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/runner.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/search.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/user.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/client/workflow.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/constants/base.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/constants/dataset.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/constants/input.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/constants/model.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/constants/rag.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/constants/search.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/constants/workflow.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/export/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/export/inputs_annotations.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/upload/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/upload/base.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/upload/features.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/upload/image.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/upload/loaders/README.md +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/upload/loaders/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/upload/loaders/coco_captions.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/upload/loaders/coco_detection.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/upload/loaders/imagenet_classification.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/upload/loaders/xview_detection.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/upload/multimodal.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/upload/text.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/datasets/upload/utils.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/errors.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/models/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/models/api.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/modules/README.md +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/modules/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/modules/css.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/modules/pages.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/modules/style.css +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/rag/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/rag/rag.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/rag/utils.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/models/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/models/dummy_openai_model.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/models/mcp_class.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/models/model_class.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/models/model_run_locally.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/models/model_runner.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/models/model_servicer.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/models/openai_class.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/models/visual_classifier_class.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/models/visual_detector_class.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/pipeline_steps/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/pipeline_steps/pipeline_step_builder.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/pipelines/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/pipelines/pipeline_builder.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/server.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/utils/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/utils/code_script.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/utils/const.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/utils/data_types/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/utils/data_types/data_types.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/utils/data_utils.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/utils/loader.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/utils/method_signatures.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/utils/model_utils.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/utils/openai_convertor.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/utils/pipeline_validation.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/utils/serializers.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/runners/utils/url_fetcher.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/schema/search.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/urls/helper.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/utils/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/utils/config.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/utils/evaluation/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/utils/evaluation/helpers.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/utils/evaluation/main.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/utils/evaluation/testset_annotation_parser.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/utils/logging.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/utils/model_train.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/utils/protobuf.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/versions.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/workflows/__init__.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/workflows/export.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/workflows/utils.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai/workflows/validate.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai.egg-info/dependency_links.txt +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai.egg-info/entry_points.txt +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai.egg-info/requires.txt +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/clarifai.egg-info/top_level.txt +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/pyproject.toml +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/requirements.txt +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/setup.cfg +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/setup.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/tests/test_app.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/tests/test_async_stub.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/tests/test_auth.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/tests/test_data_upload.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/tests/test_eval.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/tests/test_list_models.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/tests/test_misc.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/tests/test_model_predict.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/tests/test_model_train.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/tests/test_modules.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/tests/test_pipeline_client.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/tests/test_rag.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/tests/test_search.py +0 -0
- {clarifai-11.6.3 → clarifai-11.6.4rc1}/tests/test_stub.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "11.6.4rc1"
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -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_context_auth
|
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,9 @@ def login(ctx, api_url, user_id):
|
|
167
168
|
'ENVVAR',
|
168
169
|
)
|
169
170
|
|
171
|
+
# Validate the Context Credentials
|
172
|
+
validate_context_auth(pat, user_id, api_url)
|
173
|
+
|
170
174
|
context = Context(
|
171
175
|
name,
|
172
176
|
CLARIFAI_API_BASE=api_url,
|
@@ -181,6 +185,9 @@ def login(ctx, api_url, user_id):
|
|
181
185
|
ctx.obj.current_context = context.name
|
182
186
|
|
183
187
|
ctx.obj.to_yaml()
|
188
|
+
logger.info(
|
189
|
+
f"Login successful and Configuration saved successfully for context '{context.name}'"
|
190
|
+
)
|
184
191
|
|
185
192
|
|
186
193
|
@cli.group(cls=AliasedGroup)
|
@@ -211,8 +218,10 @@ def create(
|
|
211
218
|
pat=None,
|
212
219
|
):
|
213
220
|
"""Create a new context"""
|
221
|
+
from clarifai.utils.cli import validate_context_auth
|
222
|
+
|
214
223
|
if name in ctx.obj.contexts:
|
215
|
-
|
224
|
+
logger.info(f'"{name}" context already exists')
|
216
225
|
sys.exit(1)
|
217
226
|
if not user_id:
|
218
227
|
user_id = input('user id: ')
|
@@ -226,9 +235,13 @@ def create(
|
|
226
235
|
'ENVVAR',
|
227
236
|
)
|
228
237
|
|
238
|
+
# Validate the Context Credentials
|
239
|
+
validate_context_auth(pat, user_id, base_url)
|
240
|
+
|
229
241
|
context = Context(name, CLARIFAI_USER_ID=user_id, CLARIFAI_API_BASE=base_url, CLARIFAI_PAT=pat)
|
230
242
|
ctx.obj.contexts[context.name] = context
|
231
243
|
ctx.obj.to_yaml()
|
244
|
+
logger.info(f"Context '{name}' created successfully")
|
232
245
|
|
233
246
|
|
234
247
|
# write a click command to delete a context
|
@@ -4,20 +4,65 @@ import tempfile
|
|
4
4
|
|
5
5
|
import click
|
6
6
|
|
7
|
-
from clarifai.cli.base import cli
|
7
|
+
from clarifai.cli.base import cli, pat_display
|
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
|
+
DEFAULT_OLLAMA_MODEL_REPO,
|
19
|
+
DEFAULT_OLLAMA_MODEL_REPO_BRANCH,
|
18
20
|
)
|
19
21
|
from clarifai.utils.logging import logger
|
20
|
-
from clarifai.utils.misc import clone_github_repo, format_github_repo_url
|
22
|
+
from clarifai.utils.misc import GitHubDownloader, clone_github_repo, format_github_repo_url
|
23
|
+
|
24
|
+
|
25
|
+
def customize_ollama_model(model_path, model_name, port, context_length):
|
26
|
+
"""Customize the Ollama model name in the cloned template files.
|
27
|
+
Args:
|
28
|
+
model_path: Path to the cloned model directory
|
29
|
+
model_name: The model name to set (e.g., 'llama3.1', 'mistral')
|
30
|
+
|
31
|
+
"""
|
32
|
+
model_py_path = os.path.join(model_path, "1", "model.py")
|
33
|
+
|
34
|
+
if not os.path.exists(model_py_path):
|
35
|
+
logger.warning(f"Model file {model_py_path} not found, skipping model name customization")
|
36
|
+
return
|
37
|
+
|
38
|
+
try:
|
39
|
+
# Read the model.py file
|
40
|
+
with open(model_py_path, 'r') as file:
|
41
|
+
content = file.read()
|
42
|
+
if model_name:
|
43
|
+
# Replace the default model name in the load_model method
|
44
|
+
content = content.replace(
|
45
|
+
'self.model = os.environ.get("OLLAMA_MODEL_NAME", \'llama3.2\')',
|
46
|
+
f'self.model = os.environ.get("OLLAMA_MODEL_NAME", \'{model_name}\')',
|
47
|
+
)
|
48
|
+
|
49
|
+
if port:
|
50
|
+
# Replace the default port variable in the model.py file
|
51
|
+
content = content.replace("PORT = '23333'", f"PORT = '{port}'")
|
52
|
+
|
53
|
+
if context_length:
|
54
|
+
# Replace the default context length variable in the model.py file
|
55
|
+
content = content.replace(
|
56
|
+
"context_length = '8192'", f"context_length = '{context_length}'"
|
57
|
+
)
|
58
|
+
|
59
|
+
# Write the modified content back to model.py
|
60
|
+
with open(model_py_path, 'w') as file:
|
61
|
+
file.write(content)
|
62
|
+
|
63
|
+
except Exception as e:
|
64
|
+
logger.error(f"Failed to customize Ollama model name in {model_py_path}: {e}")
|
65
|
+
raise
|
21
66
|
|
22
67
|
|
23
68
|
@cli.group(
|
@@ -48,21 +93,36 @@ def model():
|
|
48
93
|
help='GitHub Personal Access Token for authentication when cloning private repositories.',
|
49
94
|
)
|
50
95
|
@click.option(
|
51
|
-
'--github-
|
96
|
+
'--github-url',
|
52
97
|
required=False,
|
53
98
|
help='GitHub repository URL or "user/repo" format to clone a repository from. If provided, the entire repository contents will be copied to the target directory instead of using default templates.',
|
54
99
|
)
|
55
100
|
@click.option(
|
56
|
-
'--
|
101
|
+
'--toolkit',
|
102
|
+
type=click.Choice(['ollama'], case_sensitive=False),
|
57
103
|
required=False,
|
58
|
-
help='
|
104
|
+
help='Toolkit to use for model initialization. Currently supports "ollama".',
|
59
105
|
)
|
60
106
|
@click.option(
|
61
|
-
'--
|
62
|
-
|
63
|
-
help='
|
107
|
+
'--model-name',
|
108
|
+
required=False,
|
109
|
+
help='Model name to configure when using --toolkit. For ollama toolkit, this sets the Ollama model to use (e.g., "llama3.1", "mistral", etc.).',
|
64
110
|
)
|
65
|
-
|
111
|
+
@click.option(
|
112
|
+
'--port',
|
113
|
+
type=str,
|
114
|
+
help='Port to run the Ollama server on. Defaults to 23333.',
|
115
|
+
required=False,
|
116
|
+
)
|
117
|
+
@click.option(
|
118
|
+
'--context-length',
|
119
|
+
type=str,
|
120
|
+
help='Context length for the Ollama model. Defaults to 8192.',
|
121
|
+
required=False,
|
122
|
+
)
|
123
|
+
def init(
|
124
|
+
model_path, model_type_id, github_pat, github_url, toolkit, model_name, port, context_length
|
125
|
+
):
|
66
126
|
"""Initialize a new model directory structure.
|
67
127
|
|
68
128
|
Creates the following structure in the specified directory:
|
@@ -77,42 +137,99 @@ def init(model_path, model_type_id, github_pat, github_repo, branch, local_ollam
|
|
77
137
|
branch to clone from.
|
78
138
|
|
79
139
|
MODEL_PATH: Path where to create the model directory structure. If not specified, the current directory is used by default.
|
140
|
+
model_type_id: Type of model to initialize. Options are 'mcp' for MCPModelClass or 'openai' for OpenAIModelClass.
|
141
|
+
github_pat: GitHub Personal Access Token for cloning private repositories.
|
142
|
+
github_url: GitHub repository URL or "user/repo" format to clone a repository from. If provided, the entire repository contents will be copied to the target directory instead of using default templates.
|
143
|
+
toolkit: Toolkit to use for model initialization. Currently supports 'ollama'.
|
144
|
+
model_name: Model name to configure when using --toolkit. For ollama toolkit, this sets the Ollama model to use (e.g., 'llama3.1', 'mistral', etc.).
|
145
|
+
port: Port to run the Ollama server on. Defaults to 23333.
|
146
|
+
context_length: Context length for the Ollama model. Defaults to 8192.
|
80
147
|
"""
|
81
|
-
# Handle the --local-ollama-model flag
|
82
|
-
if local_ollama_model:
|
83
|
-
if github_repo or branch:
|
84
|
-
raise click.ClickException(
|
85
|
-
"Cannot specify both --local-ollama-model and --github-repo/--branch"
|
86
|
-
)
|
87
|
-
github_repo = "https://github.com/Clarifai/runners-examples"
|
88
|
-
branch = "ollama"
|
89
|
-
|
90
148
|
# Resolve the absolute path
|
91
149
|
model_path = os.path.abspath(model_path)
|
92
150
|
|
93
151
|
# Create the model directory if it doesn't exist
|
94
152
|
os.makedirs(model_path, exist_ok=True)
|
95
153
|
|
96
|
-
#
|
97
|
-
if
|
98
|
-
logger.
|
154
|
+
# Validate parameters
|
155
|
+
if port and not port.isdigit():
|
156
|
+
logger.error("Invalid value: --port must be a number")
|
157
|
+
raise click.Abort()
|
158
|
+
|
159
|
+
if context_length and not context_length.isdigit():
|
160
|
+
logger.error("Invalid value: --context-length must be a number")
|
161
|
+
raise click.Abort()
|
162
|
+
|
163
|
+
# Validate option combinations
|
164
|
+
if model_name and not (toolkit):
|
165
|
+
logger.error("--model-name can only be used with --toolkit")
|
166
|
+
raise click.Abort()
|
167
|
+
|
168
|
+
if toolkit and (github_url):
|
169
|
+
logger.error("Cannot specify both --toolkit and --github-repo")
|
170
|
+
raise click.Abort()
|
171
|
+
|
172
|
+
# --toolkit option
|
173
|
+
if toolkit == 'ollama':
|
174
|
+
github_url = DEFAULT_OLLAMA_MODEL_REPO
|
175
|
+
branch = DEFAULT_OLLAMA_MODEL_REPO_BRANCH
|
176
|
+
|
177
|
+
if github_url:
|
178
|
+
if not toolkit:
|
179
|
+
owner, repo, branch, folder_path = GitHubDownloader().parse_github_url(url=github_url)
|
180
|
+
logger.info(
|
181
|
+
f"Parsed GitHub repository: owner={owner}, repo={repo}, branch={branch}, folder_path={folder_path}"
|
182
|
+
)
|
183
|
+
if folder_path != "":
|
184
|
+
downloader = GitHubDownloader(
|
185
|
+
max_retries=3,
|
186
|
+
github_token=github_pat,
|
187
|
+
)
|
188
|
+
try:
|
189
|
+
downloader.download_github_folder(
|
190
|
+
url=github_url,
|
191
|
+
output_dir=model_path,
|
192
|
+
github_token=github_pat,
|
193
|
+
)
|
194
|
+
logger.info(f"Successfully downloaded folder contents to {model_path}")
|
195
|
+
logger.info("Model initialization complete with GitHub folder download")
|
196
|
+
return
|
197
|
+
|
198
|
+
except Exception as e:
|
199
|
+
logger.error(f"Failed to download GitHub folder: {e}")
|
200
|
+
# Continue with the rest of the initialization process
|
201
|
+
github_url = None # Fall back to template mode
|
202
|
+
|
203
|
+
elif branch and folder_path == "":
|
204
|
+
# When we have a branch but no specific folder path
|
205
|
+
logger.info(
|
206
|
+
f"Initializing model from GitHub repository: {github_url} (branch: {branch})"
|
207
|
+
)
|
208
|
+
|
209
|
+
# Check if it's a local path or normalize the GitHub repo URL
|
210
|
+
if os.path.exists(github_url):
|
211
|
+
repo_url = github_url
|
212
|
+
else:
|
213
|
+
repo_url = format_github_repo_url(github_url)
|
214
|
+
repo_url = f"https://github.com/{owner}/{repo}"
|
215
|
+
|
216
|
+
if toolkit:
|
217
|
+
logger.info(f"Initializing model from GitHub repository: {github_url}")
|
99
218
|
|
100
219
|
# Check if it's a local path or normalize the GitHub repo URL
|
101
|
-
if os.path.exists(
|
102
|
-
repo_url =
|
220
|
+
if os.path.exists(github_url):
|
221
|
+
repo_url = github_url
|
103
222
|
else:
|
104
|
-
repo_url = format_github_repo_url(
|
223
|
+
repo_url = format_github_repo_url(github_url)
|
105
224
|
|
225
|
+
try:
|
106
226
|
# Create a temporary directory for cloning
|
107
|
-
with tempfile.TemporaryDirectory() as
|
108
|
-
|
109
|
-
|
110
|
-
# Clone the repository
|
227
|
+
with tempfile.TemporaryDirectory(prefix="clarifai_model_") as clone_dir:
|
228
|
+
# Clone the repository with explicit branch parameter
|
111
229
|
if not clone_github_repo(repo_url, clone_dir, github_pat, branch):
|
112
|
-
logger.error(
|
113
|
-
|
114
|
-
|
115
|
-
github_repo = None # Fall back to template mode
|
230
|
+
logger.error(f"Failed to clone repository from {repo_url}")
|
231
|
+
github_url = None # Fall back to template mode
|
232
|
+
|
116
233
|
else:
|
117
234
|
# Copy the entire repository content to target directory (excluding .git)
|
118
235
|
for item in os.listdir(clone_dir):
|
@@ -127,15 +244,21 @@ def init(model_path, model_type_id, github_pat, github_repo, branch, local_ollam
|
|
127
244
|
else:
|
128
245
|
shutil.copy2(source_path, target_path)
|
129
246
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
247
|
+
except Exception as e:
|
248
|
+
logger.error(f"Failed to clone GitHub repository: {e}")
|
249
|
+
github_url = None
|
250
|
+
|
251
|
+
if (model_name or port or context_length) and (toolkit == 'ollama'):
|
252
|
+
customize_ollama_model(model_path, model_name, port, context_length)
|
253
|
+
|
254
|
+
logger.info("Model initialization complete with GitHub repository")
|
255
|
+
logger.info("Next steps:")
|
256
|
+
logger.info("1. Review the model configuration")
|
257
|
+
logger.info("2. Install any required dependencies manually")
|
258
|
+
logger.info("3. Test the model locally using 'clarifai model local-test'")
|
136
259
|
|
137
260
|
# Fall back to template-based initialization if no GitHub repo or if GitHub repo failed
|
138
|
-
if not
|
261
|
+
if not github_url:
|
139
262
|
from clarifai.cli.templates.model_templates import (
|
140
263
|
get_config_template,
|
141
264
|
get_model_template,
|
@@ -421,17 +544,16 @@ def run_locally(model_path, port, mode, keep_env, keep_image, skip_dockerfile=Fa
|
|
421
544
|
@click.option(
|
422
545
|
"--pool_size",
|
423
546
|
type=int,
|
424
|
-
|
425
|
-
default=1, # default to 1 thread for local dev runner to avoid rapid depletion of compute time.
|
547
|
+
default=1, # default to 1 thread for local runner to avoid rapid depletion of compute time.
|
426
548
|
show_default=True,
|
427
549
|
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
550
|
) # pylint: disable=range-builtin-not-iterating
|
429
551
|
@click.pass_context
|
430
|
-
def
|
431
|
-
"""Run the model as a local
|
552
|
+
def local_runner(ctx, model_path, pool_size):
|
553
|
+
"""Run the model as a local runner to help debug your model connected to the API or to
|
432
554
|
leverage local compute resources manually. This relies on many variables being present in the env
|
433
555
|
of the currently selected context. If they are not present then default values will be used to
|
434
|
-
ease the setup of a local
|
556
|
+
ease the setup of a local runner and your context yaml will be updated in place. The required
|
435
557
|
env vars are:
|
436
558
|
|
437
559
|
\b
|
@@ -445,7 +567,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
445
567
|
CLARIFAI_MODEL_ID:
|
446
568
|
|
447
569
|
\b
|
448
|
-
# for where the local
|
570
|
+
# for where the local runner should be in a compute cluster
|
449
571
|
# note the user_id of the compute cluster is the same as the user_id of the model.
|
450
572
|
|
451
573
|
\b
|
@@ -460,7 +582,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
460
582
|
Additionally using the provided model path, if the config.yaml file does not contain the model
|
461
583
|
information that matches the above CLARIFAI_USER_ID, CLARIFAI_APP_ID, CLARIFAI_MODEL_ID then the
|
462
584
|
config.yaml will be updated to include the model information. This is to ensure that the model
|
463
|
-
that starts up in the local
|
585
|
+
that starts up in the local runner is the same as the one you intend to call in the API.
|
464
586
|
|
465
587
|
MODEL_PATH: Path to the model directory. If not specified, the current directory is used by default.
|
466
588
|
"""
|
@@ -469,25 +591,36 @@ def local_dev(ctx, model_path, pool_size):
|
|
469
591
|
from clarifai.runners.server import serve
|
470
592
|
|
471
593
|
validate_context(ctx)
|
472
|
-
logger.info("Checking setup for local
|
594
|
+
logger.info("Checking setup for local runner...")
|
473
595
|
logger.info(f"Current context: {ctx.obj.current.name}")
|
474
596
|
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
597
|
logger.info(f"Current user_id: {user_id}")
|
477
|
-
|
598
|
+
if not user_id:
|
599
|
+
logger.error(f"User with ID '{user_id}' not found. Use 'clarifai login' to setup context.")
|
600
|
+
raise click.Abort()
|
601
|
+
pat = ctx.obj.current.pat
|
602
|
+
display_pat = pat_display(pat) if pat else ""
|
603
|
+
logger.info(f"Current PAT: {display_pat}")
|
604
|
+
if not pat:
|
605
|
+
logger.error(
|
606
|
+
"Personal Access Token (PAT) not found. Use 'clarifai login' to setup context."
|
607
|
+
)
|
608
|
+
raise click.Abort()
|
609
|
+
user = User(user_id=user_id, pat=ctx.obj.current.pat, base_url=ctx.obj.current.api_base)
|
610
|
+
logger.debug("Checking if a local runner compute cluster exists...")
|
478
611
|
|
479
612
|
# see if ctx has CLARIFAI_COMPUTE_CLUSTER_ID, if not use default
|
480
613
|
try:
|
481
614
|
compute_cluster_id = ctx.obj.current.compute_cluster_id
|
482
615
|
except AttributeError:
|
483
|
-
compute_cluster_id =
|
616
|
+
compute_cluster_id = DEFAULT_LOCAL_RUNNER_COMPUTE_CLUSTER_ID
|
484
617
|
logger.info(f"Current compute_cluster_id: {compute_cluster_id}")
|
485
618
|
|
486
619
|
try:
|
487
620
|
compute_cluster = user.compute_cluster(compute_cluster_id)
|
488
621
|
if compute_cluster.cluster_type != 'local-dev':
|
489
622
|
raise ValueError(
|
490
|
-
f"Compute cluster {user_id}/{compute_cluster_id} is not a local-
|
623
|
+
f"Compute cluster {user_id}/{compute_cluster_id} is not a local-runner compute cluster. Please create a local-runner compute cluster."
|
491
624
|
)
|
492
625
|
try:
|
493
626
|
compute_cluster_id = ctx.obj.current.compute_cluster_id
|
@@ -503,10 +636,10 @@ def local_dev(ctx, model_path, pool_size):
|
|
503
636
|
)
|
504
637
|
if y.lower() != 'y':
|
505
638
|
raise click.Abort()
|
506
|
-
# Create a compute cluster with default configuration for local
|
639
|
+
# Create a compute cluster with default configuration for local runner.
|
507
640
|
compute_cluster = user.create_compute_cluster(
|
508
641
|
compute_cluster_id=compute_cluster_id,
|
509
|
-
compute_cluster_config=
|
642
|
+
compute_cluster_config=DEFAULT_LOCAL_RUNNER_COMPUTE_CLUSTER_CONFIG,
|
510
643
|
)
|
511
644
|
ctx.obj.current.CLARIFAI_COMPUTE_CLUSTER_ID = compute_cluster_id
|
512
645
|
ctx.obj.to_yaml() # save to yaml file.
|
@@ -515,7 +648,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
515
648
|
try:
|
516
649
|
nodepool_id = ctx.obj.current.nodepool_id
|
517
650
|
except AttributeError:
|
518
|
-
nodepool_id =
|
651
|
+
nodepool_id = DEFAULT_LOCAL_RUNNER_NODEPOOL_ID
|
519
652
|
logger.info(f"Current nodepool_id: {nodepool_id}")
|
520
653
|
|
521
654
|
try:
|
@@ -533,7 +666,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
533
666
|
if y.lower() != 'y':
|
534
667
|
raise click.Abort()
|
535
668
|
nodepool = compute_cluster.create_nodepool(
|
536
|
-
nodepool_config=
|
669
|
+
nodepool_config=DEFAULT_LOCAL_RUNNER_NODEPOOL_CONFIG, nodepool_id=nodepool_id
|
537
670
|
)
|
538
671
|
ctx.obj.current.CLARIFAI_NODEPOOL_ID = nodepool_id
|
539
672
|
ctx.obj.to_yaml() # save to yaml file.
|
@@ -543,7 +676,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
543
676
|
try:
|
544
677
|
app_id = ctx.obj.current.app_id
|
545
678
|
except AttributeError:
|
546
|
-
app_id =
|
679
|
+
app_id = DEFAULT_LOCAL_RUNNER_APP_ID
|
547
680
|
logger.info(f"Current app_id: {app_id}")
|
548
681
|
|
549
682
|
try:
|
@@ -562,11 +695,11 @@ def local_dev(ctx, model_path, pool_size):
|
|
562
695
|
ctx.obj.current.CLARIFAI_APP_ID = app_id
|
563
696
|
ctx.obj.to_yaml() # save to yaml file.
|
564
697
|
|
565
|
-
# Within this app we now need a model to call as the local
|
698
|
+
# Within this app we now need a model to call as the local runner.
|
566
699
|
try:
|
567
700
|
model_id = ctx.obj.current.model_id
|
568
701
|
except AttributeError:
|
569
|
-
model_id =
|
702
|
+
model_id = DEFAULT_LOCAL_RUNNER_MODEL_ID
|
570
703
|
logger.info(f"Current model_id: {model_id}")
|
571
704
|
|
572
705
|
try:
|
@@ -586,7 +719,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
586
719
|
try:
|
587
720
|
model_type_id = ctx.obj.current.model_type_id
|
588
721
|
except AttributeError:
|
589
|
-
model_type_id =
|
722
|
+
model_type_id = DEFAULT_LOCAL_RUNNER_MODEL_TYPE
|
590
723
|
|
591
724
|
model = app.create_model(model_id, model_type_id=model_type_id)
|
592
725
|
ctx.obj.current.CLARIFAI_MODEL_TYPE_ID = model_type_id
|
@@ -594,10 +727,10 @@ def local_dev(ctx, model_path, pool_size):
|
|
594
727
|
ctx.obj.to_yaml() # save to yaml file.
|
595
728
|
|
596
729
|
# 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
|
730
|
+
# mentions it's a local runner.
|
598
731
|
model_versions = [v for v in model.list_versions()]
|
599
732
|
if len(model_versions) == 0:
|
600
|
-
logger.info("No model versions found. Creating a new version for local
|
733
|
+
logger.info("No model versions found. Creating a new version for local runner.")
|
601
734
|
version = model.create_version(pretrained_model_config={"local_dev": True}).model_version
|
602
735
|
logger.info(f"Created model version {version.id}")
|
603
736
|
else:
|
@@ -631,12 +764,12 @@ def local_dev(ctx, model_path, pool_size):
|
|
631
764
|
raise AttributeError("Runner not found in nodepool.") from e
|
632
765
|
except AttributeError:
|
633
766
|
logger.info(
|
634
|
-
f"Create the local
|
767
|
+
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
768
|
)
|
636
769
|
runner = nodepool.create_runner(
|
637
770
|
runner_config={
|
638
771
|
"runner": {
|
639
|
-
"description": "
|
772
|
+
"description": "local runner for model testing",
|
640
773
|
"worker": worker,
|
641
774
|
"num_replicas": 1,
|
642
775
|
}
|
@@ -653,7 +786,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
653
786
|
try:
|
654
787
|
deployment_id = ctx.obj.current.deployment_id
|
655
788
|
except AttributeError:
|
656
|
-
deployment_id =
|
789
|
+
deployment_id = DEFAULT_LOCAL_RUNNER_DEPLOYMENT_ID
|
657
790
|
try:
|
658
791
|
deployment = nodepool.deployment(deployment_id)
|
659
792
|
# ensure the deployment is using the latest version.
|
@@ -708,7 +841,7 @@ def local_dev(ctx, model_path, pool_size):
|
|
708
841
|
f"config.yaml not found in {model_path}. Please ensure you are passing the correct directory."
|
709
842
|
)
|
710
843
|
config = ModelBuilder._load_config(config_file)
|
711
|
-
model_type_id = config.get('model', {}).get('model_type_id',
|
844
|
+
model_type_id = config.get('model', {}).get('model_type_id', DEFAULT_LOCAL_RUNNER_MODEL_TYPE)
|
712
845
|
# The config.yaml doens't match what we created above.
|
713
846
|
if 'model' in config and model_id != config['model'].get('id'):
|
714
847
|
logger.info(f"Current model section of config.yaml: {config.get('model', {})}")
|
@@ -717,14 +850,14 @@ def local_dev(ctx, model_path, pool_size):
|
|
717
850
|
)
|
718
851
|
if y.lower() != 'y':
|
719
852
|
raise click.Abort()
|
720
|
-
config = ModelBuilder.
|
853
|
+
config = ModelBuilder._set_local_runner_model(
|
721
854
|
config, user_id, app_id, model_id, model_type_id
|
722
855
|
)
|
723
856
|
ModelBuilder._backup_config(config_file)
|
724
857
|
ModelBuilder._save_config(config_file, config)
|
725
858
|
|
726
859
|
builder = ModelBuilder(model_path, download_validation_only=True)
|
727
|
-
# don't mock for local
|
860
|
+
# don't mock for local runner since you need the dependencies to run the code anyways.
|
728
861
|
method_signatures = builder.get_method_signatures(mocking=False)
|
729
862
|
|
730
863
|
from clarifai.runners.utils import code_script
|
@@ -740,12 +873,12 @@ def local_dev(ctx, model_path, pool_size):
|
|
740
873
|
|
741
874
|
logger.info("""\n
|
742
875
|
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
743
|
-
# About to start up the local
|
876
|
+
# About to start up the local runner in this terminal...
|
744
877
|
# Here is a code snippet to call this model once it start from another terminal:
|
745
878
|
""")
|
746
879
|
logger.info(snippet)
|
747
880
|
|
748
|
-
logger.info("Now starting the local
|
881
|
+
logger.info("Now starting the local runner...")
|
749
882
|
|
750
883
|
# This reads the config.yaml from the model_path so we alter it above first.
|
751
884
|
serve(
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|