Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

Commit e037974

Browse files
committed
Sync SAL sources and dependencies
GitOrigin-RevId: dea281a81071fed5dab34b66b0cbc861e6cb3911
1 parent 2456fec commit e037974

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+186
-113
lines changed
Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
import pandas as pd
2-
from gretel_client import configure_session
32

3+
from gretel_client import configure_session
44
from gretel_trainer import Trainer
5-
from gretel_trainer.models import GretelLSTM, GretelACTGAN
5+
from gretel_trainer.models import GretelACTGAN, GretelLSTM
66

7-
DATASET_PATH = 'https://gretel-public-website.s3.amazonaws.com/datasets/mitre-synthea-health.csv'
7+
DATASET_PATH = (
8+
"https://gretel-public-website.s3.amazonaws.com/datasets/mitre-synthea-health.csv"
9+
)
810
MODEL_TYPE = [GretelLSTM(), GretelACTGAN()][1]
911

1012
# Create dataset to autocomplete values for
11-
seed_df = pd.DataFrame(data=[
12-
["black", "african", "F"],
13-
["black", "african", "F"],
14-
["black", "african", "F"],
15-
["black", "african", "F"],
16-
["asian", "chinese", "F"],
17-
["asian", "chinese", "F"],
18-
["asian", "chinese", "F"],
19-
["asian", "chinese", "F"],
20-
["asian", "chinese", "F"]
21-
], columns=["RACE", "ETHNICITY", "GENDER"])
13+
seed_df = pd.DataFrame(
14+
data=[
15+
["black", "african", "F"],
16+
["black", "african", "F"],
17+
["black", "african", "F"],
18+
["black", "african", "F"],
19+
["asian", "chinese", "F"],
20+
["asian", "chinese", "F"],
21+
["asian", "chinese", "F"],
22+
["asian", "chinese", "F"],
23+
["asian", "chinese", "F"],
24+
],
25+
columns=["RACE", "ETHNICITY", "GENDER"],
26+
)
2227

2328

2429
# Configure Gretel credentials
@@ -31,5 +36,5 @@
3136
print(model.generate(seed_df=seed_df))
3237

3338
# Load a existing model and conditionally generate data
34-
#model = Trainer.load()
35-
#print(model.generate(seed_df=seed_df))
39+
# model = Trainer.load()
40+
# print(model.generate(seed_df=seed_df))

notebooks/custom-example.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99

1010
# Specify underlying model and config options.
1111
# configs can be either a string, dict, or path
12-
model_type = GretelACTGAN(
13-
config="synthetics/tabular-actgan",
14-
max_rows=50000
15-
)
12+
model_type = GretelACTGAN(config="synthetics/tabular-actgan", max_rows=50000)
1613

1714
# Optionally update model parameters from a base config
1815
model_type.update_params({"epochs": 500})

notebooks/simple-example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313

1414
# Or, load and generate data from an existing model
1515

16-
#model = Trainer.load()
17-
#model.generate(num_records=70)
16+
# model = Trainer.load()
17+
# model.generate(num_records=70)

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plotly~=5.11
99
pydantic~=1.9
1010
requests~=2.25
1111
scikit-learn~=1.0
12-
smart-open[s3]~=5.2
12+
smart_open[s3]~=5.2
1313
sqlalchemy~=1.4
14-
typing-extensions~=4.7
14+
typing_extensions~=4.7
1515
unflatten==0.1.1

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import pathlib
2-
from setuptools import setup, find_packages
2+
3+
from setuptools import find_packages, setup
34

45
local_path = pathlib.Path(__file__).parent
56
install_requires = (local_path / "requirements.txt").read_text().splitlines()

src/gretel_trainer/benchmark/core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import csv
22
import logging
33
import time
4+
45
from dataclasses import dataclass, field
56
from datetime import datetime
67
from enum import Enum

src/gretel_trainer/benchmark/custom/datasets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import logging
22
import os
33
import uuid
4+
45
from dataclasses import dataclass, field
56
from pathlib import Path
67
from typing import Optional, Union

src/gretel_trainer/benchmark/custom/strategy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pathlib import Path
22
from typing import Optional
33

4-
from gretel_trainer.benchmark.core import BenchmarkConfig, Dataset, Timer, run_out_path
4+
from gretel_trainer.benchmark.core import BenchmarkConfig, Dataset, run_out_path, Timer
55
from gretel_trainer.benchmark.custom.models import CustomModel
66

77

src/gretel_trainer/benchmark/entrypoints.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22

33
import logging
44
import shutil
5+
56
from inspect import isclass
67
from pathlib import Path
7-
from typing import Optional, Type, Union, cast
8+
from typing import cast, Optional, Type, Union
89

910
import pandas as pd
10-
from gretel_client.config import get_session_config
1111

12+
from gretel_client.config import get_session_config
1213
from gretel_trainer.benchmark.core import BenchmarkConfig, BenchmarkException, Dataset
1314
from gretel_trainer.benchmark.custom.models import CustomModel
1415
from gretel_trainer.benchmark.gretel.models import GretelModel
1516
from gretel_trainer.benchmark.job_spec import (
1617
DatasetTypes,
1718
JobSpec,
18-
ModelTypes,
1919
model_name,
20+
ModelTypes,
2021
)
2122
from gretel_trainer.benchmark.session import Session
2223

src/gretel_trainer/benchmark/executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import logging
2+
23
from enum import Enum
34
from typing import Optional, Protocol
45

56
from gretel_client.projects.models import Model
67
from gretel_client.projects.projects import Project
7-
88
from gretel_trainer.benchmark.core import BenchmarkConfig, Dataset, log, run_out_path
99
from gretel_trainer.benchmark.sdk_extras import create_evaluate_model, run_evaluate
1010

0 commit comments

Comments
 (0)