modelzone-sdk 0.1.0__tar.gz → 0.2.0.dev0__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.
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/PKG-INFO +2 -3
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/README.md +1 -1
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/azureml/backend.py +8 -13
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/training/backend.py +2 -4
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/training/context.py +9 -4
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/pyproject.toml +2 -4
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/__init__.py +0 -0
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/azureml/__init__.py +0 -0
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/cli.py +0 -0
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/core/__init__.py +0 -0
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/core/constants.py +0 -0
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/core/model.py +0 -0
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/core/predict_context.py +0 -0
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/core/record.py +0 -0
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/core/trained_model.py +0 -0
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/core/training_result.py +0 -0
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/predict.py +0 -0
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/training/__init__.py +0 -0
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/training/db.py +0 -0
- {modelzone_sdk-0.1.0 → modelzone_sdk-0.2.0.dev0}/modelzone/training/delta_client.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: modelzone-sdk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0.dev0
|
|
4
4
|
Summary: Modelzone SDK – a slim model training and serving toolkit
|
|
5
5
|
License-Expression: Apache-2.0
|
|
6
6
|
Author: Team Enigma
|
|
@@ -14,10 +14,8 @@ Provides-Extra: azureml
|
|
|
14
14
|
Provides-Extra: training
|
|
15
15
|
Requires-Dist: azure-ai-ml ; extra == "azureml"
|
|
16
16
|
Requires-Dist: azure-identity ; extra == "azureml"
|
|
17
|
-
Requires-Dist: datamazing (>=7,<8)
|
|
18
17
|
Requires-Dist: deltalake (>=1) ; extra == "training"
|
|
19
18
|
Requires-Dist: mlflow (>=3) ; extra == "azureml"
|
|
20
|
-
Requires-Dist: pandas (>=2,<3)
|
|
21
19
|
Description-Content-Type: text/markdown
|
|
22
20
|
|
|
23
21
|
# Modelzone SDK
|
|
@@ -114,3 +112,4 @@ modelzone fetch my_model_package --output-dir .model
|
|
|
114
112
|
poetry install --with dev,test
|
|
115
113
|
pytest
|
|
116
114
|
```
|
|
115
|
+
|
|
@@ -18,15 +18,11 @@ import tempfile
|
|
|
18
18
|
from typing import Any
|
|
19
19
|
|
|
20
20
|
import datamazing.pandas as pdz
|
|
21
|
-
import requests
|
|
21
|
+
import requests
|
|
22
22
|
|
|
23
|
-
from modelzone.core.constants import
|
|
24
|
-
from modelzone.core
|
|
25
|
-
from modelzone.
|
|
26
|
-
from modelzone.core.trained_model import TrainedModel
|
|
27
|
-
from modelzone.core.training_result import TrainingResult
|
|
28
|
-
from modelzone.training.backend import Backend
|
|
29
|
-
from modelzone.training.context import TrainingContext
|
|
23
|
+
from modelzone.core.constants import RECORD_FILENAME, TRAINED_MODEL_FILENAME
|
|
24
|
+
from modelzone.core import Model, RunRecord, TrainedModel, TrainingResult
|
|
25
|
+
from modelzone.training import Backend, TrainingContext
|
|
30
26
|
|
|
31
27
|
try:
|
|
32
28
|
import mlflow
|
|
@@ -174,7 +170,7 @@ class AzureMLBackend(Backend):
|
|
|
174
170
|
f"/runs/{run_id}/artifacts/batch/metadata"
|
|
175
171
|
)
|
|
176
172
|
body = {"paths": [{"path": p} for p in remote_paths]}
|
|
177
|
-
resp =
|
|
173
|
+
resp = requests.post(
|
|
178
174
|
url,
|
|
179
175
|
json=body,
|
|
180
176
|
headers={
|
|
@@ -199,7 +195,7 @@ class AzureMLBackend(Backend):
|
|
|
199
195
|
f"{self._history_base()}/experiments/{self.experiment_name}"
|
|
200
196
|
f"/runs/{run_id}/artifacts"
|
|
201
197
|
)
|
|
202
|
-
resp =
|
|
198
|
+
resp = requests.get(url, headers=self._auth_headers())
|
|
203
199
|
resp.raise_for_status()
|
|
204
200
|
all_artifacts = resp.json().get("value", [])
|
|
205
201
|
|
|
@@ -216,7 +212,7 @@ class AzureMLBackend(Backend):
|
|
|
216
212
|
f"{self._history_base()}/experiments/{self.experiment_name}"
|
|
217
213
|
f"/runs/{run_id}/artifacts/contentinfo"
|
|
218
214
|
)
|
|
219
|
-
resp =
|
|
215
|
+
resp = requests.get(
|
|
220
216
|
info_url,
|
|
221
217
|
params={"path": remote_path},
|
|
222
218
|
headers=self._auth_headers(),
|
|
@@ -439,8 +435,7 @@ class AzureMLBackend(Backend):
|
|
|
439
435
|
download_path=download_dir,
|
|
440
436
|
)
|
|
441
437
|
|
|
442
|
-
|
|
443
|
-
local_path = os.path.join(download_dir, model_name, "model")
|
|
438
|
+
local_path = os.path.join(download_dir, model_name, "run_output")
|
|
444
439
|
|
|
445
440
|
with open(os.path.join(local_path, TRAINED_MODEL_FILENAME), "rb") as f:
|
|
446
441
|
trained_model: TrainedModel = pickle.load(f) # noqa: S301
|
|
@@ -14,10 +14,7 @@ from typing import Any
|
|
|
14
14
|
import datamazing.pandas as pdz
|
|
15
15
|
|
|
16
16
|
from modelzone.core.constants import CODE_DIR, RECORD_FILENAME, TRAINED_MODEL_FILENAME
|
|
17
|
-
from modelzone.core
|
|
18
|
-
from modelzone.core.record import RunRecord
|
|
19
|
-
from modelzone.core.trained_model import TrainedModel
|
|
20
|
-
from modelzone.core.training_result import TrainingResult
|
|
17
|
+
from modelzone.core import Model, RunRecord, TrainedModel, TrainingResult
|
|
21
18
|
from modelzone.training.context import TrainingContext
|
|
22
19
|
|
|
23
20
|
_SNAPSHOT_IGNORE = shutil.ignore_patterns(
|
|
@@ -32,6 +29,7 @@ _SNAPSHOT_IGNORE = shutil.ignore_patterns(
|
|
|
32
29
|
"node_modules",
|
|
33
30
|
"build",
|
|
34
31
|
"dist",
|
|
32
|
+
".cache",
|
|
35
33
|
)
|
|
36
34
|
|
|
37
35
|
|
|
@@ -11,12 +11,17 @@ from __future__ import annotations
|
|
|
11
11
|
|
|
12
12
|
import json
|
|
13
13
|
import os
|
|
14
|
-
from typing import Any
|
|
15
|
-
|
|
16
|
-
import datamazing.pandas as pdz
|
|
14
|
+
from typing import Any, Protocol
|
|
17
15
|
|
|
18
16
|
from modelzone.core.record import Metric, RunRecord
|
|
19
17
|
|
|
18
|
+
|
|
19
|
+
class Database(Protocol):
|
|
20
|
+
"""Structural type for a database that can execute queries."""
|
|
21
|
+
|
|
22
|
+
def query(self, table_name: str, **kwargs: Any) -> Any: ...
|
|
23
|
+
|
|
24
|
+
|
|
20
25
|
# Subdirectories / files inside the run directory
|
|
21
26
|
_METRICS_FILE = "metrics.jsonl"
|
|
22
27
|
_LOG_FILE = "output.log"
|
|
@@ -43,7 +48,7 @@ class TrainingContext:
|
|
|
43
48
|
run_dir: str,
|
|
44
49
|
seed: int,
|
|
45
50
|
params: dict[str, Any] | None = None,
|
|
46
|
-
db:
|
|
51
|
+
db: Database | None = None,
|
|
47
52
|
) -> None:
|
|
48
53
|
self.run_dir = run_dir
|
|
49
54
|
self.seed = seed
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "modelzone-sdk"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.2.0.dev"
|
|
4
4
|
description = "Modelzone SDK – a slim model training and serving toolkit"
|
|
5
5
|
authors = [{ name = "Team Enigma", email = "enigma@energinet.dk" }]
|
|
6
6
|
requires-python = ">=3.13"
|
|
7
7
|
readme = "README.md"
|
|
8
8
|
license = "Apache-2.0"
|
|
9
|
-
dependencies = [
|
|
9
|
+
dependencies = []
|
|
10
10
|
classifiers = [
|
|
11
11
|
"Development Status :: 3 - Alpha",
|
|
12
12
|
"Intended Audience :: Developers",
|
|
@@ -26,8 +26,6 @@ packages = [{ include = "modelzone" }]
|
|
|
26
26
|
requires-poetry = ">=2.2"
|
|
27
27
|
|
|
28
28
|
[tool.poetry.dependencies]
|
|
29
|
-
datamazing = "^7.0.1"
|
|
30
|
-
pandas = ">=2.3.3,<3"
|
|
31
29
|
|
|
32
30
|
[tool.poetry.group.training.dependencies]
|
|
33
31
|
deltalake = ">=1"
|
|
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
|