Update model card with cellgemma-wasm-wgpu repo and usage guide
Browse files18 unmodified lines192021222223242521 unmodified lines474849505051525253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969755569899100101102103585910410510610710810911018 unmodified lines
Pre-quantized **Q4_0** (block size 32, 18 bytes/block) weights for [`google/cellgemma-e4b`](https://huggingface.co/google/cellgemma-e4b), sharded into **36 binary files (`<= 128 MiB` each)** so every tensor fits within standard WebGPU `maxStorageBufferBindingSize` limits and runs comfortably on **8 GB GPUs** (including in-browser WebGPU via Wasm and native Vulkan via `wgpu`).
- **Engine & Interactive SMILES Perturbation Lab**: [https://github.com/lhemerly/cellgemma-webgpu](https://github.com/lhemerly/cellgemma-webgpu)- **Engine & Interactive SMILES Perturbation Lab**: [https://github.com/lhemerly/cellgemma-wasm-wgpu](https://github.com/lhemerly/cellgemma-wasm-wgpu)- **Base Model**: [`google/cellgemma-e4b`](https://huggingface.co/google/cellgemma-e4b) (`Gemma4ForCausalLM`, `gemma4_text`, 42 layers, 4.5B effective / 7.73B total params, 282,240 vocab)- **License**: Apache 2.0
21 unmodified lines- `kg_sentences.json` — knowledge-graph gene descriptions for CRISPR/cytokine prompts- `decoders/<dataset>/` — all 13 Stage 2 `ExpressionDecoder` MLPs (`dong`, `emeraldbay`, `hepg2`, `jurkat`, `k562`, `l1000`, `norman`, `parse`, `rpe1`, `sciplex`, `tahoe`, `tisch`, `vcc`)
## Usage## How to Use with `cellgemma-wasm-wgpu`
Clone and run with [`cellgemma-webgpu`](https://github.com/lhemerly/cellgemma-webgpu):This repository hosts the **4.052 GiB Q4_0 weights, tokenizer, baseline controls, gene knowledge graph, and 13 Stage 2 `ExpressionDecoder`s**. Pair it with the Rust/Wasm + WebGPU FlashAttention-style engine and interactive Perturbation Lab UI at [**`lhemerly/cellgemma-wasm-wgpu`**](https://github.com/lhemerly/cellgemma-wasm-wgpu):
### Option 1: In-Browser WebGPU Lab (Stream Directly from HuggingFace)
```bashgit clone https://github.com/lhemerly/cellgemma-wasm-wgpucd cellgemma-wasm-wgpupython3 scripts/serve.py --port 8080```
Open `http://localhost:8080` in a WebGPU-enabled browser, then paste this URL into the **Model Loader -> Custom URL** field:
```texthttps://huggingface.co/lhemerly/cellgemma-e4b-q4-webgpu/resolve/main```
From the browser UI you can:- Toggle **GPU PLE (~4.33 GiB VRAM)** vs **CPU PLE offload (~2.74 GiB VRAM)** to fit 8 GB GPUs with headroom.- Select or draw **SMILES** small molecules (with live 2D structure preview & Lipinski/descriptor checks), stack **CRISPR**, **Cytokine**, and **Clinical** perturbations, and run dose-response sweeps.- Switch across all **13 Stage 2 `ExpressionDecoder`s**, adjust Temperature / Top-P / Top-K / Seed, stream `+GENE`/`-GENE` DEGs live, and compare runs side-by-side.
### Option 2: In-Browser WebGPU Lab with Local Weights (Auto-Detected / Offline)
Download these quantized weights into `models/cellgemma-e4b-q4/` inside the cloned repo:
```bashgit clone https://github.com/lhemerly/cellgemma-wasm-wgpucd cellgemma-wasm-wgpu
# Using HuggingFace CLI:hf download lhemerly/cellgemma-e4b-q4-webgpu --local-dir models/cellgemma-e4b-q4
# Or using Git LFS:# git lfs install# git clone https://huggingface.co/lhemerly/cellgemma-e4b-q4-webgpu models/cellgemma-e4b-q4
python3 scripts/serve.py --port 8080```
The WebGPU Lab automatically detects `/models/cellgemma-e4b-q4/manifest.json` on startup (or you can pick any local model folder via the **Folder** picker).
### Option 3: Native 8 GB GPU CLI (`wgpu` Vulkan / Metal / DX12)
Once the weights are in `models/cellgemma-e4b-q4/`, run native GPU inference directly from Rust:
```bash# Serve the WebGPU Perturbation Lab locallypython3 scripts/serve.py# GPU PLE mode (~4.33 GiB VRAM)cargo run --release -p cellgemma-cli -- \ --model-dir models/cellgemma-e4b-q4 \ --dataset tahoe \ --max-new-tokens 128
# Or run natively via wgpu (Vulkan/Metal/DX12)cargo run --release -p cellgemma-cli -- --model-dir models/cellgemma-e4b-q4# CPU PLE offload mode (~2.74 GiB VRAM)cargo run --release -p cellgemma-cli -- \ --model-dir models/cellgemma-e4b-q4 \ --dataset tahoe \ --ple-cpu \ --max-new-tokens 128```README.md+57-7