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 lines347348349350351352353346 unmodified lines"AutoConfig": "hf_model.RADIOConfig","AutoModel": "hf_model.RADIOModel"},"external_conditioner": false,"max_resolution": 2048,"patch_size": 16,"preferred_resolution": [346 unmodified lines347348349350351352346 unmodified lines"AutoConfig": "hf_model.RADIOConfig","AutoModel": "hf_model.RADIOModel"},"max_resolution": 2048,"patch_size": 16,"preferred_resolution": [
44 unmodified lines4546474849505112 unmodified lines6465666768697046 unmodified lines11711811912012112212344 unmodified linespreferred_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_namesself.vitdet_window_size = vitdet_window_sizeself.external_conditioner = external_conditionersuper().__init__(**kwargs)46 unmodified linespreferred_resolution=config.preferred_resolution,adaptors=adaptors,)self.radio_model._external_conditioner = config.external_conditioner@propertydef adaptors(self) -> nn.ModuleDict:44 unmodified lines45464748495012 unmodified lines63646566676846 unmodified lines11511611711811912044 unmodified linespreferred_resolution: Optional[Resolution] = None,adaptor_names: Union[str, List[str]] = None,vitdet_window_size: Optional[int] = None,**kwargs,):self.args = args12 unmodified lines)self.adaptor_names = adaptor_namesself.vitdet_window_size = vitdet_window_sizesuper().__init__(**kwargs)46 unmodified linespreferred_resolution=config.preferred_resolution,adaptors=adaptors,)@propertydef adaptors(self) -> nn.ModuleDict:
50 unmodified lines51525354555657585960616256 unmodified lines11912012112212312412512650 unmodified linesself._patch_size = patch_sizeself._max_resolution = max_resolutionself._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 = Falseadaptors = 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)y = self.model.forward_features(x)if isinstance(self.model, VisionTransformer):50 unmodified lines51525354555656 unmodified lines11311411511611711811950 unmodified linesself._patch_size = patch_sizeself._max_resolution = max_resolutionself._window_size = window_sizeadaptors = 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:])}')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