Document the Transformers checkpoint and its current limits
Browse filesTransformers generation is supported from the transformers/ subfolder. Partial diffusion and inverse folding are not: they call the autoencoder's encoder, and rfd4-proteina-prep does not yet emit incident_bond_type_counts or ground_truth_element. Ligand and atomized inputs stop with an error rather than conditioning on unaligned geometry. Diffusers remains on the previous release.
README.md
CHANGED
|
@@ -33,7 +33,7 @@ the root are the *native* weights, loaded by `Proteina.from_pretrained`.
|
|
| 33 |
| Call | Weights | Location | Status |
|
| 34 |
|---|---|---|---|
|
| 35 |
| `Proteina.from_pretrained("nvidia/RFD4-Proteina")` | Native | root of this repo | **Supported** |
|
| 36 |
-
| `Rfd4ProteinaModel.from_pretrained("nvidia/RFD4-Proteina", subfolder="transformers")` | Transformers | `transformers/` here |
|
| 37 |
| `RFD4ProteinaPipeline.from_pretrained("nvidia/RFD4-Proteina-Diffusers")` | Diffusers | [its own repo](https://huggingface.co/nvidia/RFD4-Proteina-Diffusers) | Pending; still serves the previous release |
|
| 38 |
|
| 39 |
It is one model throughout — nothing is retrained. The Diffusers weights are the same tensors
|
|
@@ -45,11 +45,18 @@ Diffusers needs `model_index.json` at the root of whatever it is pointed at, so
|
|
| 45 |
repository. Annotated-CIF preprocessing for both libraries is in
|
| 46 |
[`nvidia/RFD4-Proteina-prep`](https://huggingface.co/nvidia/RFD4-Proteina-prep).
|
| 47 |
|
| 48 |
-
> **
|
| 49 |
-
>
|
| 50 |
-
>
|
| 51 |
-
>
|
| 52 |
-
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
Training data lives in the companion [dataset repository](https://huggingface.co/datasets/nvidia/RFD4-Proteina).
|
| 55 |
|
|
@@ -177,17 +184,35 @@ print(list(Path("runs/enzyme/inference_samples").rglob("*_generated.cif*")))
|
|
| 177 |
|
| 178 |
`from_pretrained` loads in evaluation mode on CPU by default; `run_generation` uses the native CUDA inference workflow. A local exported bundle directory also works as the model argument.
|
| 179 |
|
| 180 |
-
### Transformers
|
| 181 |
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
|
| 189 |
-
|
| 190 |
-
today, [`nvidia/RFD4-Proteina-Diffusers`](https://huggingface.co/nvidia/RFD4-Proteina-Diffusers)
|
| 191 |
still serves the **previous** release pair — a different model from this one, with its own
|
| 192 |
`provenance.json` recording which native revision it came from.
|
| 193 |
|
|
|
|
| 33 |
| Call | Weights | Location | Status |
|
| 34 |
|---|---|---|---|
|
| 35 |
| `Proteina.from_pretrained("nvidia/RFD4-Proteina")` | Native | root of this repo | **Supported** |
|
| 36 |
+
| `Rfd4ProteinaModel.from_pretrained("nvidia/RFD4-Proteina", subfolder="transformers")` | Transformers | `transformers/` here | **Supported**, with limits below |
|
| 37 |
| `RFD4ProteinaPipeline.from_pretrained("nvidia/RFD4-Proteina-Diffusers")` | Diffusers | [its own repo](https://huggingface.co/nvidia/RFD4-Proteina-Diffusers) | Pending; still serves the previous release |
|
| 38 |
|
| 39 |
It is one model throughout — nothing is retrained. The Diffusers weights are the same tensors
|
|
|
|
| 45 |
repository. Annotated-CIF preprocessing for both libraries is in
|
| 46 |
[`nvidia/RFD4-Proteina-prep`](https://huggingface.co/nvidia/RFD4-Proteina-prep).
|
| 47 |
|
| 48 |
+
> **Diffusers is not updated yet.** `nvidia/RFD4-Proteina-Diffusers` still holds the **previous**
|
| 49 |
+
> release (33-class vocabulary, 16-dimensional latent) — following its examples gives you the
|
| 50 |
+
> previous model, not this one.
|
| 51 |
+
>
|
| 52 |
+
> **The Transformers checkpoint supports generation only, for now.** Preparing an annotated CIF
|
| 53 |
+
> uses [`rfd4-proteina-prep`](https://huggingface.co/nvidia/RFD4-Proteina-prep), which does not
|
| 54 |
+
> yet emit two features the unified autoencoder's encoder needs
|
| 55 |
+
> (`incident_bond_type_counts`, `ground_truth_element`). Plain generation only calls the decoder
|
| 56 |
+
> and works; **partial diffusion and inverse folding call the encoder and will fail.** Ligand and
|
| 57 |
+
> atomized inputs also stop with a clear error rather than conditioning on unaligned geometry,
|
| 58 |
+
> because chirality alignment needs fields prep does not emit. The published prep release also
|
| 59 |
+
> pins `atomworks==3.0.1` and is not yet updated for the 3.0.3 this release uses.
|
| 60 |
|
| 61 |
Training data lives in the companion [dataset repository](https://huggingface.co/datasets/nvidia/RFD4-Proteina).
|
| 62 |
|
|
|
|
| 184 |
|
| 185 |
`from_pretrained` loads in evaluation mode on CPU by default; `run_generation` uses the native CUDA inference workflow. A local exported bundle directory also works as the model argument.
|
| 186 |
|
| 187 |
+
### Transformers
|
| 188 |
|
| 189 |
+
```bash
|
| 190 |
+
pip install transformers git+https://huggingface.co/nvidia/RFD4-Proteina-prep
|
| 191 |
+
```
|
| 192 |
+
|
| 193 |
+
```python
|
| 194 |
+
import torch
|
| 195 |
+
from rfd4_proteina_prep import prepare_cif, write_cif
|
| 196 |
+
from transformers import Rfd4ProteinaModel
|
| 197 |
+
|
| 198 |
+
model = Rfd4ProteinaModel.from_pretrained(
|
| 199 |
+
"nvidia/RFD4-Proteina", subfolder="transformers", dtype=torch.bfloat16, device_map="cuda:0"
|
| 200 |
+
)
|
| 201 |
+
features, atoms = prepare_cif("input.cif", seed=42, device=model.device)
|
| 202 |
+
output = model.sample(features, generator=[torch.Generator("cuda:0").manual_seed(42)])
|
| 203 |
+
write_cif(output, features, atoms, "design.cif")
|
| 204 |
+
```
|
| 205 |
+
|
| 206 |
+
`subfolder="transformers"` is required: a Transformers export writes `config.json` and
|
| 207 |
+
`model.safetensors`, the names the native bundle already occupies at the root. The sampler
|
| 208 |
+
settings (`sampler_args`, `recycle_depths`) are part of the config, not the weights, and this
|
| 209 |
+
checkpoint records the recipe resolved from the native inference config — 60 steps, 185 trunk
|
| 210 |
+
passes, matching `recycle_strategy=thinking_medium`. See the limits in the banner above:
|
| 211 |
+
generation works; partial diffusion and inverse folding do not yet.
|
| 212 |
+
|
| 213 |
+
### Diffusers
|
| 214 |
|
| 215 |
+
Not updated for this release. [`nvidia/RFD4-Proteina-Diffusers`](https://huggingface.co/nvidia/RFD4-Proteina-Diffusers)
|
|
|
|
| 216 |
still serves the **previous** release pair — a different model from this one, with its own
|
| 217 |
`provenance.json` recording which native revision it came from.
|
| 218 |
|