Skip to content

Commit

Permalink
🎨 make minimal requires ["torch>=1.6.0","transformers>=4.0.0"] #621
Browse files Browse the repository at this point in the history
  • Loading branch information
AlongWY committed Dec 29, 2022
1 parent 99a10a5 commit 9655365
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion python/core/ltp_core/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.2"
__version__ = "0.1.3"
2 changes: 1 addition & 1 deletion python/core/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# --------- pytorch --------- #
torch>=1.0.0
torch>=1.6.0

# --------- transformers --------- #
transformers>=4.0.0
Expand Down
5 changes: 3 additions & 2 deletions python/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

setup(
name="ltp_core",
version="0.1.2",
version="0.1.3",
author="Yunlong Feng",
author_email="[email protected]",
url="https://github.com/HIT-SCIR/ltp",
description="Language Technology Platform",
long_description=long_description,
long_description_content_type="text/markdown",
install_requires=[
"torch>=1.0.0",
"torch>=1.6.0",
"transformers>=4.0.0",
],
extras_require={
Expand All @@ -43,6 +43,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries",
],
packages=find_packages(),
Expand Down
2 changes: 1 addition & 1 deletion python/interface/ltp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "4.2.11.post2"
__version__ = "4.2.12"

from ltp_extension.algorithms import StnSplit

Expand Down
10 changes: 4 additions & 6 deletions python/interface/ltp/nerual.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
from ltp.mixin import PYTORCH_WEIGHTS_NAME, ModelHubMixin
from ltp.module import BaseModule
from ltp_extension.algorithms import Hook, eisner, get_entities
from transformers import AutoTokenizer, BatchEncoding, TensorType
from transformers.tokenization_utils_base import TruncationStrategy
from transformers.utils import PaddingStrategy
from transformers import AutoTokenizer, BatchEncoding

from ltp_core.models.components.graph import GraphResult
from ltp_core.models.components.token import TokenClassifierResult
Expand Down Expand Up @@ -124,9 +122,9 @@ def pipeline(
tokenized = self.tokenizer.batch_encode_plus(
inputs,
max_length=512,
padding=PaddingStrategy.LONGEST,
truncation=TruncationStrategy.LONGEST_FIRST,
return_tensors=TensorType.PYTORCH,
padding="longest", # PaddingStrategy.LONGEST,
truncation="longest_first", # TruncationStrategy.LONGEST_FIRST,
return_tensors="pt", # TensorType.PYTORCH,
is_split_into_words=is_split_into_words,
)

Expand Down
5 changes: 3 additions & 2 deletions python/interface/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

setup(
name="ltp",
version="4.2.11.post2",
version="4.2.12",
author="Yunlong Feng",
author_email="[email protected]",
url="https://github.com/HIT-SCIR/ltp",
description="Language Technology Platform",
long_description=long_description,
long_description_content_type="text/markdown",
install_requires=[
"ltp_core>=0.1.2",
"ltp_core>=0.1.3",
"ltp_extension>=0.1.9",
"huggingface_hub>=0.8.0",
],
Expand All @@ -30,6 +30,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries",
],
packages=find_packages(),
Expand Down

0 comments on commit 9655365

Please sign in to comment.