mirror of
https://github.com/EleutherAI/lm-evaluation-harness.git
synced 2026-10-12 02:02:05 +00:00
modular subcommands (run/ls/validate), YAML config support (--config), new EvaluatorConfig dataclass.
20 lines
480 B
Python
20 lines
480 B
Python
import argparse
|
|
from abc import ABC, abstractmethod
|
|
|
|
|
|
class SubCommand(ABC):
|
|
"""Base class for all subcommands."""
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
pass
|
|
|
|
@classmethod
|
|
def create(cls, subparsers: argparse._SubParsersAction):
|
|
"""Factory method to create and register a command instance."""
|
|
return cls(subparsers)
|
|
|
|
@abstractmethod
|
|
def _add_args(self) -> None:
|
|
"""Add arguments specific to this subcommand."""
|
|
pass
|