mostlyai-engine 1.0.2__tar.gz → 1.0.4__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_engine-1.0.2 → mostlyai_engine-1.0.4}/PKG-INFO +6 -6
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/__init__.py +1 -1
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/engine/vllm_engine.py +4 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/generation.py +16 -2
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/pyproject.toml +7 -7
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/.gitignore +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/LICENSE +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/README.md +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_common.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_dtypes.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/__init__.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/language/__init__.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/language/text.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/tabular/__init__.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/tabular/categorical.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/tabular/character.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/tabular/datetime.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/tabular/itt.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/tabular/lat_long.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/tabular/numeric.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/__init__.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/common.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/encoding.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/engine/__init__.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/engine/base.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/engine/hf_engine.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/formatron_utils.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/lstm.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/tokenizer_utils.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/training.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_memory.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_tabular/__init__.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_tabular/argn.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_tabular/common.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_tabular/encoding.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_tabular/fairness.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_tabular/generation.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_tabular/training.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_training_utils.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_workspace.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/analysis.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/domain.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/encoding.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/generation.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/logging.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/splitting.py +0 -0
- {mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/training.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mostlyai-engine
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary: Synthetic Data
|
|
3
|
+
Version: 1.0.4
|
|
4
|
+
Summary: Synthetic Data Engine
|
|
5
5
|
Project-URL: homepage, https://github.com/mostly-ai/mostlyai-engine
|
|
6
6
|
Project-URL: repository, https://github.com/mostly-ai/mostlyai-engine
|
|
7
7
|
Project-URL: documentation, https://mostly-ai.github.io/mostlyai-engine/
|
|
@@ -38,14 +38,14 @@ Requires-Dist: pyarrow>=16.0.0
|
|
|
38
38
|
Requires-Dist: rich<14,>=13.9.4
|
|
39
39
|
Requires-Dist: setuptools<76,>=75.0.0
|
|
40
40
|
Requires-Dist: tokenizers<0.21,>=0.20.1
|
|
41
|
-
Requires-Dist: torch
|
|
41
|
+
Requires-Dist: torch>=2.5.1; sys_platform == 'darwin'
|
|
42
42
|
Requires-Dist: transformers<5,>=4.45.2
|
|
43
43
|
Provides-Extra: cpu
|
|
44
|
-
Requires-Dist: torch==2.5.1+cpu; (sys_platform
|
|
45
|
-
Requires-Dist: torch
|
|
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'
|
|
46
46
|
Provides-Extra: gpu
|
|
47
47
|
Requires-Dist: bitsandbytes<0.44,>=0.43.3; extra == 'gpu'
|
|
48
|
-
Requires-Dist: torch
|
|
48
|
+
Requires-Dist: torch>=2.5.1; extra == 'gpu'
|
|
49
49
|
Requires-Dist: vllm<0.7,>=0.6.4; extra == 'gpu'
|
|
50
50
|
Description-Content-Type: text/markdown
|
|
51
51
|
|
|
@@ -22,7 +22,7 @@ from mostlyai.engine.generation import generate
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
__all__ = ["split", "analyze", "encode", "train", "generate", "init_logging"]
|
|
25
|
-
__version__ = "1.0.
|
|
25
|
+
__version__ = "1.0.4"
|
|
26
26
|
|
|
27
27
|
# suppress specific warning related to os.fork() in multi-threaded processes
|
|
28
28
|
warnings.filterwarnings("ignore", category=DeprecationWarning, message=".*multi-threaded.*fork.*")
|
{mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/engine/vllm_engine.py
RENAMED
|
@@ -16,6 +16,8 @@ import contextlib
|
|
|
16
16
|
from os import PathLike
|
|
17
17
|
import time
|
|
18
18
|
import typing
|
|
19
|
+
|
|
20
|
+
from mostlyai.engine._language.common import is_bf16_supported
|
|
19
21
|
from mostlyai.engine._language.engine.base import EngineMetrics, LanguageEngine
|
|
20
22
|
import torch
|
|
21
23
|
from formatron.config import EngineGenerationConfig
|
|
@@ -105,8 +107,10 @@ class VLLMEngine(LanguageEngine):
|
|
|
105
107
|
device=device.type,
|
|
106
108
|
max_model_len=min(config_max_model_len, self.tokenizer_max_length + max_new_tokens),
|
|
107
109
|
enable_lora=True,
|
|
110
|
+
dtype=torch.bfloat16 if is_bf16_supported(device) else torch.float16,
|
|
108
111
|
# enforce_eager=True, # results in big slowdown, but is needed when running pytest locally
|
|
109
112
|
swap_space=0,
|
|
113
|
+
disable_log_stats=True,
|
|
110
114
|
)
|
|
111
115
|
self._base_logits_processors = [MaskInvalidIndicesLogitsProcessor(self.llm.get_tokenizer())]
|
|
112
116
|
self.tokenizer = AutoTokenizer.from_pretrained(
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
+
import contextlib
|
|
15
16
|
import json
|
|
16
17
|
import os
|
|
17
18
|
|
|
@@ -27,6 +28,7 @@ from transformers import (
|
|
|
27
28
|
PreTrainedTokenizerBase,
|
|
28
29
|
)
|
|
29
30
|
|
|
31
|
+
|
|
30
32
|
from mostlyai.engine._common import (
|
|
31
33
|
persist_data_part,
|
|
32
34
|
FixedSizeSampleBuffer,
|
|
@@ -123,7 +125,19 @@ def generate(
|
|
|
123
125
|
):
|
|
124
126
|
_LOG.info("GENERATE_LANGUAGE started")
|
|
125
127
|
t0_ = time.time()
|
|
126
|
-
|
|
128
|
+
os.environ["VLLM_LOGGING_LEVEL"] = "WARNING"
|
|
129
|
+
os.environ["VLLM_NO_DEPRECATION_WARNING"] = "1"
|
|
130
|
+
|
|
131
|
+
@contextlib.contextmanager
|
|
132
|
+
def tqdm_disabled():
|
|
133
|
+
tqdm_disable = os.getenv("TQDM_DISABLE")
|
|
134
|
+
os.environ["TQDM_DISABLE"] = "1"
|
|
135
|
+
try:
|
|
136
|
+
yield
|
|
137
|
+
finally:
|
|
138
|
+
os.environ["TQDM_DISABLE"] = tqdm_disable if tqdm_disable is not None else ""
|
|
139
|
+
|
|
140
|
+
with ProgressCallbackWrapper(update_progress) as progress, tqdm_disabled():
|
|
127
141
|
device = (
|
|
128
142
|
torch.device(device)
|
|
129
143
|
if device is not None
|
|
@@ -210,7 +224,7 @@ def generate(
|
|
|
210
224
|
False # needed for gated hf models that are not sharded, otherwise GatedRepoError in vLLM
|
|
211
225
|
)
|
|
212
226
|
# 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", "")
|
|
227
|
+
os.environ["HF_TOKEN"] = os.getenv("MOSTLY_HUGGING_FACE_TOKEN") or os.getenv("HF_TOKEN", "")
|
|
214
228
|
|
|
215
229
|
is_peft_adapter = (workspace.model_path / "adapter_config.json").exists()
|
|
216
230
|
if is_peft_adapter and device.type == "cuda":
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "mostlyai-engine"
|
|
3
|
-
version = "1.0.
|
|
4
|
-
description = "Synthetic Data
|
|
3
|
+
version = "1.0.4"
|
|
4
|
+
description = "Synthetic Data Engine"
|
|
5
5
|
authors = [{ name = "MOSTLY AI", email = "dev@mostly.ai" }]
|
|
6
6
|
requires-python = ">=3.10"
|
|
7
7
|
readme = "README.md"
|
|
@@ -28,7 +28,6 @@ dependencies = [
|
|
|
28
28
|
"setuptools>=75.0.0,<76",
|
|
29
29
|
"numpy>=1.26.3,<2",
|
|
30
30
|
"pandas~=2.2.0",
|
|
31
|
-
"torch==2.5.1; sys_platform == 'darwin'",
|
|
32
31
|
"pyarrow>=16.0.0",
|
|
33
32
|
"joblib>=1.3.0,<2",
|
|
34
33
|
"psutil>=5.9.5,<6", # upgrade when colab psutil is updated
|
|
@@ -41,17 +40,18 @@ dependencies = [
|
|
|
41
40
|
"formatron>=0.4.11,<0.5",
|
|
42
41
|
"json-repair>=0.30.0,<0.31",
|
|
43
42
|
"rich>=13.9.4,<14",
|
|
43
|
+
"torch>=2.5.1; sys_platform == 'darwin'",
|
|
44
44
|
]
|
|
45
45
|
|
|
46
46
|
[project.optional-dependencies]
|
|
47
47
|
gpu = [
|
|
48
|
-
"torch
|
|
48
|
+
"torch>=2.5.1",
|
|
49
49
|
"bitsandbytes>=0.43.3,<0.44",
|
|
50
50
|
"vllm>=0.6.4,<0.7",
|
|
51
51
|
]
|
|
52
52
|
cpu = [
|
|
53
|
-
"torch==2.5.1+cpu; sys_platform
|
|
54
|
-
"torch
|
|
53
|
+
"torch==2.5.1+cpu; sys_platform == 'linux'",
|
|
54
|
+
"torch>=2.5.1; sys_platform != 'linux'",
|
|
55
55
|
]
|
|
56
56
|
|
|
57
57
|
[dependency-groups]
|
|
@@ -93,7 +93,7 @@ explicit = true
|
|
|
93
93
|
|
|
94
94
|
[tool.uv.sources]
|
|
95
95
|
torch = [
|
|
96
|
-
{ index = "pytorch-cpu", extra = "cpu", marker = "sys_platform
|
|
96
|
+
{ index = "pytorch-cpu", extra = "cpu", marker = "sys_platform == 'linux'"},
|
|
97
97
|
]
|
|
98
98
|
|
|
99
99
|
[tool.hatch.build.targets.sdist]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/language/__init__.py
RENAMED
|
File without changes
|
{mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/language/text.py
RENAMED
|
File without changes
|
{mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/tabular/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/tabular/character.py
RENAMED
|
File without changes
|
{mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/tabular/datetime.py
RENAMED
|
File without changes
|
{mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/tabular/itt.py
RENAMED
|
File without changes
|
{mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/tabular/lat_long.py
RENAMED
|
File without changes
|
{mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_encoding_types/tabular/numeric.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/engine/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/engine/hf_engine.py
RENAMED
|
File without changes
|
{mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/formatron_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
{mostlyai_engine-1.0.2 → mostlyai_engine-1.0.4}/mostlyai/engine/_language/tokenizer_utils.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
|
|
File without changes
|