-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bug] Fix vocab duplicates and add corresponding test case
- Loading branch information
1 parent
fe4ae83
commit 73c8232
Showing
2 changed files
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from collections import Counter | ||
|
||
from onnxtr.utils import VOCABS | ||
|
||
|
||
def test_vocabs_duplicates(): | ||
for key, vocab in VOCABS.items(): | ||
assert isinstance(vocab, str) | ||
|
||
duplicates = [char for char, count in Counter(vocab).items() if count > 1] | ||
assert not duplicates, f"Duplicate characters in {key} vocab: {duplicates}" |