mirror of
https://github.com/SikongJueluo/Mini-Nav.git
synced 2026-07-12 20:15:31 +08:00
- Extract model loading logic from benchmark CLI into task-owned prepare_benchmark - Add RetrievalEncoder class wrapping DINO with optional hash compression - Add accelerate dependency for device management - Switch dataset from CIFAR-10 to CIFAR-100 with fine_label column
27 lines
657 B
Python
27 lines
657 B
Python
import typer
|
|
from commands import app
|
|
|
|
|
|
@app.command()
|
|
def benchmark(
|
|
_ctx: typer.Context,
|
|
model_path: str | None = typer.Option(
|
|
None, "--model", "-m", help="Path to compressor model weights"
|
|
),
|
|
):
|
|
from benchmarks import run_benchmark
|
|
from configs import cfg_manager
|
|
|
|
config = cfg_manager.get()
|
|
benchmark_cfg = config.benchmark
|
|
if model_path:
|
|
config.model.compressor_path = model_path
|
|
|
|
_ = run_benchmark(
|
|
model=None,
|
|
processor=None,
|
|
config=benchmark_cfg,
|
|
model_config=config.model,
|
|
model_name="hash_compressor" if config.model.compressor_path else "dinov2",
|
|
)
|