Run this model with HF Jobs
Run google/cellgemma-e4b on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/google/cellgemma-e4b. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/google/cellgemma-e4b on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/google/cellgemma-e4b. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/google/cellgemma-e4b. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use google/cellgemma-e4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/cellgemma-e4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="google/cellgemma-e4b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("google/cellgemma-e4b") model = AutoModelForCausalLM.from_pretrained("google/cellgemma-e4b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use google/cellgemma-e4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "google/cellgemma-e4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "google/cellgemma-e4b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/google/cellgemma-e4b
- SGLang
How to use google/cellgemma-e4b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "google/cellgemma-e4b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "google/cellgemma-e4b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "google/cellgemma-e4b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "google/cellgemma-e4b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use google/cellgemma-e4b with Docker Model Runner:
docker model run hf.co/google/cellgemma-e4b
Clarify the untreated control used to score Pearson Δ
Section M.3.1 says the no-change predictor returns the paired untreated profile. Section M.3.3.2 uses the same control mean in the predicted and observed deltas. If the predicted untreated mean equals that reference, the predicted delta is all zeros and Pearson correlation is undefined. The raw CC column in Table A.9 is nonzero in 31 of 32 settings and ranges from −0.109 to 0.048. Control baseline · Pearson Δ · Table A.9
I did the following arithmetic on the public reported values only. Applying Equation M.13 row by row with the printed CC values and averaging reproduces 48.92% for CellGemma and 32.71% for mean shift. Setting the CC score to a numeric 0 in every row instead gives 48.59% and 32.35%. Equation M.13
Here is a four-gene example and the calculation for the first table row.
from statistics import StatisticsError, correlation
control = (2, 4, 6, 8)
treated = (3, 3, 7, 7)
observed_delta = tuple(t - c for t, c in zip(treated, control))
try:
correlation((0, 0, 0, 0), observed_delta)
except StatisticsError as error:
print(error) # at least one of the inputs is constant
# Table A.9, first row (Tahoe-100M, unseen perturbation/cell)
model, mean_shift, upper, control_score = 0.759, 0.564, 0.957, 0.013
for value in (model, mean_shift):
print(round((value - control_score) / (upper - control_score), 5))
# 0.79025 and 0.58369
Which untreated cells or pseudobulks were in the no-change prediction and the Pearson Δ reference, and how were constant deltas handled? I would appreciate enough detail to reproduce the CC column.
🤖 Generated with Claude Code