mostlyai 0.3.5__tar.gz → 0.3.7__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-0.3.5 → mostlyai-0.3.7}/PKG-INFO +12 -5
- {mostlyai-0.3.5 → mostlyai-0.3.7}/README.md +8 -1
- mostlyai-0.3.7/mostlyai/__init__.py +4 -0
- {mostlyai-0.3.5 → mostlyai-0.3.7}/mostlyai/api.py +151 -158
- {mostlyai-0.3.5 → mostlyai-0.3.7}/mostlyai/generators.py +7 -5
- {mostlyai-0.3.5 → mostlyai-0.3.7}/mostlyai/model.py +173 -77
- {mostlyai-0.3.5 → mostlyai-0.3.7}/mostlyai/synthetic_datasets.py +29 -27
- mostlyai-0.3.7/mostlyai/utils.py +275 -0
- {mostlyai-0.3.5 → mostlyai-0.3.7}/pyproject.toml +13 -13
- mostlyai-0.3.5/mostlyai/__init__.py +0 -1
- mostlyai-0.3.5/mostlyai/utils.py +0 -157
- {mostlyai-0.3.5 → mostlyai-0.3.7}/LICENSE +0 -0
- {mostlyai-0.3.5 → mostlyai-0.3.7}/mostlyai/base.py +0 -0
- {mostlyai-0.3.5 → mostlyai-0.3.7}/mostlyai/connectors.py +0 -0
- {mostlyai-0.3.5 → mostlyai-0.3.7}/mostlyai/exceptions.py +0 -0
- {mostlyai-0.3.5 → mostlyai-0.3.7}/mostlyai/shares.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mostlyai
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.7
|
|
4
4
|
Summary: The official Python client for the MOSTLY AI platform.
|
|
5
5
|
Home-page: https://app.mostly.ai/
|
|
6
6
|
License: Proprietary
|
|
@@ -13,11 +13,11 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
-
Requires-Dist: httpx (>=0.25.
|
|
16
|
+
Requires-Dist: httpx (>=0.25.0)
|
|
17
17
|
Requires-Dist: pandas (>=1.5.3,<3.0.0)
|
|
18
|
-
Requires-Dist: pyarrow (>=14.0.
|
|
18
|
+
Requires-Dist: pyarrow (>=14.0.0)
|
|
19
19
|
Requires-Dist: pydantic (>=2.4.2,<3.0.0)
|
|
20
|
-
Requires-Dist: rich (>=13.7.0
|
|
20
|
+
Requires-Dist: rich (>=13.7.0)
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
22
|
|
|
23
23
|
# MOSTLY AI - GenAI for Tabular Data
|
|
@@ -44,7 +44,7 @@ pip install mostlyai
|
|
|
44
44
|
## Basic Usage
|
|
45
45
|
```python
|
|
46
46
|
from mostlyai import MostlyAI
|
|
47
|
-
mostly = MostlyAI(api_key='your_api_key')
|
|
47
|
+
mostly = MostlyAI(api_key='your_api_key')
|
|
48
48
|
g = mostly.train(data) # train a generator on your data
|
|
49
49
|
sd = mostly.generate(g) # generate a synthetic dataset
|
|
50
50
|
syn = sd.data() # consume synthetic as pd.DataFrame
|
|
@@ -113,6 +113,13 @@ sd.data()
|
|
|
113
113
|
sd.download(file, format)
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
+
### Synthetic Probes
|
|
117
|
+
```python
|
|
118
|
+
sp = mostly.probe(g, seed=seed)
|
|
119
|
+
sp = mostly.probe(g, size=size)
|
|
120
|
+
sp = mostly.probe(g, config=config)
|
|
121
|
+
```
|
|
122
|
+
|
|
116
123
|
### Sharing
|
|
117
124
|
|
|
118
125
|
```python
|
|
@@ -22,7 +22,7 @@ pip install mostlyai
|
|
|
22
22
|
## Basic Usage
|
|
23
23
|
```python
|
|
24
24
|
from mostlyai import MostlyAI
|
|
25
|
-
mostly = MostlyAI(api_key='your_api_key')
|
|
25
|
+
mostly = MostlyAI(api_key='your_api_key')
|
|
26
26
|
g = mostly.train(data) # train a generator on your data
|
|
27
27
|
sd = mostly.generate(g) # generate a synthetic dataset
|
|
28
28
|
syn = sd.data() # consume synthetic as pd.DataFrame
|
|
@@ -91,6 +91,13 @@ sd.data()
|
|
|
91
91
|
sd.download(file, format)
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
+
### Synthetic Probes
|
|
95
|
+
```python
|
|
96
|
+
sp = mostly.probe(g, seed=seed)
|
|
97
|
+
sp = mostly.probe(g, size=size)
|
|
98
|
+
sp = mostly.probe(g, config=config)
|
|
99
|
+
```
|
|
100
|
+
|
|
94
101
|
### Sharing
|
|
95
102
|
|
|
96
103
|
```python
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
|
-
from typing import Any, Optional, Union
|
|
2
|
+
from typing import Any, Optional, Union, Literal
|
|
3
3
|
|
|
4
4
|
import pandas as pd
|
|
5
5
|
import rich
|
|
@@ -13,13 +13,18 @@ from mostlyai.model import (
|
|
|
13
13
|
Generator,
|
|
14
14
|
PermissionLevel,
|
|
15
15
|
ProgressStatus,
|
|
16
|
+
SyntheticDataset,
|
|
16
17
|
)
|
|
17
18
|
from mostlyai.shares import _MostlySharesClient
|
|
18
|
-
from mostlyai.synthetic_datasets import
|
|
19
|
+
from mostlyai.synthetic_datasets import (
|
|
20
|
+
_MostlySyntheticDatasetsClient,
|
|
21
|
+
_MostlySyntheticProbesClient,
|
|
22
|
+
)
|
|
19
23
|
from mostlyai.utils import (
|
|
20
24
|
ShareableResource,
|
|
21
|
-
_get_subject_table_names,
|
|
22
25
|
_read_table_from_path,
|
|
26
|
+
_harmonize_sd_config,
|
|
27
|
+
Seed,
|
|
23
28
|
)
|
|
24
29
|
|
|
25
30
|
|
|
@@ -52,6 +57,7 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
52
57
|
self.connectors = _MostlyConnectorsClient(**client_kwargs)
|
|
53
58
|
self.generators = _MostlyGeneratorsClient(**client_kwargs)
|
|
54
59
|
self.synthetic_datasets = _MostlySyntheticDatasetsClient(**client_kwargs)
|
|
60
|
+
self.synthetic_probes = _MostlySyntheticProbesClient(**client_kwargs)
|
|
55
61
|
self.shares = _MostlySharesClient(**client_kwargs)
|
|
56
62
|
|
|
57
63
|
def connect(self, config: dict[str, Any]) -> Connector:
|
|
@@ -64,9 +70,8 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
64
70
|
The structures of the `config`, `secrets` and `ssl` parameters depend on the connector `type`:
|
|
65
71
|
|
|
66
72
|
- Cloud storage:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
type: AZURE_STORAGE
|
|
73
|
+
```yaml
|
|
74
|
+
- type: AZURE_STORAGE
|
|
70
75
|
config:
|
|
71
76
|
accountName: string
|
|
72
77
|
clientId: string (required for auth via service principal)
|
|
@@ -74,126 +79,106 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
74
79
|
secrets:
|
|
75
80
|
accountKey: string (required for regular auth)
|
|
76
81
|
clientSecret: string (required for auth via service principal)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
```yaml
|
|
80
|
-
type: GOOGLE_CLOUD_STORAGE
|
|
82
|
+
|
|
83
|
+
- type: GOOGLE_CLOUD_STORAGE
|
|
81
84
|
config:
|
|
82
85
|
secrets:
|
|
83
86
|
keyFile: string
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
```yaml
|
|
87
|
-
type: S3_STORAGE
|
|
87
|
+
|
|
88
|
+
- type: S3_STORAGE
|
|
88
89
|
config:
|
|
89
90
|
accessKey: string
|
|
91
|
+
endpointUrl: string (only needed for S3-compatible storage services other than AWS)
|
|
90
92
|
secrets:
|
|
91
93
|
secretKey: string
|
|
92
|
-
|
|
94
|
+
```
|
|
93
95
|
- Database:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
password: string
|
|
181
|
-
ssl:
|
|
182
|
-
rootCertificate: string
|
|
183
|
-
sslCertificate: string
|
|
184
|
-
sslCertificateKey: string
|
|
185
|
-
```
|
|
186
|
-
- \t
|
|
187
|
-
```yaml
|
|
188
|
-
type: SNOWFLAKE
|
|
189
|
-
config:
|
|
190
|
-
account: string
|
|
191
|
-
username: string
|
|
192
|
-
warehouse: string, default: COMPUTE_WH
|
|
193
|
-
database: string
|
|
194
|
-
secrets:
|
|
195
|
-
password: string
|
|
196
|
-
```
|
|
96
|
+
```yaml
|
|
97
|
+
- type: BIGQUERY
|
|
98
|
+
config:
|
|
99
|
+
secrets:
|
|
100
|
+
keyFile: string
|
|
101
|
+
|
|
102
|
+
- type: DATABRICKS
|
|
103
|
+
config:
|
|
104
|
+
host: string
|
|
105
|
+
httpPath: string
|
|
106
|
+
catalog: string
|
|
107
|
+
clientId: string (required for auth via service principal)
|
|
108
|
+
tenantId: string (required for auth via service principal)
|
|
109
|
+
secrets:
|
|
110
|
+
accessToken: string (required for regular auth)
|
|
111
|
+
clientSecret: string (required for auth via service principal)
|
|
112
|
+
|
|
113
|
+
- type: HIVE
|
|
114
|
+
config:
|
|
115
|
+
host: string
|
|
116
|
+
port: integer, default: 10000
|
|
117
|
+
username: string (required for regular auth)
|
|
118
|
+
kerberos_enabled: boolean, default: false
|
|
119
|
+
kerberos_principal: string (required if kerberos_enabled)
|
|
120
|
+
kerberos_krb5_conf: string (required if kerberos_enabled)
|
|
121
|
+
secrets:
|
|
122
|
+
password: string (required for regular auth)
|
|
123
|
+
kerberos_keytab: base64-encoded string (required if kerberos_enabled)
|
|
124
|
+
|
|
125
|
+
- type: MARIADB
|
|
126
|
+
config:
|
|
127
|
+
host: string
|
|
128
|
+
port: integer, default: 3306
|
|
129
|
+
username: string
|
|
130
|
+
secrets:
|
|
131
|
+
password: string
|
|
132
|
+
|
|
133
|
+
- type: MSSQL
|
|
134
|
+
config:
|
|
135
|
+
host: string
|
|
136
|
+
port: integer, default: 1433
|
|
137
|
+
username: string
|
|
138
|
+
database: string
|
|
139
|
+
secrets:
|
|
140
|
+
password: string
|
|
141
|
+
|
|
142
|
+
- type: MYSQL
|
|
143
|
+
config:
|
|
144
|
+
host: string
|
|
145
|
+
port: integer, default: 3306
|
|
146
|
+
username: string
|
|
147
|
+
secrets:
|
|
148
|
+
password: string
|
|
149
|
+
|
|
150
|
+
- type: ORACLE
|
|
151
|
+
config:
|
|
152
|
+
host: string
|
|
153
|
+
port: integer, default: 1521
|
|
154
|
+
username: string
|
|
155
|
+
connectionType: enum {SID, SERVICE_NAME}, default: SID
|
|
156
|
+
database: string, default: ORCL
|
|
157
|
+
secrets:
|
|
158
|
+
password: string
|
|
159
|
+
|
|
160
|
+
- type: POSTGRES
|
|
161
|
+
config:
|
|
162
|
+
host: string
|
|
163
|
+
port: integer, default: 5432
|
|
164
|
+
username: string
|
|
165
|
+
database: string
|
|
166
|
+
secrets:
|
|
167
|
+
password: string
|
|
168
|
+
ssl:
|
|
169
|
+
rootCertificate: string
|
|
170
|
+
sslCertificate: string
|
|
171
|
+
sslCertificateKey: string
|
|
172
|
+
|
|
173
|
+
- type: SNOWFLAKE
|
|
174
|
+
config:
|
|
175
|
+
account: string
|
|
176
|
+
username: string
|
|
177
|
+
warehouse: string, default: COMPUTE_WH
|
|
178
|
+
database: string
|
|
179
|
+
secrets:
|
|
180
|
+
password: string
|
|
181
|
+
```
|
|
197
182
|
|
|
198
183
|
:return: The created connector.
|
|
199
184
|
"""
|
|
@@ -210,7 +195,8 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
210
195
|
name: Optional[str] = None,
|
|
211
196
|
start: bool = True,
|
|
212
197
|
wait: bool = True,
|
|
213
|
-
|
|
198
|
+
progress_bar: bool = True,
|
|
199
|
+
) -> Generator:
|
|
214
200
|
"""
|
|
215
201
|
Train a generator
|
|
216
202
|
|
|
@@ -219,6 +205,7 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
219
205
|
:param name: Optional. The name of the generator.
|
|
220
206
|
:param start: If true, then training is started right away. Default: true.
|
|
221
207
|
:param wait: If true, then the function only returns once training has finished. Default: true.
|
|
208
|
+
:param progress_bar: If true, then the progress bar will be displayed, in case of wait=True
|
|
222
209
|
:return: The created generator.
|
|
223
210
|
"""
|
|
224
211
|
if data is not None and config is not None:
|
|
@@ -244,7 +231,7 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
244
231
|
g.training.start()
|
|
245
232
|
rich.print("Started generator training")
|
|
246
233
|
if start and wait:
|
|
247
|
-
g = g.training.wait()
|
|
234
|
+
g = g.training.wait(progress_bar=progress_bar)
|
|
248
235
|
if g.training_status == ProgressStatus.done:
|
|
249
236
|
rich.print(
|
|
250
237
|
":tada: [bold green]Your generator is ready![/] "
|
|
@@ -257,16 +244,15 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
257
244
|
self,
|
|
258
245
|
generator: Union[Generator, str, None] = None,
|
|
259
246
|
size: Union[int, dict[str, int], None] = None,
|
|
260
|
-
seed: Union[
|
|
261
|
-
pd.DataFrame, str, Path, dict[str, Union[pd.DataFrame, str, Path]], None
|
|
262
|
-
] = None,
|
|
247
|
+
seed: Union[Seed, dict[str, Seed], None] = None,
|
|
263
248
|
config: Union[dict, None] = None,
|
|
264
249
|
name: Optional[str] = None,
|
|
265
250
|
start: bool = True,
|
|
266
251
|
wait: bool = True,
|
|
267
|
-
|
|
252
|
+
progress_bar: bool = True,
|
|
253
|
+
) -> SyntheticDataset:
|
|
268
254
|
"""
|
|
269
|
-
|
|
255
|
+
Generate synthetic data
|
|
270
256
|
|
|
271
257
|
:param generator: The generator instance or its UUID, that is to be used for generating synthetic data.
|
|
272
258
|
:param config: The configuration parameters of the synthetic dataset to be created. See SyntheticDataset.config for the structure of the parameters.
|
|
@@ -275,40 +261,17 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
275
261
|
:param name: Optional. The name of the synthetic dataset.
|
|
276
262
|
:param start: If true, then generation is started right away. Default: true.
|
|
277
263
|
:param wait: If true, then the function only returns once generation has finished. Default: true.
|
|
264
|
+
:param progress_bar: If true, then the progress bar will be displayed, in case of wait=True
|
|
278
265
|
:return: The created synthetic dataset.
|
|
279
266
|
"""
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
config
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
"Either a generator or a configuration with a generatorId must be provided."
|
|
289
|
-
)
|
|
290
|
-
|
|
291
|
-
if "tables" not in config:
|
|
292
|
-
g = self.generators.get(config["generatorId"])
|
|
293
|
-
subject_tables = _get_subject_table_names(g.config())
|
|
294
|
-
config["tables"] = [
|
|
295
|
-
{
|
|
296
|
-
"name": table,
|
|
297
|
-
"configuration": {
|
|
298
|
-
"sampleSize": (
|
|
299
|
-
size.get(table) if isinstance(size, dict) else size
|
|
300
|
-
),
|
|
301
|
-
"sampleSeedData": (
|
|
302
|
-
seed.get(table) if isinstance(seed, dict) else seed
|
|
303
|
-
),
|
|
304
|
-
},
|
|
305
|
-
}
|
|
306
|
-
for table in subject_tables
|
|
307
|
-
]
|
|
308
|
-
|
|
309
|
-
if name is not None:
|
|
310
|
-
config |= {"name": name}
|
|
311
|
-
|
|
267
|
+
config = _harmonize_sd_config(
|
|
268
|
+
generator,
|
|
269
|
+
get_generator=self.generators.get,
|
|
270
|
+
size=size,
|
|
271
|
+
seed=seed,
|
|
272
|
+
config=config,
|
|
273
|
+
name=name,
|
|
274
|
+
)
|
|
312
275
|
sd = self.synthetic_datasets.create(config)
|
|
313
276
|
rich.print(
|
|
314
277
|
f"Created synthetic dataset "
|
|
@@ -320,7 +283,7 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
320
283
|
sd.generation.start()
|
|
321
284
|
rich.print("Started synthetic dataset generation")
|
|
322
285
|
if start and wait:
|
|
323
|
-
sd = sd.generation.wait()
|
|
286
|
+
sd = sd.generation.wait(progress_bar=progress_bar)
|
|
324
287
|
if sd.generation_status == ProgressStatus.done:
|
|
325
288
|
rich.print(
|
|
326
289
|
":tada: [bold green]Your synthetic dataset is ready![/] "
|
|
@@ -329,6 +292,36 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
329
292
|
)
|
|
330
293
|
return sd
|
|
331
294
|
|
|
295
|
+
def probe(
|
|
296
|
+
self,
|
|
297
|
+
generator: Union[Generator, str, None] = None,
|
|
298
|
+
size: Union[int, dict[str, int], None] = None,
|
|
299
|
+
seed: Union[Seed, dict[str, Seed], None] = None,
|
|
300
|
+
config: Union[dict, None] = None,
|
|
301
|
+
return_type: Literal["auto", "dict"] = "auto",
|
|
302
|
+
) -> Union[pd.DataFrame, dict[str, pd.DataFrame]]:
|
|
303
|
+
"""
|
|
304
|
+
Probe a generator
|
|
305
|
+
|
|
306
|
+
:param generator: The generator instance or its UUID, that is to be used for generating synthetic data.
|
|
307
|
+
:param config: The configuration parameters of the synthetic dataset to be created. See SyntheticDataset.config for the structure of the parameters.
|
|
308
|
+
:param size: Optional. Either a single integer, or a dictionary of integers. Used for specifying the sample_size of the subject table(s).
|
|
309
|
+
:param seed: Optional. Either a single pandas DataFrame data, or a path to a CSV or PARQUET file, or list of samples, or a dictionary of those. Used for seeding the subject table(s).
|
|
310
|
+
:return: The created synthetic probe.
|
|
311
|
+
"""
|
|
312
|
+
config = _harmonize_sd_config(
|
|
313
|
+
generator,
|
|
314
|
+
get_generator=self.generators.get,
|
|
315
|
+
size=size,
|
|
316
|
+
seed=seed,
|
|
317
|
+
config=config,
|
|
318
|
+
)
|
|
319
|
+
dfs = self.synthetic_probes.create(config)
|
|
320
|
+
if return_type == "auto" and len(dfs) == 1:
|
|
321
|
+
return list(dfs.values())[0]
|
|
322
|
+
else:
|
|
323
|
+
return dfs
|
|
324
|
+
|
|
332
325
|
# SHARES
|
|
333
326
|
|
|
334
327
|
def share(
|
|
@@ -6,7 +6,7 @@ import pandas as pd
|
|
|
6
6
|
from mostlyai.base import DELETE, GET, PATCH, POST, Paginator, _MostlyBaseClient
|
|
7
7
|
from mostlyai.model import Generator, JobProgress
|
|
8
8
|
from mostlyai.shares import _MostlySharesMixin
|
|
9
|
-
from mostlyai.utils import
|
|
9
|
+
from mostlyai.utils import _convert_to_base64, _job_wait, _read_table_from_path
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class _MostlyGeneratorsClient(_MostlyBaseClient, _MostlySharesMixin):
|
|
@@ -61,12 +61,12 @@ class _MostlyGeneratorsClient(_MostlyBaseClient, _MostlySharesMixin):
|
|
|
61
61
|
if "data" in table and table["data"] is not None:
|
|
62
62
|
if isinstance(table["data"], (str, Path)):
|
|
63
63
|
name, df = _read_table_from_path(table["data"])
|
|
64
|
-
table["data"] =
|
|
64
|
+
table["data"] = _convert_to_base64(df)
|
|
65
65
|
if "name" not in table:
|
|
66
66
|
table["name"] = name
|
|
67
67
|
del df
|
|
68
68
|
elif isinstance(table["data"], pd.DataFrame):
|
|
69
|
-
table["data"] =
|
|
69
|
+
table["data"] = _convert_to_base64(table["data"])
|
|
70
70
|
else:
|
|
71
71
|
raise ValueError("data must be a DataFrame or a file path")
|
|
72
72
|
|
|
@@ -108,7 +108,9 @@ class _MostlyGeneratorsClient(_MostlyBaseClient, _MostlySharesMixin):
|
|
|
108
108
|
)
|
|
109
109
|
return response
|
|
110
110
|
|
|
111
|
-
def _training_wait(
|
|
112
|
-
|
|
111
|
+
def _training_wait(
|
|
112
|
+
self, generator_id: str, progress_bar: bool, interval: float
|
|
113
|
+
) -> Generator:
|
|
114
|
+
_job_wait(lambda: self._training_progress(generator_id), interval, progress_bar)
|
|
113
115
|
generator = self.get(generator_id)
|
|
114
116
|
return generator
|