Instructions to use nvidia/RFD4-Proteina-prep with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use nvidia/RFD4-Proteina-prep with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("nvidia/RFD4-Proteina-prep", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Add the annotated-CIF preparation and export package for the Diffusers RFD4-Proteina pipeline
75b53c6 verified Download tests/test_prepare.py from nvidia/RFD4-Proteina-prep: direct link, hf CLI and curl.
- Browser
- Download file 541 Bytes
-
https://huggingface.co/nvidia/RFD4-Proteina-prep/resolve/main/tests/test_prepare.py
- Command line
-
hf download hf://nvidia/RFD4-Proteina-prep/tests/test_prepare.py
-
curl -L -o test_prepare.py https://huggingface.co/nvidia/RFD4-Proteina-prep/resolve/main/tests/test_prepare.py
541 Bytes
| import importlib.util | |
| import pytest | |
| def test_missing_input_is_reported_before_any_work(tmp_path): | |
| pytest.importorskip("atomworks") | |
| import torch | |
| from rfd4_proteina_prep import prepare_cif | |
| with pytest.raises(FileNotFoundError): | |
| prepare_cif(tmp_path / "missing.cif", seed=0, device=torch.device("cpu")) | |
| def test_public_api(): | |
| import rfd4_proteina_prep | |
| assert set(rfd4_proteina_prep.__all__) == {"prepare_cif", "write_cif"} | |
| assert importlib.util.find_spec("rfd4_proteina_prep.processing") is not None | |