truefoundry 0.10.5__py3-none-any.whl → 0.10.6__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.

Potentially problematic release.


This version of truefoundry might be problematic. Click here for more details.

truefoundry/__init__.py CHANGED
@@ -16,11 +16,13 @@ from truefoundry_sdk import (
16
16
  from truefoundry._client import client
17
17
  from truefoundry.common.warnings import (
18
18
  suppress_truefoundry_deprecation_warnings,
19
+ suppress_truefoundry_ml_autogen_warnings,
19
20
  surface_truefoundry_deprecation_warnings,
20
21
  )
21
22
  from truefoundry.deploy.core import login, logout
22
23
  from truefoundry.ml.prompt_utils import render_prompt
23
24
 
25
+ suppress_truefoundry_ml_autogen_warnings()
24
26
  surface_truefoundry_deprecation_warnings()
25
27
 
26
28
  __all__ = [
@@ -19,3 +19,11 @@ def suppress_truefoundry_deprecation_warnings() -> None:
19
19
  "ignore",
20
20
  category=TrueFoundryDeprecationWarning,
21
21
  )
22
+
23
+
24
+ def suppress_truefoundry_ml_autogen_warnings() -> None:
25
+ """Mute TrueFoundry ML autogen warnings."""
26
+ warnings.filterwarnings(
27
+ "ignore",
28
+ module="truefoundry.ml._autogen",
29
+ )
@@ -29,7 +29,10 @@ from truefoundry.ml.artifact.truefoundry_artifact_repo import (
29
29
  MlFoundryArtifactsRepository,
30
30
  )
31
31
  from truefoundry.ml.exceptions import MlFoundryException
32
- from truefoundry.ml.log_types.artifacts.constants import INTERNAL_METADATA_PATH
32
+ from truefoundry.ml.log_types.artifacts.constants import (
33
+ ARTIFACT_METADATA_TRUEFOUNDRY_KEY,
34
+ INTERNAL_METADATA_PATH,
35
+ )
33
36
  from truefoundry.ml.log_types.artifacts.utils import (
34
37
  _get_src_dest_pairs,
35
38
  _validate_artifact_metadata,
@@ -455,6 +458,13 @@ def _log_artifact_version_helper(
455
458
  experiment_name=ml_repo
456
459
  ).experiment.experiment_id
457
460
 
461
+ metadata = metadata or {}
462
+ if ARTIFACT_METADATA_TRUEFOUNDRY_KEY not in metadata:
463
+ metadata[ARTIFACT_METADATA_TRUEFOUNDRY_KEY] = {}
464
+
465
+ _validate_description(description)
466
+ _validate_artifact_metadata(metadata)
467
+
458
468
  assert mlfoundry_artifacts_api is not None
459
469
  _create_artifact_response = mlfoundry_artifacts_api.create_artifact_version_post(
460
470
  create_artifact_version_request_dto=CreateArtifactVersionRequestDto(
@@ -465,7 +475,8 @@ def _log_artifact_version_helper(
465
475
  )
466
476
  version_id = _create_artifact_response.id
467
477
  artifact_storage_root = _create_artifact_response.artifact_storage_root
468
- total_size = 0
478
+ total_size = None
479
+
469
480
  if isinstance(artifact_dir, tempfile.TemporaryDirectory):
470
481
  # Source is of type TrueFoundryManagedSource
471
482
  source = TrueFoundryManagedSource(type="truefoundry", uri=artifact_storage_root)
@@ -502,6 +513,9 @@ def _log_artifact_version_helper(
502
513
  else:
503
514
  raise MlFoundryException("Invalid artifact_dir provided")
504
515
 
516
+ if total_size is not None and total_size > 0:
517
+ metadata[ARTIFACT_METADATA_TRUEFOUNDRY_KEY]["artifact_size"] = total_size
518
+
505
519
  artifact_manifest = None
506
520
  if artifact_type == ArtifactType.ARTIFACT:
507
521
  _source_cls = get_autogen_type(ArtifactManifest, "source")
@@ -509,11 +523,13 @@ def _log_artifact_version_helper(
509
523
  name=name,
510
524
  ml_repo=ml_repo,
511
525
  description=description,
512
- metadata=metadata or {},
526
+ metadata=metadata,
513
527
  source=_source_cls.from_dict(source.dict()),
514
528
  step=step,
529
+ run_id=run.run_id if run else None,
515
530
  )
516
531
  _manifest_cls = get_autogen_type(FinalizeArtifactVersionRequestDto, "manifest")
532
+
517
533
  finalize_artifact_version_request_dto = FinalizeArtifactVersionRequestDto(
518
534
  id=version_id,
519
535
  run_uuid=run.run_id if run else None,
@@ -31,3 +31,5 @@ model_version = ModelSchema(...) # or schema in dictionary format {{"features":
31
31
  model_version.update()
32
32
  ```
33
33
  """
34
+
35
+ ARTIFACT_METADATA_TRUEFOUNDRY_KEY = ".truefoundry"
@@ -36,6 +36,7 @@ from truefoundry.ml.enums import ModelFramework
36
36
  from truefoundry.ml.exceptions import MlFoundryException
37
37
  from truefoundry.ml.log_types.artifacts.artifact import BlobStorageDirectory
38
38
  from truefoundry.ml.log_types.artifacts.constants import (
39
+ ARTIFACT_METADATA_TRUEFOUNDRY_KEY,
39
40
  INTERNAL_METADATA_PATH,
40
41
  )
41
42
  from truefoundry.ml.log_types.artifacts.utils import (
@@ -547,6 +548,8 @@ def _log_model_version( # noqa: C901
547
548
  step = step or 0
548
549
  total_size = None
549
550
  metadata = metadata or {}
551
+ if ARTIFACT_METADATA_TRUEFOUNDRY_KEY not in metadata:
552
+ metadata[ARTIFACT_METADATA_TRUEFOUNDRY_KEY] = {}
550
553
 
551
554
  _validate_description(description)
552
555
  _validate_artifact_metadata(metadata)
@@ -617,6 +620,9 @@ def _log_model_version( # noqa: C901
617
620
  else:
618
621
  raise MlFoundryException("Invalid model_file_or_folder provided")
619
622
 
623
+ if total_size is not None and total_size > 0:
624
+ metadata[ARTIFACT_METADATA_TRUEFOUNDRY_KEY]["artifact_size"] = total_size
625
+
620
626
  _source_cls = get_autogen_type(ModelManifest, "source")
621
627
  # Auto fetch the framework & environment details if not provided
622
628
  framework = _ModelFramework.to_model_framework_type(framework)
@@ -636,6 +642,7 @@ def _log_model_version( # noqa: C901
636
642
  framework=Framework.from_dict(framework.dict()) if framework else None,
637
643
  environment=environment,
638
644
  step=step,
645
+ run_id=run.run_id if run else None,
639
646
  )
640
647
  _manifest_cls = get_autogen_type(FinalizeArtifactVersionRequestDto, "manifest")
641
648
  artifact_version_response = mlfoundry_artifacts_api.finalize_artifact_version_post(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: truefoundry
3
- Version: 0.10.5
3
+ Version: 0.10.6
4
4
  Summary: TrueFoundry CLI
5
5
  Author-email: TrueFoundry Team <abhishek@truefoundry.com>
6
6
  Requires-Python: <3.14,>=3.8.1
@@ -1,4 +1,4 @@
1
- truefoundry/__init__.py,sha256=VVpO-Awh1v93VOURe7hank8QpeSPc0dCykwr14GOFsw,967
1
+ truefoundry/__init__.py,sha256=z9iNNI3mqVWkvzBXMRu096jXaYloYSN6rnlTbfmKcJE,1056
2
2
  truefoundry/_client.py,sha256=Y3qHi_Lg4Sx6GNvsjAHIoAfFr8PJnqgCrXmpNAI3ECg,1417
3
3
  truefoundry/logger.py,sha256=u-YCNjg5HBwE70uQcpjIG64Ghos-K2ulTWaxC03BSj4,714
4
4
  truefoundry/pydantic_v1.py,sha256=jSuhGtz0Mbk1qYu8jJ1AcnIDK4oxUsdhALc4spqstmM,345
@@ -51,7 +51,7 @@ truefoundry/common/session.py,sha256=d9l3TEBpqVP4mr4mTGY1qVxc815skzMlNNdw14otg34
51
51
  truefoundry/common/storage_provider_utils.py,sha256=yURhMw8k0FLFvaviRHDiifhvc6GnuQwGMC9Qd2uM440,10934
52
52
  truefoundry/common/types.py,sha256=BMJFCsR1lPJAw66IQBSvLyV4I6o_x5oj78gVsUa9si8,188
53
53
  truefoundry/common/utils.py,sha256=j3QP0uOsaGD_VmDDR68JTwoYE1okkAq6OqpVkzVf48Q,6424
54
- truefoundry/common/warnings.py,sha256=rs6BHwk7imQYedo07iwh3TWEOywAR3Lqhj0AY4khByg,504
54
+ truefoundry/common/warnings.py,sha256=xDMhR_-ZGC40Ycaj6nlFb5MYPexn8WbKCHd4FlflTXQ,705
55
55
  truefoundry/deploy/__init__.py,sha256=PVbGPU9S3-dTFn5LvLwaEnfsp2RrGT9iiM7_15kOV84,2837
56
56
  truefoundry/deploy/python_deploy_codegen.py,sha256=k19_m5DGsUyjOUCSKwIVP8vDna2sq01tHABsUfoVpW4,8019
57
57
  truefoundry/deploy/_autogen/models.py,sha256=8j_y0Yp8k8Sjj7iVtZDHeuxq9kDvD0xI8-iFnbf0370,73571
@@ -360,11 +360,11 @@ truefoundry/ml/log_types/__init__.py,sha256=g4u4D4Jaj0aBK5GtrLV88-qThKZR9pSZ17vF
360
360
  truefoundry/ml/log_types/plot.py,sha256=LDh4uy6z2P_a2oPM2lc85c0lt8utVvunohzeMawFjZw,7572
361
361
  truefoundry/ml/log_types/pydantic_base.py,sha256=eBlw_AEyAz4iJKDP4zgJOCFWcldwQqpf7FADW1jzIQY,272
362
362
  truefoundry/ml/log_types/utils.py,sha256=xjJ21jdPScvFmw3TbVh5NCzbzJwaqiXJyiiT4xxX1EI,335
363
- truefoundry/ml/log_types/artifacts/artifact.py,sha256=qaBHO-5ffBvghmhRQ5pperp8rm3T8HYSrkecpCrK_4I,19594
364
- truefoundry/ml/log_types/artifacts/constants.py,sha256=qKxQ5mMvJE4j83BvGW3qNTKunxCiBg_EEjTdgbgJtyE,1036
363
+ truefoundry/ml/log_types/artifacts/artifact.py,sha256=N1M1a7Oq9fY_7s1PT7uv64s_Ek62Lj-JsPBrWdRKpdY,20050
364
+ truefoundry/ml/log_types/artifacts/constants.py,sha256=uB2JPEqwTbqevkQv2QcEMROsm_4cVAl6s0QU1MLa8SQ,1088
365
365
  truefoundry/ml/log_types/artifacts/dataset.py,sha256=UpLXoqhfONqp6YG4N8lDrDe-XhTK6ZZ9Lwg8mI0UZn4,13113
366
366
  truefoundry/ml/log_types/artifacts/general_artifact.py,sha256=yr-SQ2fhUR_sE1MB5zoHHYpGC8tizH_-t3lhsxCAULU,2747
367
- truefoundry/ml/log_types/artifacts/model.py,sha256=kEuqnQhuO9Hmz8bqHEzrbdPn_Vt7H-Tansd0rmplyWE,24696
367
+ truefoundry/ml/log_types/artifacts/model.py,sha256=0_2EGwj8VYRJ3g8Ti2k75s-OiC1Tu-7Ay9U1_QYG_iw,25027
368
368
  truefoundry/ml/log_types/artifacts/utils.py,sha256=q_atcGzn3wfxItt3RABxjdris8b3njEFNuC8ihWqUSI,8088
369
369
  truefoundry/ml/log_types/image/__init__.py,sha256=fcOq8yQnNj1rkLcPeIjLXBpdA1WIeiPsXOlAAvMxx7M,76
370
370
  truefoundry/ml/log_types/image/constants.py,sha256=wLtGEOA4T5fZHSlOXPuNDLX3lpbCtwlvGKPFk_1fah0,255
@@ -381,7 +381,7 @@ truefoundry/workflow/remote_filesystem/__init__.py,sha256=LQ95ViEjJ7Ts4JcCGOxMPs
381
381
  truefoundry/workflow/remote_filesystem/logger.py,sha256=em2l7D6sw7xTLDP0kQSLpgfRRCLpN14Qw85TN7ujQcE,1022
382
382
  truefoundry/workflow/remote_filesystem/tfy_signed_url_client.py,sha256=xcT0wQmQlgzcj0nP3tJopyFSVWT1uv3nhiTIuwfXYeg,12342
383
383
  truefoundry/workflow/remote_filesystem/tfy_signed_url_fs.py,sha256=nSGPZu0Gyd_jz0KsEE-7w_BmnTD8CVF1S8cUJoxaCbc,13305
384
- truefoundry-0.10.5.dist-info/METADATA,sha256=t8-jiTcLLtOLh7QQQwl_FXqgG0GJdttfh8b06Org1iE,2505
385
- truefoundry-0.10.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
386
- truefoundry-0.10.5.dist-info/entry_points.txt,sha256=xVjn7RMN-MW2-9f7YU-bBdlZSvvrwzhpX1zmmRmsNPU,98
387
- truefoundry-0.10.5.dist-info/RECORD,,
384
+ truefoundry-0.10.6.dist-info/METADATA,sha256=CN96HcoQd_5lWHozK46eDlDnN1l_ZIrTXHHKwHS8eKc,2505
385
+ truefoundry-0.10.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
386
+ truefoundry-0.10.6.dist-info/entry_points.txt,sha256=xVjn7RMN-MW2-9f7YU-bBdlZSvvrwzhpX1zmmRmsNPU,98
387
+ truefoundry-0.10.6.dist-info/RECORD,,