Run this model with HF Jobs
Run nvidia/RADIO 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 to fine-tune https://huggingface.co/nvidia/RADIO. 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/nvidia/RADIO 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.
Instructions to use nvidia/RADIO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/RADIO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="nvidia/RADIO", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("nvidia/RADIO", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Un-fix double conditioning. It wasn't a problem before.
#7
by mranzinger - opened
Files changed (3)
346 unmodified lines347348349350350351352346 unmodified lines "AutoConfig": "hf_model.RADIOConfig", "AutoModel": "hf_model.RADIOModel" }, "external_conditioner": false, "max_resolution": 2048, "patch_size": 16, "preferred_resolution": [44 unmodified lines4546474848495012 unmodified lines6364656766676846 unmodified lines11511611712011811912044 unmodified lines preferred_resolution: Optional[Resolution] = None, adaptor_names: Union[str, List[str]] = None, vitdet_window_size: Optional[int] = None, external_conditioner: Optional[bool] = False, **kwargs, ): self.args = args12 unmodified lines ) self.adaptor_names = adaptor_names self.vitdet_window_size = vitdet_window_size self.external_conditioner = external_conditioner super().__init__(**kwargs)
46 unmodified lines preferred_resolution=config.preferred_resolution, adaptors=adaptors, ) self.radio_model._external_conditioner = config.external_conditioner
@property def adaptors(self) -> nn.ModuleDict:50 unmodified lines51525354555657585954555656 unmodified lines11311411512212311611711811950 unmodified lines self._patch_size = patch_size self._max_resolution = max_resolution self._window_size = window_size # This is a hack workaround for huggingface, since their # data prep is annoying and complicated. If set to true, # then will not call `self.input_conditioner` on the # input tensor. This will be set in `hf_model.RADIOModel` # where appropriate. self._external_conditioner = False
adaptors = adaptors or dict() self.adaptors = nn.ModuleDict(adaptors)56 unmodified lines '`self.get_nearest_supported_resolution(<height>, <width>) is provided as a convenience API. ' f'Input: {x.shape[-2:]}, Nearest: {self.get_nearest_supported_resolution(*x.shape[-2:])}')
if not self._external_conditioner: x = self.input_conditioner(x) x = self.input_conditioner(x) y = self.model.forward_features(x)
if isinstance(self.model, VisionTransformer):config.json-1
hf_model.py-3
radio_model.py+1-8