From cbb85e2aabdb656aafaf0cf42334f45ce2f03bdf Mon Sep 17 00:00:00 2001 From: Chi Wang Date: Sun, 26 Jun 2022 08:32:28 -0700 Subject: [PATCH] Py36 (#614) * allow installation in py 3.6 * test py 3.6 --- .github/workflows/python-package.yml | 2 +- setup.py | 14 +++++--------- test/nlp/test_autohf_tokenclassification.py | 9 +++++++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 8b1b2ce6a..19f3a3f40 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-2019] - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 diff --git a/setup.py b/setup.py index de126ca07..b9bb210d1 100644 --- a/setup.py +++ b/setup.py @@ -59,20 +59,17 @@ setuptools.setup( "statsmodels>=0.12.2", "psutil==5.8.0", "dataclasses", - "transformers>=4.14", + "transformers[torch]>=4.14", "datasets", - "torch", "nltk", "rouge_score", "hcrystalball==0.1.10", "seqeval", - "protobuf<4", # to prevent TypeError in ray ], "catboost": ["catboost>=0.26"], "blendsearch": ["optuna==2.8.0"], "ray": [ - "ray[tune]~=1.10", - "protobuf<4", # to prevent TypeError in ray + "ray[tune]~=1.13", ], "azureml": [ "azureml-mlflow", @@ -84,12 +81,11 @@ setuptools.setup( "vowpalwabbit", ], "nlp": [ - "transformers>=4.14", + "transformers[torch]>=4.14", "datasets", - "torch", - "seqeval", "nltk", "rouge_score", + "seqeval", ], "ts_forecast": [ "holidays<0.14", # to prevent installation error for prophet @@ -110,5 +106,5 @@ setuptools.setup( "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], - python_requires=">=3.7", + python_requires=">=3.6", ) diff --git a/test/nlp/test_autohf_tokenclassification.py b/test/nlp/test_autohf_tokenclassification.py index 7636193ce..2a60617e9 100644 --- a/test/nlp/test_autohf_tokenclassification.py +++ b/test/nlp/test_autohf_tokenclassification.py @@ -4,7 +4,10 @@ import requests from utils import get_toy_data_tokenclassification, get_automl_settings -@pytest.mark.skipif(sys.platform == "darwin", reason="do not run on mac os") +@pytest.mark.skipif( + sys.platform == "darwin" or sys.version < "3.7", + reason="do not run on mac os or py<3.7", +) def test_tokenclassification(): from flaml import AutoML @@ -13,7 +16,9 @@ def test_tokenclassification(): automl_settings = get_automl_settings() automl_settings["task"] = "token-classification" - automl_settings["metric"] = "seqeval:overall_f1" # evaluating based on the overall_f1 of seqeval + automl_settings[ + "metric" + ] = "seqeval:overall_f1" # evaluating based on the overall_f1 of seqeval automl_settings["fit_kwargs_by_estimator"]["transformer"]["label_list"] = [ "O", "B-PER",