Skip to content

Commit

Permalink
deprecated the __version__ check when loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Hk669 committed Jun 5, 2024
1 parent 3b12f61 commit 02f7eba
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions bpetokenizer/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ def load(self, file_name, mode="json"):
special_tokens = {}
idx = 256
with open(file_name, 'r', encoding="utf-8") as f:
assert f.readline().strip() == __version__
self.pattern = f.readline().strip().split()
num_special = int(f.readline().strip()) # no of lines of special_tokens
for _ in range(num_special):
Expand All @@ -159,7 +158,6 @@ def load(self, file_name, mode="json"):
import json
with open(file_name, "r", encoding="utf-8") as f:
data = json.load(f)
assert data["version"] == __version__
pattern = data["pattern"]
pattern_regex = re.compile(r'regex.Regex\("(.+)", flags=(regex\.\w+)\)')
match = pattern_regex.match(pattern)
Expand Down

0 comments on commit 02f7eba

Please sign in to comment.