Skip to content

Commit a012112

Browse files
authored
Legacy tokenizer (#2465)
1 parent 03ae6d1 commit a012112

File tree

8 files changed

+6180
-2
lines changed

8 files changed

+6180
-2
lines changed

paddleformers/transformers/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
"AddedToken",
3838
"normalize_chars",
3939
"tokenize_special_chars,convert_to_unicode,",
40+
"PreTrainedTokenizer",
41+
],
42+
"tokenizer_utils_base": [
43+
"PaddingStrategy",
44+
"TextInput",
45+
"TensorType",
4046
],
4147
"attention_utils": ["create_bigbird_rand_mask_idx_list"],
4248
"tensor_parallel_utils": [],
@@ -340,7 +346,6 @@
340346
tokenize_special_chars,
341347
convert_to_unicode,
342348
)
343-
from .tokenizer_utils_fast import PretrainedTokenizerFast
344349
from .processing_utils import ProcessorMixin
345350
from .feature_extraction_utils import BatchFeature, FeatureExtractionMixin
346351
from .image_processing_utils import ImageProcessingMixin

paddleformers/transformers/image_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import requests
2626
from packaging import version
2727

28-
from .tokenizer_utils_base import ExplicitEnum
28+
from .tokenizer_utils import ExplicitEnum
2929

3030
IMAGENET_DEFAULT_MEAN = [0.485, 0.456, 0.406]
3131
IMAGENET_DEFAULT_STD = [0.229, 0.224, 0.225]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.

0 commit comments

Comments
 (0)