mostlyai-engine 1.0.1__tar.gz → 1.0.3__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 (47) hide show
  1. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/PKG-INFO +23 -14
  2. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/README.md +9 -4
  3. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/__init__.py +3 -2
  4. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_language/generation.py +1 -1
  5. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_workspace.py +0 -15
  6. mostlyai_engine-1.0.3/mostlyai/engine/logging.py +34 -0
  7. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/pyproject.toml +15 -11
  8. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/.gitignore +0 -0
  9. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/LICENSE +0 -0
  10. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_common.py +0 -0
  11. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_dtypes.py +0 -0
  12. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_encoding_types/__init__.py +0 -0
  13. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_encoding_types/language/__init__.py +0 -0
  14. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_encoding_types/language/text.py +0 -0
  15. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_encoding_types/tabular/__init__.py +0 -0
  16. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_encoding_types/tabular/categorical.py +0 -0
  17. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_encoding_types/tabular/character.py +0 -0
  18. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_encoding_types/tabular/datetime.py +0 -0
  19. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_encoding_types/tabular/itt.py +0 -0
  20. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_encoding_types/tabular/lat_long.py +0 -0
  21. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_encoding_types/tabular/numeric.py +0 -0
  22. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_language/__init__.py +0 -0
  23. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_language/common.py +0 -0
  24. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_language/encoding.py +0 -0
  25. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_language/engine/__init__.py +0 -0
  26. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_language/engine/base.py +0 -0
  27. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_language/engine/hf_engine.py +0 -0
  28. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_language/engine/vllm_engine.py +0 -0
  29. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_language/formatron_utils.py +0 -0
  30. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_language/lstm.py +0 -0
  31. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_language/tokenizer_utils.py +0 -0
  32. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_language/training.py +0 -0
  33. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_memory.py +0 -0
  34. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_tabular/__init__.py +0 -0
  35. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_tabular/argn.py +0 -0
  36. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_tabular/common.py +0 -0
  37. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_tabular/encoding.py +0 -0
  38. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_tabular/fairness.py +0 -0
  39. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_tabular/generation.py +0 -0
  40. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_tabular/training.py +0 -0
  41. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/_training_utils.py +0 -0
  42. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/analysis.py +0 -0
  43. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/domain.py +0 -0
  44. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/encoding.py +0 -0
  45. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/generation.py +0 -0
  46. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/splitting.py +0 -0
  47. {mostlyai_engine-1.0.1 → mostlyai_engine-1.0.3}/mostlyai/engine/training.py +0 -0
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mostlyai-engine
3
- Version: 1.0.1
4
- Summary: Synthetic Data - Engine
5
- Project-URL: Homepage, https://github.com/mostly-ai/mostlyai-engine
6
- Project-URL: Documentation, https://mostly-ai.github.io/mostlyai-engine/
7
- Project-URL: Source, https://github.com/mostly-ai/mostlyai-engine
3
+ Version: 1.0.3
4
+ Summary: Synthetic Data Engine
5
+ Project-URL: homepage, https://github.com/mostly-ai/mostlyai-engine
6
+ Project-URL: repository, https://github.com/mostly-ai/mostlyai-engine
7
+ Project-URL: documentation, https://mostly-ai.github.io/mostlyai-engine/
8
8
  Author-email: MOSTLY AI <dev@mostly.ai>
9
9
  License-Expression: Apache-2.0
10
10
  License-File: LICENSE
@@ -17,9 +17,13 @@ Classifier: Intended Audience :: Science/Research
17
17
  Classifier: Intended Audience :: Telecommunications Industry
18
18
  Classifier: License :: OSI Approved :: Apache Software License
19
19
  Classifier: Operating System :: OS Independent
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
20
24
  Classifier: Topic :: Software Development :: Libraries
21
25
  Classifier: Typing :: Typed
22
- Requires-Python: <3.13,>=3.10
26
+ Requires-Python: >=3.10
23
27
  Requires-Dist: accelerate<0.32,>=0.31.0
24
28
  Requires-Dist: datasets<3,>=2.20.0
25
29
  Requires-Dist: formatron<0.5,>=0.4.11
