Feature Extraction
Transformers
Safetensors
virtual_cell_patient
biology
genomics
single-cell-rna-seq
patient-classification
custom_code
Instructions to use ConvergeBio/virtual-cell-patient with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ConvergeBio/virtual-cell-patient with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="ConvergeBio/virtual-cell-patient", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ConvergeBio/virtual-cell-patient", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling_virtual_cell.py
Browse files- modeling_virtual_cell.py +0 -17
modeling_virtual_cell.py
CHANGED
|
@@ -1,18 +1,3 @@
|
|
| 1 |
-
"""
|
| 2 |
-
Virtual Cell Patient Model — HuggingFace release.
|
| 3 |
-
|
| 4 |
-
Architecture: PaSCient (Cui et al., 2025). ConvergeBio contribution: training
|
| 5 |
-
recipe, data scale, and model parameters.
|
| 6 |
-
|
| 7 |
-
Usage:
|
| 8 |
-
from transformers import AutoModel
|
| 9 |
-
model = AutoModel.from_pretrained(
|
| 10 |
-
"ConvergeBio/virtual-cell-patient", trust_remote_code=True
|
| 11 |
-
)
|
| 12 |
-
# input_ids: [batch, num_cells, num_genes] float32 log-normalized expression
|
| 13 |
-
out = model(input_ids=x) # out.logits: [batch, num_classes]
|
| 14 |
-
"""
|
| 15 |
-
|
| 16 |
from typing import List, Optional
|
| 17 |
|
| 18 |
import torch
|
|
@@ -94,8 +79,6 @@ class MLP(nn.Module):
|
|
| 94 |
|
| 95 |
|
| 96 |
class MLPCellEmbedder(nn.Module):
|
| 97 |
-
# Thin wrapper that preserves the .encoder attribute name required
|
| 98 |
-
# for state-dict key compatibility with the checkpoint.
|
| 99 |
def __init__(
|
| 100 |
self,
|
| 101 |
n_genes: int,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from typing import List, Optional
|
| 2 |
|
| 3 |
import torch
|
|
|
|
| 79 |
|
| 80 |
|
| 81 |
class MLPCellEmbedder(nn.Module):
|
|
|
|
|
|
|
| 82 |
def __init__(
|
| 83 |
self,
|
| 84 |
n_genes: int,
|