-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change languages available in dlt.lang (#35)
* Change languages available in dlt.lang * Add Khmer as a language for m2m100 * scripts/generate_lang.py * Update available languages in the docs * Update tests for dlt.lang * Apply black * Bump version * Fix tests (replace space by _)
- Loading branch information
Xing Han Lu
authored
Apr 9, 2021
1 parent
f0c091b
commit a6f7410
Showing
7 changed files
with
16 additions
and
7 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from .mbart50 import * | ||
from . import m2m100 | ||
from .m2m100 import * | ||
from . import m2m100, mbart50 |
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
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
setuptools.setup( | ||
name="dl-translate", | ||
version="0.2.1", | ||
version="0.2.2", | ||
author="Xing Han Lu", | ||
author_email="[email protected]", | ||
description="A deep learning-based translation library built on Huggingface transformers", | ||
|
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 |
---|---|---|
@@ -1,12 +1,17 @@ | ||
import dl_translate as dlt | ||
from dl_translate._pairs import _PAIRS_MBART50 | ||
from dl_translate._pairs import _PAIRS_MBART50, _PAIRS_M2M100 | ||
|
||
|
||
def test_lang(): | ||
for l, _ in _PAIRS_MBART50: | ||
assert getattr(dlt.lang, l.upper()) == l | ||
for l, _ in _PAIRS_M2M100: | ||
assert getattr(dlt.lang, l.upper().replace(" ", "_")) == l | ||
|
||
|
||
def test_lang_m2m100(): | ||
for l, _ in _PAIRS_M2M100: | ||
assert getattr(dlt.lang.m2m100, l.upper().replace(" ", "_")) == l | ||
|
||
|
||
def test_lang_mbart50(): | ||
for l, _ in _PAIRS_MBART50: | ||
assert getattr(dlt.lang.mbart50, l.upper()) == l | ||
assert getattr(dlt.lang.mbart50, l.upper().replace(" ", "_")) == l |