@@ -34,14 +38,14 @@ Requires-Dist: pyarrow>=16.0.0
34
38
  Requires-Dist: rich<14,>=13.9.4
35
39
  Requires-Dist: setuptools<76,>=75.0.0
36
40
  Requires-Dist: tokenizers<0.21,>=0.20.1
37
- Requires-Dist: torch==2.5.1; sys_platform == 'darwin'
41
+ Requires-Dist: torch>=2.5.1; sys_platform == 'darwin'
38
42
  Requires-Dist: transformers<5,>=4.45.2
39
43
  Provides-Extra: cpu
40
- Requires-Dist: torch==2.5.1+cpu; (sys_platform != 'darwin') and extra == 'cpu'
41
- Requires-Dist: torch==2.5.1; (sys_platform == 'darwin') and extra == 'cpu'
44
+ Requires-Dist: torch==2.5.1+cpu; (sys_platform == 'linux') and extra == 'cpu'
45
+ Requires-Dist: torch>=2.5.1; (sys_platform != 'linux') and extra == 'cpu'
42
46
  Provides-Extra: gpu
43
47
  Requires-Dist: bitsandbytes<0.44,>=0.43.3; extra == 'gpu'
44
- Requires-Dist: torch==2.5.1; extra == 'gpu'
48
+ Requires-Dist: torch>=2.5.1; extra == 'gpu'
45
49
  Requires-Dist: vllm<0.7,>=0.6.4; extra == 'gpu'
46
50
  Description-Content-Type: text/markdown
47
51
 
@@ -77,7 +81,7 @@ pip install -U mostlyai-engine
77
81
 
78
82
  or alternatively for a GPU setup:
79
83
  ```bash
80
- pip install -U mostlyai-engine[gpu]
84
+ pip install -U 'mostlyai-engine[gpu]'
81
85
  ```
82
86
 
83
87
 
@@ -90,8 +94,9 @@ from pathlib import Path
90
94
  import pandas as pd
91
95
  from mostlyai import engine
92
96
 
93
- # set up workspace
97
+ # set up workspace and default logging
94
98
  ws = Path("ws-tabular-flat")
99
+ engine.init_logging()
95
100
 
96
101
  # load original data
97
102
  url = "https://github.com/mostly-ai/public-demo-data/raw/refs/heads/dev/census"
@@ -120,8 +125,11 @@ from pathlib import Path
120
125
  import pandas as pd
121
126
  from mostlyai import engine
122
127
 
123
- # set up workspace
128
+ engine.init_logging()
129
+
130
+ # set up workspace and default logging
124
131
  ws = Path("ws-tabular-sequential")
132
+ engine.init_logging()
125
133
 
126
134
  # load original data
127
135
  url = "https://github.com/mostly-ai/public-demo-data/raw/refs/heads/dev/baseball"
@@ -154,8 +162,9 @@ from pathlib import Path
154
162
  import pandas as pd
155
163
  from mostlyai import engine
156
164
 
157
- # set up workspace
165
+ # init workspace and logging
158
166
  ws = Path("ws-language-flat")
167
+ engine.init_logging()
159
168
 
160
169
  # load original data
161
170
  trn_df = pd.read_parquet("https://github.com/mostly-ai/public-demo-data/raw/refs/heads/dev/headlines/headlines.parquet")
@@ -30,7 +30,7 @@ pip install -U mostlyai-engine
30
30
 
31
31
  or alternatively for a GPU setup:
32
32
  ```bash
33
- pip install -U mostlyai-engine[gpu]
33
+ pip install -U 'mostlyai-engine[gpu]'
34
34
  ```
35
35
 
36
36
 
@@ -43,8 +43,9 @@ from pathlib import Path
43
43
  import pandas as pd
44
44
  from mostlyai import engine
45
45
 
46
- # set up workspace
46
+ # set up workspace and default logging
47
47
  ws = Path("ws-tabular-flat")
48
+ engine.init_logging()
48
49
 
49
50
  # load original data
50
51
  url = "https://github.com/mostly-ai/public-demo-data/raw/refs/heads/dev/census"
