-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bug] Fix vocabs and add corresponding test case (#1813)
- Loading branch information
1 parent
9b6dea3
commit 48873e0
Showing
3 changed files
with
19 additions
and
8 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
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 doctr.datasets 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] | ||
This comment has been minimized.
Sorry, something went wrong. |
||
assert not duplicates, f"Duplicate characters in {key} vocab: {duplicates}" |
len(vocab) == len(frozenset(vocab))
?