Commit be5472a9 authored by lintangsutawika's avatar lintangsutawika
Browse files

reformat

parent 7fe0ced5
...@@ -40,6 +40,7 @@ ALL_OUTPUT_TYPES = [ ...@@ -40,6 +40,7 @@ ALL_OUTPUT_TYPES = [
eval_logger = logging.getLogger("lm-eval") eval_logger = logging.getLogger("lm-eval")
@dataclass @dataclass
class GroupConfig(dict): class GroupConfig(dict):
group: str = None group: str = None
......
...@@ -475,6 +475,7 @@ def get_git_commit_hash(): ...@@ -475,6 +475,7 @@ def get_git_commit_hash():
def ignore_constructor(loader, node): def ignore_constructor(loader, node):
return node return node
def import_function(loader, node): def import_function(loader, node):
function_name = loader.construct_scalar(node) function_name = loader.construct_scalar(node)
yaml_path = os.path.dirname(loader.name) yaml_path = os.path.dirname(loader.name)
...@@ -482,9 +483,7 @@ def import_function(loader, node): ...@@ -482,9 +483,7 @@ def import_function(loader, node):
*module_name, function_name = function_name.split(".") *module_name, function_name = function_name.split(".")
if isinstance(module_name, list): if isinstance(module_name, list):
module_name = ".".join(module_name) module_name = ".".join(module_name)
module_path = os.path.normpath( module_path = os.path.normpath(os.path.join(yaml_path, "{}.py".format(module_name)))
os.path.join(yaml_path, "{}.py".format(module_name))
)
spec = importlib.util.spec_from_file_location(module_name, module_path) spec = importlib.util.spec_from_file_location(module_name, module_path)
module = importlib.util.module_from_spec(spec) module = importlib.util.module_from_spec(spec)
...@@ -495,7 +494,6 @@ def import_function(loader, node): ...@@ -495,7 +494,6 @@ def import_function(loader, node):
def load_yaml_config(mode="simple", yaml_path=None, yaml_config=None, yaml_dir=None): def load_yaml_config(mode="simple", yaml_path=None, yaml_config=None, yaml_dir=None):
if mode == "simple": if mode == "simple":
constuctor_fn = ignore_constructor constuctor_fn = ignore_constructor
elif mode == "full": elif mode == "full":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment