Commit 10cc0a56 authored by lintangsutawika's avatar lintangsutawika
Browse files

edits and format

parent cfbad4c4
# from .evaluator import evaluate, simple_evaluate
# from .logger import eval_logger, SPACING
from .evaluator import evaluate, simple_evaluate
......@@ -13,6 +13,7 @@ from lm_eval import evaluator, utils
from lm_eval.tasks import initialize_tasks, include_path
from lm_eval.api.registry import ALL_TASKS
def _handle_non_serializable(o):
if isinstance(o, np.int64) or isinstance(o, np.int32):
return int(o)
......@@ -163,7 +164,7 @@ def cli_evaluate(args: Union[argparse.Namespace, None] = None) -> None:
missing = ", ".join(task_missing)
eval_logger.error(
f"Tasks were not found: {missing}\n"
f"{' ' * 47}Try `lm-eval --tasks list` for list of available tasks",
f"{utils.SPACING}Try `lm-eval --tasks list` for list of available tasks",
)
raise ValueError(
f"Tasks {missing} were not found. Try `lm-eval --tasks list` for list of available tasks."
......
......@@ -20,7 +20,7 @@ from lm_eval.utils import (
make_table,
create_iterator,
get_git_commit_hash,
eval_logger
eval_logger,
)
......@@ -40,7 +40,6 @@ def simple_evaluate(
decontamination_ngrams_path=None,
write_out: bool = False,
log_samples: bool = True,
verbosity: str = "INFO",
):
"""Instantiate and evaluate a model on a list of tasks.
......
......@@ -7,6 +7,7 @@ from typing import List, Any, Tuple
eval_logger = utils.eval_logger
def anthropic_completion(
client, #: anthropic.Anthropic,
model: str,
......
......@@ -26,6 +26,7 @@ from typing import List, Optional, Union
eval_logger = utils.eval_logger
def _get_accelerate_args(
device_map_option: Optional[str] = "auto",
max_memory_per_gpu: Optional[Union[int, str]] = None,
......
......@@ -14,6 +14,7 @@ from lm_eval.api.registry import (
)
import logging
eval_logger = utils.eval_logger
......
......@@ -30,6 +30,7 @@ eval_logger = logging.getLogger("lm-eval")
SPACING = " " * 47
def escaped_split(text, sep_char, maxsplit=-1):
"""Split text into a list on occurrences of the given separation
character `sep_char`. The separation character may be escaped by a
......
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