Skip to content

Commit ccb33da

Browse files
committed
version update
1 parent 1c82004 commit ccb33da

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33

44
from setuptools import setup
55

6-
76
setup(
87
name="text_preprocessing",
9-
version="1.0",
8+
version="1.0.5",
109
author="The ARTFL Project",
1110
author_email="clovisgladstone@gmail.com",
1211
packages=["text_preprocessing", "text_preprocessing.lang"],

text_preprocessing/preprocessor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def __init__(
7878
ents_to_keep: list[str] | bool = False,
7979
post_processing_function: Callable | None = None,
8080
nlp_model: Language | None = None,
81+
using_gpu: bool = False,
8182
**_, # this is meant to make the constructor accept invalid keywords
8283
):
8384
self.normalize_options = {
@@ -95,16 +96,18 @@ def __init__(
9596
"ents_to_keep": ents_to_keep or [],
9697
}
9798
self.language = language
99+
self.using_gpu = using_gpu
98100
if nlp_model is not None:
99101
self.nlp = nlp_model
100102
else:
101103
self.nlp, using_gpu = load_language_model(self.language, self.normalize_options)
104+
self.using_gpu = using_gpu
102105
if workers is None:
103106
cpu_count = os.cpu_count() or 2
104107
self.workers = cpu_count - 1
105108
else:
106109
self.workers = workers
107-
if using_gpu is True:
110+
if self.using_gpu is True:
108111
self.workers = 1
109112
ngrams = ngrams or 0
110113
if ngrams:

0 commit comments

Comments
 (0)