Skip to content

Commit

Permalink
Mirror tokenizers from our file servers fix: #1865
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed Dec 22, 2023
1 parent fa9f6ed commit beab770
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hanlp/components/parsers/biaffine/biaffine_dep.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from collections import Counter
from typing import Union, Any, List

from hanlp.layers.transformers.pt_imports import AutoTokenizer, PreTrainedTokenizer, AutoModel_
from hanlp.layers.transformers.pt_imports import PreTrainedTokenizer, AutoModel_, AutoTokenizer_
import torch
from hanlp.utils.torch_util import lengths_to_mask
from torch import nn
Expand Down Expand Up @@ -282,7 +282,7 @@ def build_optimizer(self, epochs, trn, gradient_accumulation, **kwargs):
def build_transformer_tokenizer(self):
transformer = self.config.transformer
if transformer:
transformer_tokenizer: PreTrainedTokenizer = AutoTokenizer.from_pretrained(transformer, use_fast=True)
transformer_tokenizer: PreTrainedTokenizer = AutoTokenizer_.from_pretrained(transformer, use_fast=True)
else:
transformer_tokenizer = None
self.transformer_tokenizer = transformer_tokenizer
Expand Down
2 changes: 1 addition & 1 deletion hanlp/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Author: hankcs
# Date: 2019-12-28 19:26

__version__ = '2.1.0-beta.54'
__version__ = '2.1.0-beta.55'
"""HanLP version"""


Expand Down

0 comments on commit beab770

Please sign in to comment.