@@ -73,8 +74,11 @@ from pathlib import Path
73
74
  import pandas as pd
74
75
  from mostlyai import engine
75
76
 
76
- # set up workspace
77
+ engine.init_logging()
78
+
79
+ # set up workspace and default logging
77
80
  ws = Path("ws-tabular-sequential")
81
+ engine.init_logging()
78
82
 
79
83
  # load original data
80
84
  url = "https://github.com/mostly-ai/public-demo-data/raw/refs/heads/dev/baseball"
@@ -107,8 +111,9 @@ from pathlib import Path
107
111
  import pandas as pd
108
112
  from mostlyai import engine
109
113
 
110
- # set up workspace
114
+ # init workspace and logging
111
115
  ws = Path("ws-language-flat")
116
+ engine.init_logging()
112
117
 
113
118
  # load original data
114
119
  trn_df = pd.read_parquet("https://github.com/mostly-ai/public-demo-data/raw/refs/heads/dev/headlines/headlines.parquet")
@@ -13,6 +13,7 @@
13
13
  # limitations under the License.
14
14
  import warnings
15
15
 
16
+ from mostlyai.engine.logging import init_logging
16
17
  from mostlyai.engine.splitting import split
17
18
  from mostlyai.engine.analysis import analyze
18
19
  from mostlyai.engine.training import train
@@ -20,8 +21,8 @@ from mostlyai.engine.encoding import encode
20
21
  from mostlyai.engine.generation import generate
21
22
 
22
23
 
23
- __all__ = ["split", "analyze", "encode", "train", "generate"]
24
- __version__ = "1.0.1"
24
+ __all__ = ["split", "analyze", "encode", "train", "generate", "init_logging"]
25
+ __version__ = "1.0.3"
25
26
 
26
27
  # suppress specific warning related to os.fork() in multi-threaded processes
27
28
  warnings.filterwarnings("ignore", category=DeprecationWarning, message=".*multi-threaded.*fork.*")
@@ -210,7 +210,7 @@ def generate(
210
210
  False # needed for gated hf models that are not sharded, otherwise GatedRepoError in vLLM
211
211
  )
212
212
  # set the default env var so that we don't pass it explicitly to vLLM
213
- os.environ["HF_TOKEN"] = os.getenv("MOSTLY_HUGGING_FACE_TOKEN", "")
213
+ os.environ["HF_TOKEN"] = os.getenv("MOSTLY_HUGGING_FACE_TOKEN") or os.getenv("HF_TOKEN", "")
214
214
 
215
215
  is_peft_adapter = (workspace.model_path / "adapter_config.json").exists()
216
216
  if is_peft_adapter and device.type == "cuda":
@@ -168,21 +168,6 @@ class Workspace:
168
168
  self.generated_data_path = Path(self._ws_path) / Path(*generated_data)
169
169
  self.generated_data = make_path_desc(parts=generated_data, fetch_multiple=fetch_part_parquets)
170
170
 
171
- # Report-related
172
- self.report_ctx_data_path = self._ws_path / "report-ctx-data"
173
- self.report_ctx_data = make_path_desc(
174
- parts=["report-ctx-data"],
175
- fetch_multiple=fetch_part_parquets,
176
- )
177
- self.report_trn_ctx_data = make_path_desc(
178
- parts=["report-ctx-data"],
179
- fetch_multiple=fetch_part_trn_parquets,
180
- )
181
- self.report_val_ctx_data = make_path_desc(
182
- parts=["report-ctx-data"],
183
- fetch_multiple=fetch_part_val_parquets,
184
- )
185
-
186
171
 
187
172
  def ensure_workspace_dir(workspace_dir: str | Path) -> Path:
188
173
  workspace_dir = Path(workspace_dir)
