Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecated the __version__ check when loading #8

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading