mostlyai 4.6.3__tar.gz → 4.7.0__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.
- {mostlyai-4.6.3 → mostlyai-4.7.0}/PKG-INFO +15 -9
- {mostlyai-4.6.3 → mostlyai-4.7.0}/README.md +10 -4
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/__init__.py +1 -1
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/jobs.py +18 -6
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/client/_utils.py +4 -4
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/client/api.py +5 -4
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/domain.py +48 -2
- {mostlyai-4.6.3 → mostlyai-4.7.0}/pyproject.toml +5 -5
- {mostlyai-4.6.3 → mostlyai-4.7.0}/.gitignore +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/LICENSE +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/__init__.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/auto_detect.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/base.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/context.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/conversions.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/db/__init__.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/db/base.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/db/bigquery.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/db/databricks.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/db/hive.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/db/mssql.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/db/mysql.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/db/oracle.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/db/postgresql.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/db/snowflake.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/db/sqlite.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/db/types_coercion.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/dtype.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/exceptions.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/file/__init__.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/file/base.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/file/container/__init__.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/file/container/aws.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/file/container/azure.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/file/container/bucket_based.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/file/container/gcs.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/file/container/minio.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/file/table/__init__.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/file/table/csv.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/file/table/feather.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/file/table/json.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/file/table/parquet.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/file/utils.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/language_model.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/metadata_objects.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/non_context.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/progress_callback.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/pull.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/pull_context.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/pull_utils.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/push.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/util/__init__.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/util/common.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_data/util/kerberos.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/__init__.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/cli.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/connectors.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/__init__.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/migration.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/plan.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/step_analyze_training_data.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/step_create_data_report.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/step_create_model_report.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/step_deliver_data.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/step_encode_training_data.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/step_finalize_generation.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/step_finalize_training.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/step_generate_data.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/step_generate_model_report_data.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/step_pull_training_data.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/step_train_model.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/generators.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/progress.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/routes.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/server.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/storage.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/synthetic_datasets.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/client/__init__.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/client/_base_utils.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/client/_naming_conventions.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/client/base.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/client/connectors.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/client/exceptions.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/client/generators.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/client/synthetic_datasets.py +0 -0
- {mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mostlyai
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.7.0
|
|
4
4
|
Summary: Synthetic Data SDK
|
|
5
5
|
Project-URL: homepage, https://app.mostly.ai/
|
|
6
6
|
Project-URL: repository, https://github.com/mostly-ai/mostlyai
|
|
@@ -59,8 +59,8 @@ Requires-Dist: fastapi<0.116,>=0.115.6; extra == 'local'
|
|
|
59
59
|
Requires-Dist: filelock>=3.16.1; extra == 'local'
|
|
60
60
|
Requires-Dist: gcsfs>=2023.1.0; extra == 'local'
|
|
61
61
|
Requires-Dist: joblib>=1.4.2; extra == 'local'
|
|
62
|
-
Requires-Dist: mostlyai-engine==1.4.
|
|
63
|
-
Requires-Dist: mostlyai-qa==1.9.
|
|
62
|
+
Requires-Dist: mostlyai-engine==1.4.2; extra == 'local'
|
|
63
|
+
Requires-Dist: mostlyai-qa==1.9.6; extra == 'local'
|
|
64
64
|
Requires-Dist: networkx<4,>=3.0; extra == 'local'
|
|
65
65
|
Requires-Dist: openpyxl>=3.1.5; extra == 'local'
|
|
66
66
|
Requires-Dist: python-multipart>=0.0.20; extra == 'local'
|
|
@@ -81,8 +81,8 @@ Requires-Dist: fastapi<0.116,>=0.115.6; extra == 'local-gpu'
|
|
|
81
81
|
Requires-Dist: filelock>=3.16.1; extra == 'local-gpu'
|
|
82
82
|
Requires-Dist: gcsfs>=2023.1.0; extra == 'local-gpu'
|
|
83
83
|
Requires-Dist: joblib>=1.4.2; extra == 'local-gpu'
|
|
84
|
-
Requires-Dist: mostlyai-engine[gpu]==1.4.
|
|
85
|
-
Requires-Dist: mostlyai-qa==1.9.
|
|
84
|
+
Requires-Dist: mostlyai-engine[gpu]==1.4.2; extra == 'local-gpu'
|
|
85
|
+
Requires-Dist: mostlyai-qa==1.9.6; extra == 'local-gpu'
|
|
86
86
|
Requires-Dist: networkx<4,>=3.0; extra == 'local-gpu'
|
|
87
87
|
Requires-Dist: openpyxl>=3.1.5; extra == 'local-gpu'
|
|
88
88
|
Requires-Dist: python-multipart>=0.0.20; extra == 'local-gpu'
|
|
@@ -350,11 +350,17 @@ As an alternative, you can also build a Docker image, which provides you with an
|
|
|
350
350
|
|
|
351
351
|
<details>
|
|
352
352
|
|
|
353
|
-
<summary>
|
|
353
|
+
<summary>Get the image</summary>
|
|
354
354
|
|
|
355
|
-
|
|
355
|
+
- **Pull from official repository**
|
|
356
356
|
|
|
357
|
-
|
|
357
|
+
`docker pull --platform=linux/amd64 quay.io/mostlyai/sdk`
|
|
358
|
+
|
|
359
|
+
- **(Optional) Build your own image**
|
|
360
|
+
|
|
361
|
+
If your environment is capable of executing Makefile (see [here](https://github.com/mostly-ai/mostlyai/blob/main/Makefile#L47-L73)), then execute `make docker-build`.
|
|
362
|
+
|
|
363
|
+
Otherwise, use `docker buildx build . --platform=linux/amd64 -t quay.io/mostlyai/sdk` instead.
|
|
358
364
|
|
|
359
365
|
</details>
|
|
360
366
|
|
|
@@ -366,7 +372,7 @@ As an alternative, you can also build a Docker image, which provides you with an
|
|
|
366
372
|
|
|
367
373
|
If your environment is capable of executing Makefile, then execute `make docker-run`. Or `make docker-run HOST_PORT=8080` to forward to a host port of your choice. One could also mount the `local_dir` via `make docker-run HOST_LOCAL_DIR=/path/to/host/folder` to make the generators and synthetic datasets directly accessible from the host.
|
|
368
374
|
|
|
369
|
-
Otherwise, use `docker run --platform=linux/amd64 -p 8080:8080 mostlyai/
|
|
375
|
+
Otherwise, use `docker run --platform=linux/amd64 -p 8080:8080 quay.io/mostlyai/sdk` instead. Optionally, you can use the `-v` flag to mount a [volume](https://docs.docker.com/engine/storage/volumes/#syntax) for passing files between the host and the container.
|
|
370
376
|
|
|
371
377
|
</details>
|
|
372
378
|
|
|
@@ -241,11 +241,17 @@ As an alternative, you can also build a Docker image, which provides you with an
|
|
|
241
241
|
|
|
242
242
|
<details>
|
|
243
243
|
|
|
244
|
-
<summary>
|
|
244
|
+
<summary>Get the image</summary>
|
|
245
245
|
|
|
246
|
-
|
|
246
|
+
- **Pull from official repository**
|
|
247
247
|
|
|
248
|
-
|
|
248
|
+
`docker pull --platform=linux/amd64 quay.io/mostlyai/sdk`
|
|
249
|
+
|
|
250
|
+
- **(Optional) Build your own image**
|
|
251
|
+
|
|
252
|
+
If your environment is capable of executing Makefile (see [here](https://github.com/mostly-ai/mostlyai/blob/main/Makefile#L47-L73)), then execute `make docker-build`.
|
|
253
|
+
|
|
254
|
+
Otherwise, use `docker buildx build . --platform=linux/amd64 -t quay.io/mostlyai/sdk` instead.
|
|
249
255
|
|
|
250
256
|
</details>
|
|
251
257
|
|
|
@@ -257,7 +263,7 @@ As an alternative, you can also build a Docker image, which provides you with an
|
|
|
257
263
|
|
|
258
264
|
If your environment is capable of executing Makefile, then execute `make docker-run`. Or `make docker-run HOST_PORT=8080` to forward to a host port of your choice. One could also mount the `local_dir` via `make docker-run HOST_LOCAL_DIR=/path/to/host/folder` to make the generators and synthetic datasets directly accessible from the host.
|
|
259
265
|
|
|
260
|
-
Otherwise, use `docker run --platform=linux/amd64 -p 8080:8080 mostlyai/
|
|
266
|
+
Otherwise, use `docker run --platform=linux/amd64 -p 8080:8080 quay.io/mostlyai/sdk` instead. Optionally, you can use the `-v` flag to mount a [volume](https://docs.docker.com/engine/storage/volumes/#syntax) for passing files between the host and the container.
|
|
261
267
|
|
|
262
268
|
</details>
|
|
263
269
|
|
|
@@ -74,10 +74,16 @@ from mostlyai.sdk._local.execution.plan import (
|
|
|
74
74
|
make_synthetic_dataset_execution_plan,
|
|
75
75
|
)
|
|
76
76
|
from mostlyai.sdk._local.progress import LocalProgressCallback, get_current_utc_time
|
|
77
|
+
from mostlyai import engine
|
|
77
78
|
|
|
78
79
|
_LOG = logging.getLogger(__name__)
|
|
79
80
|
|
|
80
81
|
|
|
82
|
+
def _set_random_state(random_state: int | None = None):
|
|
83
|
+
# rely on engine to set global random state
|
|
84
|
+
engine.set_random_state(random_state)
|
|
85
|
+
|
|
86
|
+
|
|
81
87
|
def _move_training_artefacts(generator_dir: Path, job_workspace_dir: Path):
|
|
82
88
|
for dir in ["Logs", "ModelStore", "ModelQAReports", "ModelQAStatistics"]:
|
|
83
89
|
shutil.rmtree(generator_dir / dir, ignore_errors=True)
|
|
@@ -157,9 +163,12 @@ def _mark_failed(resource: Generator | SyntheticDataset, resource_dir: Path):
|
|
|
157
163
|
write_job_progress_to_json(resource_dir, job_progress)
|
|
158
164
|
|
|
159
165
|
|
|
160
|
-
def _copy_model(generator_dir: Path, model_label: str, workspace_dir: Path):
|
|
166
|
+
def _copy_model(generator_dir: Path, model_label: str, workspace_dir: Path) -> bool:
|
|
161
167
|
model_path = generator_dir / "ModelStore" / model_label
|
|
162
|
-
|
|
168
|
+
if model_path.exists():
|
|
169
|
+
shutil.copytree(model_path, workspace_dir / "ModelStore")
|
|
170
|
+
return True
|
|
171
|
+
return False
|
|
163
172
|
|
|
164
173
|
|
|
165
174
|
def _copy_statistics(generator_dir: Path, model_label: str, workspace_dir: Path) -> bool:
|
|
@@ -334,9 +343,8 @@ class Execution:
|
|
|
334
343
|
workspace_dir.mkdir(parents=True, exist_ok=True)
|
|
335
344
|
update_progress_fn = partial(LocalProgressCallback, resource_path=generator_dir, model_label=model_label)
|
|
336
345
|
|
|
337
|
-
#
|
|
338
|
-
|
|
339
|
-
_copy_model(generator_dir=generator_dir, model_label=model_label_path, workspace_dir=workspace_dir)
|
|
346
|
+
# let's first copy the ModelStore in case that it already exists (training continuation)
|
|
347
|
+
_copy_model(generator_dir=generator_dir, model_label=model_label_path, workspace_dir=workspace_dir)
|
|
340
348
|
|
|
341
349
|
# step: PULL_TRAINING_DATA
|
|
342
350
|
connectors = [
|
|
@@ -574,9 +582,11 @@ class Execution:
|
|
|
574
582
|
def execute_training_job(generator_id: str, home_dir: Path):
|
|
575
583
|
generator_dir = home_dir / "generators" / generator_id
|
|
576
584
|
generator = read_generator_from_json(generator_dir)
|
|
585
|
+
_set_random_state(generator.random_state)
|
|
577
586
|
if generator.training_status not in [ProgressStatus.new, ProgressStatus.continue_]:
|
|
578
587
|
raise ValueError("Generator has already been trained")
|
|
579
588
|
_mark_in_progress(resource=generator, resource_dir=generator_dir)
|
|
589
|
+
|
|
580
590
|
# PLAN
|
|
581
591
|
plan = make_generator_execution_plan(generator)
|
|
582
592
|
# EXECUTE
|
|
@@ -609,14 +619,15 @@ def execute_training_job(generator_id: str, home_dir: Path):
|
|
|
609
619
|
def execute_generation_job(synthetic_dataset_id: str, home_dir: Path):
|
|
610
620
|
synthetic_dataset_dir = home_dir / "synthetic-datasets" / synthetic_dataset_id
|
|
611
621
|
synthetic_dataset = read_synthetic_dataset_from_json(synthetic_dataset_dir)
|
|
622
|
+
_set_random_state(synthetic_dataset.random_state)
|
|
612
623
|
generator_dir = home_dir / "generators" / synthetic_dataset.generator_id
|
|
613
624
|
generator = read_generator_from_json(generator_dir)
|
|
614
625
|
if generator.training_status != ProgressStatus.done:
|
|
615
626
|
raise ValueError("Generator has not been trained yet")
|
|
616
627
|
if synthetic_dataset.generation_status != ProgressStatus.new:
|
|
617
628
|
raise ValueError("Synthetic Dataset has already been generated")
|
|
618
|
-
|
|
619
629
|
_mark_in_progress(resource=synthetic_dataset, resource_dir=synthetic_dataset_dir)
|
|
630
|
+
|
|
620
631
|
# PLAN
|
|
621
632
|
plan = make_synthetic_dataset_execution_plan(generator, synthetic_dataset)
|
|
622
633
|
# EXECUTE
|
|
@@ -647,6 +658,7 @@ def execute_generation_job(synthetic_dataset_id: str, home_dir: Path):
|
|
|
647
658
|
def execute_probing_job(synthetic_dataset_id: str, home_dir: Path) -> list[Probe]:
|
|
648
659
|
synthetic_dataset_dir = home_dir / "synthetic-datasets" / synthetic_dataset_id
|
|
649
660
|
synthetic_dataset = read_synthetic_dataset_from_json(synthetic_dataset_dir)
|
|
661
|
+
_set_random_state(synthetic_dataset.random_state)
|
|
650
662
|
generator_id = synthetic_dataset.generator_id
|
|
651
663
|
generator_dir = home_dir / "generators" / generator_id
|
|
652
664
|
generator = read_generator_from_json(generator_dir)
|
|
@@ -267,10 +267,10 @@ def job_wait(
|
|
|
267
267
|
current_task = progress.tasks[current_task_id]
|
|
268
268
|
if not current_task.started and step.start_date is not None:
|
|
269
269
|
progress.start_task(current_task_id)
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
270
|
+
if step.step_code == StepCode.train_model and step_id_to_layout_idx.get(step.id) is None:
|
|
271
|
+
layout.add_row(Text("\n\n"))
|
|
272
|
+
layout.add_row(training_log)
|
|
273
|
+
step_id_to_layout_idx[step.id] = len(layout.rows) - 1
|
|
274
274
|
if step.progress.max > 0:
|
|
275
275
|
progress.update(
|
|
276
276
|
current_task_id,
|
|
@@ -453,10 +453,11 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
453
453
|
'enable_flexible_generation': True, # allow seed, imputation, rebalancing and fairness; set to False for max accuracy
|
|
454
454
|
'value_protection': True, # privacy protect value ranges; set to False for allowing all seen values
|
|
455
455
|
'differential_privacy': { # set DP configs if explicitly requested
|
|
456
|
-
'max_epsilon':
|
|
457
|
-
'noise_multiplier': 1.5, # -
|
|
458
|
-
'max_grad_norm': 1.0, # -
|
|
459
|
-
'delta': 1e-5, # -
|
|
456
|
+
'max_epsilon': 5.0, # - max DP epsilon value, used as stopping criterion
|
|
457
|
+
'noise_multiplier': 1.5, # - noise multiplier for DP-SGD training
|
|
458
|
+
'max_grad_norm': 1.0, # - max grad norm for DP-SGD training
|
|
459
|
+
'delta': 1e-5, # - delta value for DP-SGD training
|
|
460
|
+
'value_protection_epsilon': 2.0, # - DP epsilon for determining value ranges / data domains
|
|
460
461
|
},
|
|
461
462
|
'enable_model_report': True, # generate a model report, including quality metrics
|
|
462
463
|
},
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
# generated by datamodel-codegen:
|
|
16
|
-
# timestamp: 2025-05-
|
|
16
|
+
# timestamp: 2025-05-22T08:15:49+00:00
|
|
17
17
|
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
@@ -243,6 +243,7 @@ class ConnectorUsage(CustomBaseModel):
|
|
|
243
243
|
alias="noOfGenerators",
|
|
244
244
|
description="Number of generators using this connector.",
|
|
245
245
|
)
|
|
246
|
+
no_of_likes: int | None = Field(None, alias="noOfLikes", description="Number of likes of this connector.")
|
|
246
247
|
|
|
247
248
|
|
|
248
249
|
class ConnectorConfig(CustomBaseModel):
|
|
@@ -375,6 +376,7 @@ class ConnectorConfig(CustomBaseModel):
|
|
|
375
376
|
"""
|
|
376
377
|
|
|
377
378
|
name: str | None = Field(None, description="The name of a connector.")
|
|
379
|
+
description: str | None = Field(None, description="The description of a connector.")
|
|
378
380
|
type: ConnectorType
|
|
379
381
|
access_type: ConnectorAccessType | None = Field(ConnectorAccessType.read_protected, alias="accessType")
|
|
380
382
|
config: dict[str, Any] | None = None
|
|
@@ -389,6 +391,8 @@ class ConnectorPatchConfig(CustomBaseModel):
|
|
|
389
391
|
"""
|
|
390
392
|
|
|
391
393
|
name: str | None = Field(None, description="The name of a connector.")
|
|
394
|
+
description: str | None = Field(None, description="The description of a connector.")
|
|
395
|
+
access_type: ConnectorAccessType | None = Field(ConnectorAccessType.read_protected, alias="accessType")
|
|
392
396
|
config: dict[str, Any] | None = None
|
|
393
397
|
secrets: Annotated[dict[str, str] | None, Field(repr=False)] = None
|
|
394
398
|
ssl: Annotated[dict[str, str] | None, Field(repr=False)] = None
|
|
@@ -461,6 +465,7 @@ class ConnectorQueryConfig(CustomBaseModel):
|
|
|
461
465
|
class ConnectorSortField(str, Enum):
|
|
462
466
|
recency = "RECENCY"
|
|
463
467
|
no_of_generators = "NO_OF_GENERATORS"
|
|
468
|
+
no_of_likes = "NO_OF_LIKES"
|
|
464
469
|
|
|
465
470
|
|
|
466
471
|
class GeneratorUsage(CustomBaseModel):
|
|
@@ -1782,6 +1787,7 @@ class ConnectorListItem(CustomBaseModel):
|
|
|
1782
1787
|
|
|
1783
1788
|
id: str = Field(..., description="The unique identifier of a connector.")
|
|
1784
1789
|
name: str | None = Field(None, description="The name of a connector.")
|
|
1790
|
+
description: str | None = Field(None, description="The description of a connector.")
|
|
1785
1791
|
type: ConnectorType
|
|
1786
1792
|
access_type: ConnectorAccessType | None = Field(ConnectorAccessType.read_protected, alias="accessType")
|
|
1787
1793
|
metadata: Metadata | None = None
|
|
@@ -1810,6 +1816,7 @@ class Connector(CustomBaseModel):
|
|
|
1810
1816
|
|
|
1811
1817
|
id: str = Field(..., description="The unique identifier of a connector.")
|
|
1812
1818
|
name: str | None = Field(None, description="The name of a connector.")
|
|
1819
|
+
description: str | None = Field(None, description="The description of a connector.")
|
|
1813
1820
|
type: ConnectorType
|
|
1814
1821
|
access_type: ConnectorAccessType | None = Field(ConnectorAccessType.read_protected, alias="accessType")
|
|
1815
1822
|
config: dict[str, Any] | None = None
|
|
@@ -1835,6 +1842,8 @@ class Connector(CustomBaseModel):
|
|
|
1835
1842
|
def update(
|
|
1836
1843
|
self,
|
|
1837
1844
|
name: str | None = None,
|
|
1845
|
+
description: str | None = None,
|
|
1846
|
+
access_type: ConnectorAccessType | None = None,
|
|
1838
1847
|
config: dict[str, Any] | None = None,
|
|
1839
1848
|
secrets: Annotated[dict[str, str] | None, Field(repr=False)] = None,
|
|
1840
1849
|
ssl: Annotated[dict[str, str] | None, Field(repr=False)] = None,
|
|
@@ -1845,6 +1854,8 @@ class Connector(CustomBaseModel):
|
|
|
1845
1854
|
|
|
1846
1855
|
Args:
|
|
1847
1856
|
name (str | None): The name of the connector.
|
|
1857
|
+
description (str | None): The description of the connector.
|
|
1858
|
+
access_type (ConnectorAccessType | None): The access type of the connector.
|
|
1848
1859
|
config (dict[str, Any] | None): Connector configuration.
|
|
1849
1860
|
secrets (dict[str, str] | None): Secret values for the connector.
|
|
1850
1861
|
ssl (dict[str, str] | None): SSL configuration for the connector.
|
|
@@ -1852,6 +1863,8 @@ class Connector(CustomBaseModel):
|
|
|
1852
1863
|
"""
|
|
1853
1864
|
patch_config = ConnectorPatchConfig(
|
|
1854
1865
|
name=name,
|
|
1866
|
+
description=description,
|
|
1867
|
+
access_type=access_type,
|
|
1855
1868
|
config=config,
|
|
1856
1869
|
secrets=secrets,
|
|
1857
1870
|
ssl=ssl,
|
|
@@ -2841,6 +2854,11 @@ class SyntheticDatasetConfig(CustomBaseModel):
|
|
|
2841
2854
|
generator_id: str | None = Field(None, alias="generatorId", description="The unique identifier of a generator.")
|
|
2842
2855
|
name: str | None = Field(None, description="The name of a synthetic dataset.")
|
|
2843
2856
|
description: str | None = Field(None, description="The description of a synthetic dataset.")
|
|
2857
|
+
random_state: int | None = Field(
|
|
2858
|
+
None,
|
|
2859
|
+
alias="randomState",
|
|
2860
|
+
description="Seed for the random number generators. If None, the random number generator is initialized randomly, yielding different results for every run.\nSetting it to a specific integer ensures reproducible results across runs.\nUseful when consistent results are desired, e.g. for testing or debugging.\n",
|
|
2861
|
+
)
|
|
2844
2862
|
tables: list[SyntheticTableConfig] | None = None
|
|
2845
2863
|
delivery: SyntheticDatasetDelivery | None = None
|
|
2846
2864
|
compute: str | None = Field(
|
|
@@ -2868,6 +2886,11 @@ class SyntheticProbeConfig(CustomBaseModel):
|
|
|
2868
2886
|
"""
|
|
2869
2887
|
|
|
2870
2888
|
generator_id: str | None = Field(None, alias="generatorId", description="The unique identifier of a generator.")
|
|
2889
|
+
random_state: int | None = Field(
|
|
2890
|
+
None,
|
|
2891
|
+
alias="randomState",
|
|
2892
|
+
description="Seed for the random number generators. If None, the random number generator is initialized randomly, yielding different results for every run.\nSetting it to a specific integer ensures reproducible results across runs.\nUseful when consistent results are desired, e.g. for testing or debugging.\n",
|
|
2893
|
+
)
|
|
2871
2894
|
tables: list[SyntheticTableConfig] | None = None
|
|
2872
2895
|
|
|
2873
2896
|
@field_validator("tables", mode="after")
|
|
@@ -2971,6 +2994,11 @@ class Generator(CustomBaseModel):
|
|
|
2971
2994
|
description="The overall accuracy of the trained generator.\nThis is the average of the overall accuracy scores of all trained models.\n",
|
|
2972
2995
|
)
|
|
2973
2996
|
tables: list[SourceTable] | None = Field(None, description="The tables of this generator")
|
|
2997
|
+
random_state: int | None = Field(
|
|
2998
|
+
None,
|
|
2999
|
+
alias="randomState",
|
|
3000
|
+
description="Seed for the random number generators. If None, the random number generator is initialized randomly, yielding different results for every run. \nSetting it to a specific integer ensures reproducible results across runs.\nUseful when consistent results are desired, e.g. for testing or debugging.\n",
|
|
3001
|
+
)
|
|
2974
3002
|
OPEN_URL_PARTS: ClassVar[list] = ["d", "generators"]
|
|
2975
3003
|
training: Annotated[Any | None, Field(exclude=True)] = None
|
|
2976
3004
|
|
|
@@ -3052,7 +3080,15 @@ class Generator(CustomBaseModel):
|
|
|
3052
3080
|
Returns:
|
|
3053
3081
|
Generator: The cloned generator object.
|
|
3054
3082
|
"""
|
|
3055
|
-
|
|
3083
|
+
generator = self.client._clone(generator_id=self.id, training_status=training_status)
|
|
3084
|
+
gid = generator.id
|
|
3085
|
+
if self.client.local:
|
|
3086
|
+
rich.print(f"Created generator [dodger_blue2]{gid}[/]")
|
|
3087
|
+
else:
|
|
3088
|
+
rich.print(
|
|
3089
|
+
f"Created generator [link={self.client.base_url}/d/generators/{gid} dodger_blue2 underline]{gid}[/]"
|
|
3090
|
+
)
|
|
3091
|
+
return generator
|
|
3056
3092
|
|
|
3057
3093
|
def reports(self, file_path: str | Path | None = None, display: bool = False) -> Path | None:
|
|
3058
3094
|
"""
|
|
@@ -3184,6 +3220,11 @@ class GeneratorConfig(CustomBaseModel):
|
|
|
3184
3220
|
|
|
3185
3221
|
name: str | None = Field(None, description="The name of a generator.")
|
|
3186
3222
|
description: str | None = Field(None, description="The description of a generator.")
|
|
3223
|
+
random_state: int | None = Field(
|
|
3224
|
+
None,
|
|
3225
|
+
alias="randomState",
|
|
3226
|
+
description="Seed for the random number generators. If None, the random number generator is initialized randomly, yielding different results for every run. \nSetting it to a specific integer ensures reproducible results across runs.\nUseful when consistent results are desired, e.g. for testing or debugging.\n",
|
|
3227
|
+
)
|
|
3187
3228
|
tables: list[SourceTableConfig] | None = Field(None, description="The tables of a generator")
|
|
3188
3229
|
|
|
3189
3230
|
@field_validator("tables", mode="after")
|
|
@@ -3266,6 +3307,11 @@ class SyntheticDataset(CustomBaseModel):
|
|
|
3266
3307
|
None,
|
|
3267
3308
|
description="The unique identifier of a compute resource. Not applicable for SDK.",
|
|
3268
3309
|
)
|
|
3310
|
+
random_state: int | None = Field(
|
|
3311
|
+
None,
|
|
3312
|
+
alias="randomState",
|
|
3313
|
+
description="Seed for the random number generators. If None, the random number generator is initialized randomly, yielding different results for every run.\nSetting it to a specific integer ensures reproducible results across runs.\nUseful when consistent results are desired, e.g. for testing or debugging.\n",
|
|
3314
|
+
)
|
|
3269
3315
|
OPEN_URL_PARTS: ClassVar[list] = ["d", "synthetic-datasets"]
|
|
3270
3316
|
generation: Annotated[Any | None, Field(exclude=True)] = None
|
|
3271
3317
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "mostlyai"
|
|
3
|
-
version = "4.
|
|
3
|
+
version = "4.7.0"
|
|
4
4
|
description = "Synthetic Data SDK"
|
|
5
5
|
authors = [{ name = "MOSTLY AI", email = "dev@mostly.ai" }]
|
|
6
6
|
requires-python = ">=3.10,<3.14"
|
|
@@ -49,8 +49,8 @@ dependencies = [
|
|
|
49
49
|
local = [
|
|
50
50
|
# "mostlyai-engine @ git+https://github.com/mostly-ai/mostlyai-engine.git@main", # for development
|
|
51
51
|
# "mostlyai-qa @ git+https://github.com/mostly-ai/mostlyai-qa.git@main", # for development
|
|
52
|
-
"mostlyai-engine==1.4.
|
|
53
|
-
"mostlyai-qa==1.9.
|
|
52
|
+
"mostlyai-engine==1.4.2", # for release
|
|
53
|
+
"mostlyai-qa==1.9.6", # for release
|
|
54
54
|
"fastapi>=0.115.6,<0.116",
|
|
55
55
|
"uvicorn>=0.34.0,<0.35",
|
|
56
56
|
"python-multipart>=0.0.20",
|
|
@@ -75,8 +75,8 @@ local = [
|
|
|
75
75
|
local-gpu = [
|
|
76
76
|
# "mostlyai-engine[gpu] @ git+https://github.com/mostly-ai/mostlyai-engine.git@main", # for development
|
|
77
77
|
# "mostlyai-qa @ git+https://github.com/mostly-ai/mostlyai-qa.git@main", # for development
|
|
78
|
-
"mostlyai-engine[gpu]==1.4.
|
|
79
|
-
"mostlyai-qa==1.9.
|
|
78
|
+
"mostlyai-engine[gpu]==1.4.2", # for release
|
|
79
|
+
"mostlyai-qa==1.9.6", # for release
|
|
80
80
|
"fastapi>=0.115.6,<0.116",
|
|
81
81
|
"uvicorn>=0.34.0,<0.35",
|
|
82
82
|
"python-multipart>=0.0.20",
|
|
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
|
{mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/step_analyze_training_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/step_encode_training_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyai-4.6.3 → mostlyai-4.7.0}/mostlyai/sdk/_local/execution/step_generate_model_report_data.py
RENAMED
|
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
|