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.
- {tracebloc-1.2.63 → tracebloc-1.2.65}/PKG-INFO +2 -2
- {tracebloc-1.2.63 → tracebloc-1.2.65}/README.md +1 -1
- {tracebloc-1.2.63 → tracebloc-1.2.65}/pyproject.toml +1 -1
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/_linking.py +36 -35
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/plan.py +24 -20
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/summary.py +3 -3
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/user.py +2 -3
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc.egg-info/PKG-INFO +2 -2
- {tracebloc-1.2.63 → tracebloc-1.2.65}/MANIFEST.in +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/license.txt +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/setup.cfg +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/__init__.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/_deprecation.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/_framework_utils.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/_http_utils.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/_link_answer.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/_raw_width_note.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/_stored_link.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/checks.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/client.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/config.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/contracts/stage_urls.v1.json +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/contracts/stage_urls.v1.source.json +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/contracts/survival_payload.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/env_login.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/exceptions.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/fetch.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/inference.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/lifelines_weights.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/link_model_dataset.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/__init__.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/templates/_partials.tpl +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/templates/embeddings.tpl +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/templates/nlp_finetune.tpl +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/templates/nlp_generative.tpl +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/templates/survival.tpl +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/templates/tabular_timeseries.tpl +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/notebook/templates/vision_from_scratch.tpl +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/raw_mode.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/raw_mode_frame.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/raw_mode_seed.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/raw_mode_survival.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/raw_mode_torch.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/seed_weights.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/__init__.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/augmentation.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/callbacks.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/features.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/image_size.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/lora.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/lora_validation.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/loss.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/memory_estimate.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/preprocessing.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/shape.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/subdataset.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/training/submitter.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/__init__.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/lifelines_time_to_event.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/model_upload.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/scikit_survival_time_to_event.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/skl_tabular_base.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/skl_tabular_classifier.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/skl_tabular_regression.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/statistical_base.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/survival_base.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_causal_language_modeler.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_embeddings.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_image_classifier.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_key_point_detector.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_masked_language_modeler.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_nlp_base.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_object_detector.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_semantic_segmentation.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_sentence_pair_classifier.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_seq2seq_modeler.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_tabular_classifier.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_tabular_regression.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_text_classifier.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_time_series_classifier.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_time_series_forecaster.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_time_to_event.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/torch_token_classifier.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/upload/weight_loaders.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/__init__.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/class_order.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/constants.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/custom_loss_probe.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/detection_utils.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/entry_point.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/feature_dict.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/general_utils.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/key_point_detection_utils.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/registry.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/safetensors_io.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/semantic_segmentation_utils.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/tabular_classification_utils.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/tabular_custom_loss_utils.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/tabular_regression_utils.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/text_classification_utils.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/time_series_utils.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/time_to_event_utils.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/utils/warnings_once.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/__init__.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/checker.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/header_rules.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/lifelines_checks.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/pytorch_checks.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/rewriter.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/scikit_survival_checks.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc/validation/sklearn_checks.py +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc.egg-info/SOURCES.txt +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc.egg-info/dependency_links.txt +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc.egg-info/requires.txt +0 -0
- {tracebloc-1.2.63 → tracebloc-1.2.65}/tracebloc.egg-info/top_level.txt +0 -0
- {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.
|
|
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-
|
|
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-
|
|
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.
|
|
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
|
|
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
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
|
135
|
-
f"There is no dataset with
|
|
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
|
|
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/
|
|
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(
|
|
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
|
|
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
|
|
325
|
-
|
|
326
|
-
|
|
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
|
-
|
|
376
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
152
|
-
#
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
111
|
-
#
|
|
112
|
-
#
|
|
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
|
-
|
|
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
|
|
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.
|
|
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-
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|