From f814c1a3803e8121fbd8aecaec456eea1fefcbf4 Mon Sep 17 00:00:00 2001 From: Laura Hanu <32672979+laurahanu@users.noreply.github.com> Date: Mon, 19 Dec 2022 16:49:38 +0000 Subject: [PATCH 1/5] pin tf version #75 --- requirements.txt | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index e67590c..e05a574 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ pytorch-lightning > 1.5.0 torch >= 1.10.0 -transformers != 4.18.0 +transformers == 4.22.1 # pin to this version due to #75 kaggle >= 1.5.8 pandas >= 1.1.2 scikit-learn >= 0.23.2 diff --git a/setup.py b/setup.py index b30fbd0..fff7d04 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name="detoxify", - version="0.5.0", + version="0.5.1", description="A python library for detecting toxic comments", long_description=long_description, long_description_content_type="text/markdown", @@ -15,7 +15,7 @@ author_email="laura@unitary.ai", url="https://github.com/unitaryai/detoxify", install_requires=[ - "transformers != 4.18.0", # v4.18.0 fails to properly load the finetuned weights + "transformers == 4.22.1", # pin to this version due to #75 "torch >= 1.7.0", "sentencepiece >= 0.1.94", ], From 656dda6d1c1f399411f23312c93e05ca74e4e4a4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 16:51:01 +0000 Subject: [PATCH 2/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- hubconf.py | 8 +------- setup.py | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/hubconf.py b/hubconf.py index b618a70..e3a7d01 100644 --- a/hubconf.py +++ b/hubconf.py @@ -1,9 +1,3 @@ dependencies = ["torch"] -from detoxify import ( # noqa: E402 - multilingual_toxic_xlm_r, - toxic_albert, - toxic_bert, - unbiased_albert, - unbiased_toxic_roberta, -) +from detoxify import multilingual_toxic_xlm_r, toxic_albert, toxic_bert, unbiased_albert, unbiased_toxic_roberta diff --git a/setup.py b/setup.py index fff7d04..81d3eed 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ author_email="laura@unitary.ai", url="https://github.com/unitaryai/detoxify", install_requires=[ - "transformers == 4.22.1", # pin to this version due to #75 + "transformers == 4.22.1", # pin to this version due to #75 "torch >= 1.7.0", "sentencepiece >= 0.1.94", ], From ddde983af2665ed1d9e2b045418a0d48973fdebe Mon Sep 17 00:00:00 2001 From: Laura Hanu <32672979+laurahanu@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:00:27 +0000 Subject: [PATCH 3/5] fix flake8 issue --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e05a574..bec7214 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ pytorch-lightning > 1.5.0 torch >= 1.10.0 -transformers == 4.22.1 # pin to this version due to #75 +transformers == 4.22.1 kaggle >= 1.5.8 pandas >= 1.1.2 scikit-learn >= 0.23.2 From b92bb59f2b3b47c477d0feb63522fe6f9dc9ac28 Mon Sep 17 00:00:00 2001 From: Laura Hanu <32672979+laurahanu@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:06:17 +0000 Subject: [PATCH 4/5] more flake8 fixes --- hubconf.py | 4 ++-- setup.cfg | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/hubconf.py b/hubconf.py index e3a7d01..921d372 100644 --- a/hubconf.py +++ b/hubconf.py @@ -1,3 +1,3 @@ -dependencies = ["torch"] - from detoxify import multilingual_toxic_xlm_r, toxic_albert, toxic_bert, unbiased_albert, unbiased_toxic_roberta + +dependencies = ["torch"] diff --git a/setup.cfg b/setup.cfg index 082a767..a84b72c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,12 +29,18 @@ verbose = 2 format = pylint # see: https://www.flake8rules.com/ ignore = - E731 # Do not assign a lambda expression, use a def - W504 # Line break occurred after a binary operator - W503 # Line break occurred after a binary operator - F401 # Module imported but unused - F841 # Local variable name is assigned to but never used - W605 # Invalid escape sequence 'x' + # Do not assign a lambda expression, use a def + E731, + # Line break occurred after a binary operator + W504, + # Line break occurred after a binary operator + W503, + # Module imported but unused + F401, + # Local variable name is assigned to but never used + F841, + # Invalid escape sequence 'x' + W605 # setup.cfg or tox.ini [check-manifest] From 8cb72af610f8ea608689af2940019f21720005f8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:06:30 +0000 Subject: [PATCH 5/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index a84b72c..c4ab78a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -39,7 +39,7 @@ ignore = F401, # Local variable name is assigned to but never used F841, - # Invalid escape sequence 'x' + # Invalid escape sequence 'x' W605 # setup.cfg or tox.ini