INNER CODE UNIT · Python

_version_callback

mrwadams/stride-gpt · stride_gpt/cli.py:120

def _version_callback(value: bool) -> None:
    if value:
        console.print(f"stride-gpt {__version__}")
        raise typer.Exit()


@app.callback(invoke_without_command=True)
def interactive(
    ctx: typer.Context,
    version: Annotated[
        bool,
        typer.Option(
            "--version",
            help="Show the version and exit.",
            callback=_version_callback,
            is_eager=True,
        ),
    ] = False,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…