From 8a6ba4e447ac6c4b6d215ae3b8ab3784dbfc54c5 Mon Sep 17 00:00:00 2001 From: Luca Soldaini Date: Mon, 6 Nov 2023 09:05:02 -0800 Subject: [PATCH] fixed import order --- python/dolma/cli/tagger.py | 1 + python/dolma/core/runtime.py | 2 +- python/dolma/core/utils.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/dolma/cli/tagger.py b/python/dolma/cli/tagger.py index 7b877d32..a7ed39df 100644 --- a/python/dolma/cli/tagger.py +++ b/python/dolma/cli/tagger.py @@ -88,6 +88,7 @@ class TaggerConfig: help="If true, only print the configuration and exit without running the taggers.", ) + class TaggerCli(BaseCli): CONFIG = TaggerConfig DESCRIPTION = ( diff --git a/python/dolma/core/runtime.py b/python/dolma/core/runtime.py index 244a8d2a..62ea0f5e 100644 --- a/python/dolma/core/runtime.py +++ b/python/dolma/core/runtime.py @@ -23,7 +23,7 @@ from .parallel import BaseParallelProcessor, QueueType from .paths import delete_dir, join_path, make_relative, mkdir_p, split_glob, split_path from .registry import TaggerRegistry -from .utils import make_variable_name, import_modules +from .utils import import_modules, make_variable_name # this placeholder gets used when a user has provided no experiment name, and we want to use taggers' # names as experiment names. diff --git a/python/dolma/core/utils.py b/python/dolma/core/utils.py index 6e7482e4..59820c61 100644 --- a/python/dolma/core/utils.py +++ b/python/dolma/core/utils.py @@ -1,7 +1,7 @@ import re import string -from typing import List from importlib import import_module +from typing import List try: import blingfire @@ -68,6 +68,7 @@ def split_sentences(text: str, remove_empty: bool = True) -> List[TextSlice]: else: raise NotImplementedError("remove_empty=False is not implemented yet") + def import_modules(modules: List[str]): for module in modules: try: