Commit 9894597c authored by lintangsutawika's avatar lintangsutawika
Browse files

add verbose arg

parent 13f0d126
...@@ -97,6 +97,12 @@ def parse_eval_args() -> argparse.Namespace: ...@@ -97,6 +97,12 @@ def parse_eval_args() -> argparse.Namespace:
default=None, default=None,
help="Additional path to include if there are external tasks to include.", help="Additional path to include if there are external tasks to include.",
) )
parser.add_argument(
"--verbose",
type=bool,
default=False,
help="Log error when tasks are not registered.",
)
return parser.parse_args() return parser.parse_args()
...@@ -167,6 +173,7 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None: ...@@ -167,6 +173,7 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
assert args.output_path, "Specify --output_path" assert args.output_path, "Specify --output_path"
eval_logger.info(f"Selected Tasks: {task_names}") eval_logger.info(f"Selected Tasks: {task_names}")
eval_logger.verbose = args.verbose
results = evaluator.simple_evaluate( results = evaluator.simple_evaluate(
model=args.model, model=args.model,
......
...@@ -139,15 +139,18 @@ def include_task_folder(task_dir: str, register_task: bool = True) -> None: ...@@ -139,15 +139,18 @@ def include_task_folder(task_dir: str, register_task: bool = True) -> None:
register_configurable_group(config, yaml_path) register_configurable_group(config, yaml_path)
except Exception as error: except Exception as error:
import traceback if eval_logger.verbose:
import traceback
eval_logger.warning(
"Failed to load config in\n" eval_logger.warning(
f" {yaml_path}\n" "Failed to load config in\n"
" Config will not be added to registry\n" f" {yaml_path}\n"
f" Error: {error}\n" " Config will not be added to registry\n"
f" Traceback: {traceback.format_exc()}" f" Error: {error}\n"
) f" Traceback: {traceback.format_exc()}"
)
else:
eval_logger.warning("Yaml failed to register {yaml_path}\n")
return 0 return 0
......
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