tracebloc 1.2.63__tar.gz → 1.2.65__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.
Files changed (116) hide show
  1. {tracebloc-1.2.63 → tracebloc-1.2.65}/PKG-INFO +2 -2
  2. {tracebloc-1.2.63 → tracebloc-1.2.65}/README.md +1 -1
  3. {tracebloc-1.2.63 → tracebloc-1.2.65}/pyproject.toml +1 -1
  4. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/_linking.py +36 -35
  5. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/plan.py +24 -20
  6. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/summary.py +3 -3
  7. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/user.py +2 -3
  8. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc.egg-info/PKG-INFO +2 -2
  9. {tracebloc-1.2.63 → tracebloc-1.2.65}/MANIFEST.in +0 -0
  10. {tracebloc-1.2.63 → tracebloc-1.2.65}/license.txt +0 -0
  11. {tracebloc-1.2.63 → tracebloc-1.2.65}/setup.cfg +0 -0
  12. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/__init__.py +0 -0
  13. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/_deprecation.py +0 -0
  14. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/_framework_utils.py +0 -0
  15. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/_http_utils.py +0 -0
  16. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/_link_answer.py +0 -0
  17. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/_raw_width_note.py +0 -0
  18. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/_stored_link.py +0 -0
  19. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/checks.py +0 -0
  20. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/client.py +0 -0
  21. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/config.py +0 -0
  22. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/contracts/stage_urls.v1.json +0 -0
  23. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/contracts/stage_urls.v1.source.json +0 -0
  24. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/contracts/survival_payload.py +0 -0
  25. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/env_login.py +0 -0
  26. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/exceptions.py +0 -0
  27. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/fetch.py +0 -0
  28. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/inference.py +0 -0
  29. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/lifelines_weights.py +0 -0
  30. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/link_model_dataset.py +0 -0
  31. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/__init__.py +0 -0
  32. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/templates/_partials.tpl +0 -0
  33. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/templates/embeddings.tpl +0 -0
  34. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/templates/nlp_finetune.tpl +0 -0
  35. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/templates/nlp_generative.tpl +0 -0
  36. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/templates/survival.tpl +0 -0
  37. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/templates/tabular_timeseries.tpl +0 -0
  38. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/templates/vision_from_scratch.tpl +0 -0
  39. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/raw_mode.py +0 -0
  40. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/raw_mode_frame.py +0 -0
  41. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/raw_mode_seed.py +0 -0
  42. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/raw_mode_survival.py +0 -0
  43. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/raw_mode_torch.py +0 -0
  44. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/seed_weights.py +0 -0
  45. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/__init__.py +0 -0
  46. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/augmentation.py +0 -0
  47. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/callbacks.py +0 -0
  48. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/features.py +0 -0
  49. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/image_size.py +0 -0
  50. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/lora.py +0 -0
  51. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/lora_validation.py +0 -0
  52. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/loss.py +0 -0
  53. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/memory_estimate.py +0 -0
  54. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/preprocessing.py +0 -0
  55. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/shape.py +0 -0
  56. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/subdataset.py +0 -0
  57. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/submitter.py +0 -0
  58. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/__init__.py +0 -0
  59. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/lifelines_time_to_event.py +0 -0
  60. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/model_upload.py +0 -0
  61. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/scikit_survival_time_to_event.py +0 -0
  62. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/skl_tabular_base.py +0 -0
  63. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/skl_tabular_classifier.py +0 -0
  64. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/skl_tabular_regression.py +0 -0
  65. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/statistical_base.py +0 -0
  66. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/survival_base.py +0 -0
  67. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_causal_language_modeler.py +0 -0
  68. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_embeddings.py +0 -0
  69. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_image_classifier.py +0 -0
  70. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_key_point_detector.py +0 -0
  71. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_masked_language_modeler.py +0 -0
  72. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_nlp_base.py +0 -0
  73. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_object_detector.py +0 -0
  74. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_semantic_segmentation.py +0 -0
  75. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_sentence_pair_classifier.py +0 -0
  76. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_seq2seq_modeler.py +0 -0
  77. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_tabular_classifier.py +0 -0
  78. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_tabular_regression.py +0 -0
  79. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_text_classifier.py +0 -0
  80. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_time_series_classifier.py +0 -0
  81. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_time_series_forecaster.py +0 -0
  82. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_time_to_event.py +0 -0
  83. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_token_classifier.py +0 -0
  84. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/weight_loaders.py +0 -0
  85. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/__init__.py +0 -0
  86. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/class_order.py +0 -0
  87. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/constants.py +0 -0
  88. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/custom_loss_probe.py +0 -0
  89. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/detection_utils.py +0 -0
  90. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/entry_point.py +0 -0
  91. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/feature_dict.py +0 -0
  92. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/general_utils.py +0 -0
  93. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/key_point_detection_utils.py +0 -0
  94. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/registry.py +0 -0
  95. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/safetensors_io.py +0 -0
  96. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/semantic_segmentation_utils.py +0 -0
  97. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/tabular_classification_utils.py +0 -0
  98. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/tabular_custom_loss_utils.py +0 -0
  99. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/tabular_regression_utils.py +0 -0
  100. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/text_classification_utils.py +0 -0
  101. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/time_series_utils.py +0 -0
  102. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/time_to_event_utils.py +0 -0
  103. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/warnings_once.py +0 -0
  104. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/__init__.py +0 -0
  105. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/checker.py +0 -0
  106. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/header_rules.py +0 -0
  107. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/lifelines_checks.py +0 -0
  108. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/pytorch_checks.py +0 -0
  109. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/rewriter.py +0 -0
  110. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/scikit_survival_checks.py +0 -0
  111. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/sklearn_checks.py +0 -0
  112. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc.egg-info/SOURCES.txt +0 -0
  113. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc.egg-info/dependency_links.txt +0 -0
  114. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc.egg-info/requires.txt +0 -0
  115. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc.egg-info/top_level.txt +0 -0
  116. {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc_package/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tracebloc
3
- Version: 1.2.63
3
+ Version: 1.2.65
4
4
  Summary: Build AI with anyone. On data that can't move. SDK for the tracebloc collaborative AI workspace.
5
5
  Author-email: tracebloc <lukas@tracebloc.io>
6
6
  License-Expression: MIT
@@ -105,7 +105,7 @@ user.login()
105
105
  user.upload_model(model_name="my_model")
106
106
 
107
107
  # 3. Link your model to the dataset — returns a training-plan facade
108
- training_plan = user.link_model_dataset(dataset_id="<your-dataset-id>")
108
+ training_plan = user.link_model_dataset(dataset_id="<your-dataset-key>")
109
109
 
110
110
  # 4. Start training
111
111
  training_plan.start()
@@ -44,7 +44,7 @@ user.login()
44
44
  user.upload_model(model_name="my_model")
45
45
 
46
46
  # 3. Link your model to the dataset — returns a training-plan facade
47
- training_plan = user.link_model_dataset(dataset_id="<your-dataset-id>")
47
+ training_plan = user.link_model_dataset(dataset_id="<your-dataset-key>")
48
48
 
49
49
  # 4. Start training
50
50
  training_plan.start()
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tracebloc"
7
- version = "1.2.63"
7
+ version = "1.2.65"
8
8
  description = "Build AI with anyone. On data that can't move. SDK for the tracebloc collaborative AI workspace."
9
9
  license = "MIT"
10
10
  license-files = ["license.txt"]
@@ -51,7 +51,6 @@ from .validation.lifelines_checks import (
51
51
  )
52
52
  from .validation.header_rules import NO_OUTPUT_CLASSES
53
53
  from tracebloc.utils.constants import (
54
- CLASSLESS_CATEGORIES,
55
54
  SKLEARN_FRAMEWORK,
56
55
  SCIKIT_SURVIVAL_FRAMEWORK,
57
56
  LIFELINES_FRAMEWORK,
@@ -110,19 +109,29 @@ def _status_reason(response):
110
109
  return ""
111
110
 
112
111
 
112
+ #: Where the dashboard shows the key ``link_model_dataset`` takes. The backend's
113
+ #: 403 is the same for an unknown key and a key the caller may not use, on purpose,
114
+ #: so the refusal names the place to copy the right one from.
115
+ DATASET_KEY_HINT = (
116
+ "The use case's dataset key is in the dashboard: open the use case; on its "
117
+ 'Overview, "On this page" shows it under "Start training".'
118
+ )
119
+
120
+
113
121
  def _map_link_response(response, dataset_id, load_failed_hint=REUPLOAD_HINT):
114
122
  """Map the check-model HTTP response to its parsed JSON body.
115
123
 
116
124
  Pure: reads only the response object; no I/O, no state. Raises
117
125
  :class:`DatasetLinkingError` for every failure shape: 400 (invalid /
118
- unknown dataset id; the backend's ``LOAD_FAILED`` for the model gets
126
+ unknown dataset key; the backend's ``LOAD_FAILED`` for the model gets
119
127
  ``load_failed_hint`` instead, the re-upload hint by default), 403 (not
120
- permitted — leads with the backend's reason), 409, 204, any other non-200/202 status, an unparseable body,
121
- or an ``error`` flag inside the body; returns the parsed body dict
122
- otherwise. HTTP-status failures other than the mapped codes chain
123
- an :class:`APIError` via ``raise ... from``; a 5xx additionally reads
124
- as a transient transport failure and names the HTTP status in the
125
- message rather than the generic "Linking Failed!".
128
+ permitted — leads with the backend's reason, ends with
129
+ :data:`DATASET_KEY_HINT`), 409, 204, any other non-200/202 status, an
130
+ unparseable body, or an ``error`` flag inside the body; returns the
131
+ parsed body dict otherwise. HTTP-status failures other than the mapped
132
+ codes chain an :class:`APIError` via ``raise ... from``; a 5xx
133
+ additionally reads as a transient transport failure and names the HTTP
134
+ status in the message rather than the generic "Linking Failed!".
126
135
  """
127
136
  if response.status_code == 400:
128
137
  body = _parse_api_message(response)
@@ -131,8 +140,8 @@ def _map_link_response(response, dataset_id, load_failed_hint=REUPLOAD_HINT):
131
140
  # caller's behind it -- say so, not "no dataset".
132
141
  raise DatasetLinkingError(f"{body}\n{load_failed_hint}")
133
142
  error_message = (
134
- f"Please provide a valid dataset ID.\n"
135
- f"There is no dataset with ID: {dataset_id}.\n"
143
+ f"Please provide a valid dataset key.\n"
144
+ f"There is no dataset with key {dataset_id}.\n"
136
145
  )
137
146
  if body:
138
147
  error_message += body
@@ -143,15 +152,20 @@ def _map_link_response(response, dataset_id, load_failed_hint=REUPLOAD_HINT):
143
152
  # model that can't be used on this dataset (e.g. a non-federatable
144
153
  # KNN/GaussianProcess on a federated or third-party-owned dataset,
145
154
  # backend #923 follow-up). Lead with the backend's specific reason when
146
- # present, but keep the dataset id and a neutral frame around it so a
155
+ # present, but keep the dataset key and a neutral frame around it so a
147
156
  # backend catch-all ("error occurred while linking as ...") or a DRF
148
157
  # permission ``detail`` doesn't surface as bare, contextless text.
149
- # Fall back to access/ID guidance when the body is empty.
158
+ # Fall back to access/key guidance when the body is empty. Either way the
159
+ # last line is DATASET_KEY_HINT.
150
160
  body = _parse_api_message(response)
151
161
  if body:
152
- raise DatasetLinkingError(f"Cannot link dataset ID: {dataset_id}.\n{body}")
162
+ raise DatasetLinkingError(
163
+ f"Cannot link the dataset with key {dataset_id}.\n{body}\n"
164
+ f"{DATASET_KEY_HINT}"
165
+ )
153
166
  raise DatasetLinkingError(
154
- f"You are not permitted to link dataset ID: {dataset_id}."
167
+ f"You are not permitted to link the dataset with key {dataset_id}.\n"
168
+ f"{DATASET_KEY_HINT}"
155
169
  )
156
170
 
157
171
  if response.status_code == 409:
@@ -321,10 +335,9 @@ def _apply_link_success(
321
335
  ):
322
336
  """Handle a passed check-model response.
323
337
 
324
- Prints the success output (byte-identical to the pre-split inline
325
- prints), runs the link-time hard-fail checks and the warn-only soft
326
- checks, and returns a :class:`LinkSuccessState` with the dataset
327
- parameters for the caller to apply. Raises
338
+ Prints the success output, runs the link-time hard-fail checks and the
339
+ warn-only soft checks, and returns a :class:`LinkSuccessState` with the
340
+ dataset parameters for the caller to apply. Raises
328
341
  :class:`DatasetLinkingError` when a hard-fail check trips.
329
342
  """
330
343
  total_images = content["total_images"]
@@ -372,23 +385,10 @@ def _apply_link_success(
372
385
 
373
386
  text = colored("Assignment successful!", "green")
374
387
  print(text, "\n")
375
- dataset_params = [
376
- f"\n \033[1mDataset Parameters\033[0m\n\n",
377
- f"datasetId: {dataset_id}\n",
378
- f"totalDatasetSize: {total_dataset_size}\n",
379
- ]
380
- # The published order the head must follow (backend#5686): ``allClasses``
381
- # is a count per class in no index order, so it is only the fallback for a
382
- # platform that sends no ``class_order``.
383
- class_order = content.get("class_order")
384
- order_text = class_order_text(class_order)
385
- if order_text is not None:
386
- dataset_params.append(f"{order_text}\n")
387
- elif category not in CLASSLESS_CATEGORIES:
388
- dataset_params.append(f"allClasses: {class_names}\n")
388
+ # The dataset parameters print once, in the training plan
389
+ # (``TrainingSummary.get_training_plan``), which ``start()`` prints too.
389
390
  if input_contract: # raw mode's checked input contract (backend#5679)
390
- dataset_params.append(f"{input_contract}\n")
391
- print(*dataset_params)
391
+ print(f"{input_contract}\n")
392
392
 
393
393
  # Hard-fail: for token classification the dataset's label values
394
394
  # are BIO tag sequences; the model head must match the count of
@@ -484,6 +484,7 @@ def _apply_link_success(
484
484
 
485
485
  print("Please set a training plan.")
486
486
  resources = content.get("resources")
487
+ class_order = content.get("class_order")
487
488
  return LinkSuccessState(
488
489
  total_images=total_images,
489
490
  num_classes=num_classes,
@@ -493,5 +494,5 @@ def _apply_link_success(
493
494
  table_name=table_name,
494
495
  resources=resources if isinstance(resources, dict) else None,
495
496
  image_attributes=image_attributes,
496
- class_order=class_order if order_text is not None else None,
497
+ class_order=class_order if class_order_text(class_order) is not None else None,
497
498
  )
@@ -106,17 +106,29 @@ MAX_CYCLES = 100
106
106
  MAX_NAME_LENGTH = 200
107
107
 
108
108
 
109
- def _print_not_supported(
110
- parameter: str, framework: str, message: bool = False
111
- ) -> None:
109
+ def _print_not_supported(parameter: str, framework: str) -> None:
112
110
  """Print the "parameter not supported on framework" banner in red."""
113
- if message:
114
- text = parameter
115
- else:
116
- text = f"The parameter {parameter} is not supported on {framework}\n"
111
+ text = f"The parameter {parameter} is not supported on {framework}\n"
117
112
  print(colored(text, "red"), "\n")
118
113
 
119
114
 
115
+ def _print_one_pass(parameter: str, asked: Any, framework: str) -> None:
116
+ """Say that a one-pass framework keeps ``parameter`` at 1, unless 1 is what
117
+ was asked: one fit is one pass, and the model's own iteration setting
118
+ lengthens it."""
119
+ if type(asked) is int and asked == 1:
120
+ return
121
+ print(
122
+ colored(
123
+ f"A {framework} model trains in one pass, so {parameter} stays 1. "
124
+ "To train longer, raise the model's own iteration setting, "
125
+ "such as max_iter.",
126
+ "yellow",
127
+ ),
128
+ "\n",
129
+ )
130
+
131
+
120
132
  class TrainingPlan:
121
133
  """Plan-parameter state + validators for :class:`LinkModelDataset`.
122
134
 
@@ -147,9 +159,9 @@ class TrainingPlan:
147
159
  self._on_invalid = on_invalid
148
160
 
149
161
  # Plan state. Survival frameworks (sklearn, lifelines, scikit-survival)
150
- # train in a single pass — epochs and cycles are both forced to 1;
151
- # the `epochs()` / `cycles()` setters below reject any attempt to
152
- # override. Non-survival frameworks default to the historical
162
+ # train in a single pass — epochs and cycles are both forced to 1,
163
+ # and the `epochs()` / `cycles()` setters below keep them there
164
+ # (`_print_one_pass`). Non-survival frameworks default to the historical
153
165
  # epochs=10, cycles=1 and can be tuned freely.
154
166
  is_survival = framework in _SURVIVAL_FRAMEWORKS
155
167
  self._epochs: int = 1 if is_survival else 10
@@ -196,11 +208,7 @@ class TrainingPlan:
196
208
 
197
209
  def epochs(self, epochs: int) -> None:
198
210
  if self._framework in _SURVIVAL_FRAMEWORKS:
199
- _print_not_supported(
200
- f"For {self._framework} framework epochs cannot be updated. Epoch is set to 1",
201
- self._framework,
202
- message=True,
203
- )
211
+ _print_one_pass("epochs", epochs, self._framework)
204
212
  self._epochs = 1
205
213
  self._on_valid()
206
214
  elif type(epochs) == int and 0 < epochs <= MAX_EPOCHS:
@@ -214,11 +222,7 @@ class TrainingPlan:
214
222
 
215
223
  def cycles(self, cycles: int) -> None:
216
224
  if self._framework in _SURVIVAL_FRAMEWORKS:
217
- _print_not_supported(
218
- f"For {self._framework} framework cycles cannot be updated. Cycle is set to 1",
219
- self._framework,
220
- message=True,
221
- )
225
+ _print_one_pass("cycles", cycles, self._framework)
222
226
  self._cycles = 1
223
227
  self._on_valid()
224
228
  elif type(cycles) == int:
@@ -107,9 +107,9 @@ class TrainingSummary(_FacadeCoordinator):
107
107
  # Regression and generative categories have no classes, so the
108
108
  # class lines would print a meaningless value (#796).
109
109
  has_classes = self._f.category not in CLASSLESS_CATEGORIES
110
- # The published order the head must follow, the same block the
111
- # link prints (backend#5686); ``allClasses`` (a count per class in
112
- # no index order) only when the platform sent no order.
110
+ # The published order the head must follow (backend#5686);
111
+ # ``allClasses`` (a count per class in no index order) only when
112
+ # the platform sent no order.
113
113
  order_text = class_order_text(self._f.class_order)
114
114
  if order_text is not None:
115
115
  all_classes_line = [f"{order_text}\n\n"]
@@ -42,7 +42,6 @@ from .utils.general_utils import (
42
42
  format_exception,
43
43
  get_paths,
44
44
  require_login,
45
- print_error,
46
45
  remove_tmp_file,
47
46
  scope_weights_path_to_framework,
48
47
  )
@@ -613,7 +612,7 @@ class User:
613
612
  )
614
613
 
615
614
  if upload:
616
- print_error(text=f"\n'{self.__model_name}' upload successful.\n")
615
+ print(colored(f"\n'{self.__model_name}' upload successful.\n", "green"), "\n")
617
616
  warn_if_seed_skipped(self.__client, self.__model_file_path, self.__weights)
618
617
  remove_tmp_file(tmp_dir_path=self.__general_checks_obj.tmp_file_path)
619
618
  finally:
@@ -716,7 +715,7 @@ class User:
716
715
 
717
716
  Raises:
718
717
  DatasetLinkingError: No model to link (none uploaded, or both
719
- ``model`` and ``template``), the dataset ID is invalid, the
718
+ ``model`` and ``template``), the dataset key is invalid, the
720
719
  stored model is not one of yours, the model is incompatible
721
720
  with the dataset, or the API returned an unexpected response.
722
721
  Transport/HTTP errors are wrapped; the underlying ``APIError``
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tracebloc
3
- Version: 1.2.63
3
+ Version: 1.2.65
4
4
  Summary: Build AI with anyone. On data that can't move. SDK for the tracebloc collaborative AI workspace.
5
5
  Author-email: tracebloc <lukas@tracebloc.io>
6
6
  License-Expression: MIT
@@ -105,7 +105,7 @@ user.login()
105
105
  user.upload_model(model_name="my_model")
106
106
 
107
107
  # 3. Link your model to the dataset — returns a training-plan facade
108
- training_plan = user.link_model_dataset(dataset_id="<your-dataset-id>")
108
+ training_plan = user.link_model_dataset(dataset_id="<your-dataset-key>")
109
109
 
110
110
  # 4. Start training
111
111
  training_plan.start()
File without changes
File without changes
File without changes