lumamba 0.0.1

LuMamba EEG foundation model — inference in Rust on the RLX runtime
Documentation
// lumamba-rs — LuMamba EEG foundation-model inference on the RLX runtime.
// Copyright (C) 2026 Nataliya Kosmyna.
// SPDX-License-Identifier: GPL-3.0-only

//! Download a LuMamba checkpoint from HuggingFace.
//!
//! Requires `--features hf-download`. Prints the local cached path.
//!
//! Usage:
//!   download_weights [--repo PulpBio/LuMamba] [--file <name.safetensors>]
//!   download_weights --list

use clap::Parser;

use lumamba::hf;

#[derive(Parser, Debug)]
#[command(about = "Download a LuMamba checkpoint from HuggingFace")]
struct Args {
    #[arg(long, default_value = hf::DEFAULT_REPO)]
    repo: String,

    #[arg(long, default_value = "LuMamba_LeJEPA_reconstruction_128slices.safetensors")]
    file: String,

    /// List the known released checkpoints and exit.
    #[arg(long)]
    list: bool,
}

fn main() -> anyhow::Result<()> {
    let args = Args::parse();
    if args.list {
        eprintln!("Released checkpoints in {}:", hf::DEFAULT_REPO);
        for c in hf::CHECKPOINTS {
            println!("{c}");
        }
        return Ok(());
    }
    let path = hf::download(&args.repo, &args.file)?;
    println!("{}", path.display());
    Ok(())
}