Skip to content

Commit 64e1b04

Browse files
authored
Feat/update requirements and use Python 3.8 as supported minimum version (#83)
* Check model existence with model.safetensors Signed-off-by: Aivin V. Solatorio <[email protected]> * Add bump version Signed-off-by: Aivin V. Solatorio <[email protected]> * Use poetry Signed-off-by: Aivin V. Solatorio <[email protected]> * Add dev deps Signed-off-by: Aivin V. Solatorio <[email protected]> * Update ignore file Signed-off-by: Aivin V. Solatorio <[email protected]> * Add download stats Signed-off-by: Aivin V. Solatorio <[email protected]> * Bump minor version, Python 3.7 to 3.8 Signed-off-by: Aivin V. Solatorio <[email protected]> --------- Signed-off-by: Aivin V. Solatorio <[email protected]>
1 parent e14fab3 commit 64e1b04

File tree

7 files changed

+54
-41
lines changed

7 files changed

+54
-41
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
poetry.lock
2+
13
experiments/
24
rtf*checkpoints/
35
tests/realtabformer/data/
46

7+
*.DS_Store
8+
59
# Byte-compiled / optimized / DLL files
610
__pycache__/
711
*.py[cod]

Makefile

+10-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ lint:
1414
pre-commit run -a --hook-stage manual $(hook)
1515

1616
test:
17-
pytest tests --cov-config pyproject.toml --numprocesses 4 --dist loadfile
17+
poetry run pytest tests --cov-config pyproject.toml --numprocesses 4 --dist loadfile
18+
19+
bump-version:
20+
poetry version patch
1821

1922
pip-compile:
2023
pip-compile -q -o -
@@ -23,13 +26,16 @@ secret-scan:
2326
trufflehog --max_depth 1 --exclude_paths trufflehog-ignore.txt .
2427

2528
package: clean install
26-
python setup.py sdist bdist_wheel
29+
# python setup.py sdist bdist_wheel
30+
poetry build
2731

2832
test-pypi-upload: package
29-
twine upload --repository testpypi dist/*
33+
# poetry run twine upload --repository testpypi dist/*
34+
poetry publish --build --repository testpypi
3035

3136
pypi-upload: package
32-
twine upload dist/*
37+
# poetry run twine upload dist/*
38+
poetry publish --build
3339

3440
install-test-requirements:
3541
pip install -r test_requirements.txt

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a href="https://colab.research.google.com/github/avsolatorio/RealTabFormer/blob/main/colab/REaLTabFormer_GeoValidator_Example.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
1+
<a href="https://colab.research.google.com/github/avsolatorio/RealTabFormer/blob/main/colab/REaLTabFormer_GeoValidator_Example.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> [![Downloads](https://static.pepy.tech/badge/realtabformer)](https://pepy.tech/project/realtabformer) [![Downloads](https://static.pepy.tech/badge/realtabformer/month)](https://pepy.tech/project/realtabformer) [![Downloads](https://static.pepy.tech/badge/realtabformer/week)](https://pepy.tech/project/realtabformer)
22

33
# REaLTabFormer
44

pyproject.toml

+36-29
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,54 @@
11
[build-system]
2-
requires = ["setuptools>=61.0"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["poetry-core>=1.0.0"]
3+
build-backend = "poetry.core.masonry.api"
44

5-
[project]
5+
[tool.poetry]
66
name = "REaLTabFormer"
7-
dynamic = ["version"]
8-
authors = [
9-
{ name="Aivin V. Solatorio", email="[email protected]" },
10-
]
117
description = "A novel method for generating tabular and relational data using language models."
8+
authors = ["Aivin V. Solatorio <[email protected]>"]
129
readme = "README.md"
13-
license = { file="LICENSE" }
14-
requires-python = ">=3.7"
10+
license = "MIT"
11+
version = "0.2.0"
12+
homepage = "https://github.com/avsolatorio/REaLTabFormer"
13+
documentation = "https://worldbank.github.io/REaLTabFormer/"
14+
1515
classifiers = [
1616
"Programming Language :: Python :: 3",
1717
"License :: OSI Approved :: MIT License",
18-
"Operating System :: OS Independent",
18+
"Operating System :: OS Independent"
1919
]
20+
2021
keywords = [
2122
"REaLTabFormer", "deep learning", "tabular data",
2223
"transformers", "data generation", "seq2seq model",
2324
"synthetic data", "pytorch", "language models",
2425
"synthetic data generation"
2526
]
26-
dependencies = [
27-
"accelerate >= 0.20.3",
28-
"datasets >= 2.6.1",
29-
"numpy >= 1.21.6", # "numpy >= 1.23.4",
30-
"pandas >= 1.3.5", # "pandas >= 1.5.1",
31-
"scikit_learn >= 1.0.2", # "scikit_learn >= 1.1.3",
32-
"torch >= 1.13.0",
33-
"tqdm >= 4.64.1",
34-
"transformers >= 4.24.0",
35-
"shapely >= 1.8.5.post1",
36-
]
3727

38-
[project.urls]
39-
"Homepage" = "https://github.com/avsolatorio/REaLTabFormer"
40-
"Documentation" = "https://avsolatorio.github.io/REaLTabFormer/"
28+
[tool.poetry.dependencies]
29+
python = ">=3.8"
30+
datasets = ">=2.6.1"
31+
numpy = ">=1.21.6" # ">=1.23.4"
32+
pandas = ">=1.3.5" # ">=1.5.1"
33+
scikit-learn = ">=1.0.2" # ">=1.1.3"
34+
tqdm = ">=4.64.1"
35+
transformers = {extras = ["torch", "sentencepiece"], version = ">=4.41.0"}
36+
shapely = ">=1.8.5.post1"
37+
38+
[tool.poetry.urls]
39+
Homepage = "https://github.com/avsolatorio/REaLTabFormer"
40+
Documentation = "https://avsolatorio.github.io/REaLTabFormer/"
41+
42+
[tool.poetry.scripts]
43+
realtabformer = "realtabformer:main"
4144

42-
[tool.setuptools.packages.find]
43-
where = ["src"]
45+
[tool.poetry_bumpversion.file."src/realtabformer/VERSION"]
4446

45-
[tool.setuptools.dynamic]
46-
# version = {attr = "realtabformer.__version__"}
47-
version = {file = "src/realtabformer/VERSION"}
47+
[tool.poetry.group.dev.dependencies]
48+
ipykernel = "^6.29.4"
49+
pytest = "^8.2.2"
50+
isort = "^5.13.2"
51+
black = "^24.4.2"
52+
bandit = "^1.7.9"
53+
trufflehog = "^2.2.1"
54+
pytest-mock = "^3.14.0"

setup.py

-4
This file was deleted.

src/realtabformer/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.7
1+
0.2.0

src/realtabformer/realtabformer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -822,10 +822,10 @@ def _train_with_sensitivity(
822822
loaded_model_path = None
823823

824824
if not load_from_best_mean_sensitivity:
825-
if (bdm_path / "pytorch_model.bin").exists():
825+
if (bdm_path / "pytorch_model.bin").exists() or (bdm_path / "model.safetensors").exists():
826826
loaded_model_path = bdm_path
827827
else:
828-
if (mean_closest_bdm_path / "pytorch_model.bin").exists():
828+
if (mean_closest_bdm_path / "pytorch_model.bin").exists() or (mean_closest_bdm_path / "model.safetensors").exists():
829829
loaded_model_path = mean_closest_bdm_path
830830

831831
if loaded_model_path is None:

0 commit comments

Comments
 (0)