refactor: migrate scripts from argparse to click, add YAML config support

- Replace argparse with click in all scripts (train, server, generate,
  preprocess, benchmark)
- Add --config YAML support to train.py with CLI flag override
- Add --dry-run mode to validate config before training
- Add type annotations throughout benchmark.py
- Unify docstring format across all commands
- Remove redundant deps httpx, requests, pyyaml, rich from pyproject.toml
- Net -346 lines while adding YAML config support
This commit is contained in:
2026-07-27 06:55:46 +08:00
parent b99485f462
commit 4de42d83c2
8 changed files with 571 additions and 711 deletions
+3 -3
View File
@@ -18,8 +18,8 @@ dependencies = [
"jinja2>=3.0.0",
"fastapi",
"uvicorn[standard]",
"httpx",
"requests",
"click>=8.0",
"pyyaml>=6.0",
]
keywords = ["nlp", "datasets", "language-models", "machine-learning"]
license = { text = "GPL-3.0" }
@@ -31,7 +31,7 @@ classifiers = [
urls = { Homepage = "https://github.com/ViperEkura/AstrAI" }
[project.optional-dependencies]
dev = ["pytest==9.0.2", "ruff"]
dev = ["pytest==9.0.2", "ruff", "httpx2"]
[tool.setuptools.packages.find]
where = ["."]