@@ -0,0 +1,34 @@
1
+ # Copyright 2025 MOSTLY AI
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ import sys
16
+ import logging
17
+
18
+ _LOG = logging.getLogger(__name__.rsplit(".", 1)[0]) # get the logger with the root module name (mostlyai.engine)
19
+
20
+
21
+ def init_logging() -> None:
22
+ """
23
+ Initialize the logging configuration. Either log to stdout or to a file.
24
+ """
25
+
26
+ # log to stdout
27
+ handler = logging.StreamHandler(stream=sys.stdout)
28
+ handler.setFormatter(logging.Formatter("[%(asctime)s] %(levelname)-7s: %(message)s"))
29
+ handler.setLevel(logging.INFO)
30
+
31
+ if not _LOG.hasHandlers():
32
+ _LOG.addHandler(handler)
33
+ _LOG.setLevel(logging.INFO)
34
+ _LOG.propagate = False
@@ -1,9 +1,9 @@
1
1
  [project]
2
2
  name = "mostlyai-engine"
3
- version = "1.0.1"
4
- description = "Synthetic Data - Engine"
3
+ version = "1.0.3"
4
+ description = "Synthetic Data Engine"
5
5
  authors = [{ name = "MOSTLY AI", email = "dev@mostly.ai" }]
6
- requires-python = ">=3.10,<3.13"
6
+ requires-python = ">=3.10"
7
7
  readme = "README.md"
8
8
  license = "Apache-2.0"
9
9
  classifiers = [
@@ -14,6 +14,10 @@ classifiers = [
14
14
  "Intended Audience :: Financial and Insurance Industry",
15
15
  "Intended Audience :: Healthcare Industry",
16
16
  "Intended Audience :: Telecommunications Industry",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
17
21
  "License :: OSI Approved :: Apache Software License",
18
22
  "Operating System :: OS Independent",
19
23
  "Topic :: Software Development :: Libraries",
@@ -24,7 +28,6 @@ dependencies = [
24
28
  "setuptools>=75.0.0,<76",
25
29
  "numpy>=1.26.3,<2",
26
30
  "pandas~=2.2.0",
27
- "torch==2.5.1; sys_platform == 'darwin'",
28
31
  "pyarrow>=16.0.0",
29
32
  "joblib>=1.3.0,<2",
30
33
  "psutil>=5.9.5,<6", # upgrade when colab psutil is updated
@@ -37,17 +40,18 @@ dependencies = [
37
40
  "formatron>=0.4.11,<0.5",
38
41
  "json-repair>=0.30.0,<0.31",
39
42
  "rich>=13.9.4,<14",
43
+ "torch>=2.5.1; sys_platform == 'darwin'",
40
44
  ]
41
45
 
42
46
  [project.optional-dependencies]
43
47
  gpu = [
44
- "torch==2.5.1",
48
+ "torch>=2.5.1",
45
49
  "bitsandbytes>=0.43.3,<0.44",
46
50
  "vllm>=0.6.4,<0.7",
47
51
  ]
48
52
  cpu = [
49
- "torch==2.5.1+cpu; sys_platform != 'darwin'",
50
- "torch==2.5.1; sys_platform == 'darwin'"
53
+ "torch==2.5.1+cpu; sys_platform == 'linux'",
54
+ "torch>=2.5.1; sys_platform != 'linux'",
51
55
  ]
52
56
 
53
57
  [dependency-groups]
@@ -69,9 +73,9 @@ docs = [
69
73
  ]
70
74
 
71
75
  [project.urls]
72
- Homepage = "https://github.com/mostly-ai/mostlyai-engine"
73
- Documentation = "https://mostly-ai.github.io/mostlyai-engine/"
74
- Source = "https://github.com/mostly-ai/mostlyai-engine"
76
+ homepage = "https://github.com/mostly-ai/mostlyai-engine"
77
+ repository = "https://github.com/mostly-ai/mostlyai-engine"
78
+ documentation = "https://mostly-ai.github.io/mostlyai-engine/"
75
79
 
76
80
  [tool.uv]
77
81
  default-groups = ["test", "dev", "docs"]
@@ -89,7 +93,7 @@ explicit = true
89
93
 
90
94
  [tool.uv.sources]
91
95
  torch = [
92
- { index = "pytorch-cpu", extra = "cpu", marker = "sys_platform != 'darwin'" },
96
+ { index = "pytorch-cpu", extra = "cpu", marker = "sys_platform == 'linux'"},
93
97
  ]
94
98
 
95
99
  [tool.hatch.build.targets.sdist]
File without changes