HCAI-Lab/w2-consensus-deepdive-unlearning-artifacts / social-data-attribution-w2 /src /data_attribution /cli /main.py
| """ | |
| Command-line interface for data attribution workflows. | |
| """ | |
| from __future__ import annotations | |
| import argparse | |
| import sys | |
| from typing import Any, Callable, Dict | |
| from data_attribution.cli.config import configure_logging, default_run_id, load_config | |
| from data_attribution.cli.parser import build_parser | |
| Handler = Callable[[argparse.Namespace, Dict[str, Any]], int] | |
| def dispatch(args: argparse.Namespace) -> int: | |
| """Execute the chosen subcommand.""" | |
| configure_logging(args.verbose) | |
| config = load_config(args.config) | |
| handler: Handler = getattr(args, "func") | |
| return handler(args, config) | |
| def main(argv: list[str] | None = None) -> int: | |
| parser = build_parser() | |
| args = parser.parse_args(argv) | |
| return dispatch(args) | |
| __all__ = [ | |
| "configure_logging", | |
| "default_run_id", | |
| "load_config", | |
| "build_parser", | |
| "dispatch", | |
| "main", | |
| ] | |
| if __name__ == "__main__": | |
| sys.exit(main()) | |
Xet Storage Details
- Size:
- 932 Bytes
- Xet hash:
- 1d9340ea838bd20e29a40b5823ea0e0dc3d72088c13f36f581361237900f12a1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.