-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
125 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
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
Empty file.
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 @@ | ||
from .extra_taggers import * # noqa |
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,6 @@ | ||
from dolma import BaseTagger, add_tagger | ||
|
||
|
||
@add_tagger("extra_v1") | ||
class ExtraV1Tagger(BaseTagger): | ||
... |
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 @@ | ||
from .extra_taggers import * # noqa |
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,6 @@ | ||
from dolma import BaseTagger, add_tagger | ||
|
||
|
||
@add_tagger("extra_v3") | ||
class ExtraV1Tagger(BaseTagger): | ||
... |
Empty file.
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,6 @@ | ||
from dolma import BaseTagger, add_tagger | ||
|
||
|
||
@add_tagger("extra_v2") | ||
class ExtraV2Tagger(BaseTagger): | ||
... |
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,24 @@ | ||
import sys | ||
import unittest | ||
from pathlib import Path | ||
|
||
from dolma.core.registry import TaggerRegistry | ||
from dolma.core.utils import import_modules | ||
|
||
|
||
class TestExtra(unittest.TestCase): | ||
def setUp(self) -> None: | ||
self.current_path = Path(__file__).parent.absolute() | ||
|
||
def test_import_from_module(self): | ||
sys.path.append(f"{self.current_path}/extras") | ||
import_modules(["extras_from_module"]) | ||
self.assertTrue(TaggerRegistry.has("extra_v1")) | ||
|
||
def test_import_from_path(self): | ||
import_modules([f"{self.current_path}/extras/extras_from_path/extra_taggers.py"]) | ||
self.assertTrue(TaggerRegistry.has("extra_v2")) | ||
|
||
def test_import_from_module_path(self): | ||
import_modules([f"{self.current_path}/extras/extras_from_module_path"]) | ||
self.assertTrue(TaggerRegistry.has("extra_v3")) |