Instructions to use nvidia/C-RADIOv2-B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/C-RADIOv2-B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="nvidia/C-RADIOv2-B", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("nvidia/C-RADIOv2-B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update hf_model.py
Browse files- hf_model.py +2 -0
hf_model.py
CHANGED
|
@@ -97,6 +97,8 @@ class RADIOModel(PreTrainedModel):
|
|
| 97 |
|
| 98 |
def __init__(self, config: RADIOConfig):
|
| 99 |
super().__init__(config)
|
|
|
|
|
|
|
| 100 |
|
| 101 |
RADIOArgs = namedtuple("RADIOArgs", config.args.keys())
|
| 102 |
args = RADIOArgs(**config.args)
|
|
|
|
| 97 |
|
| 98 |
def __init__(self, config: RADIOConfig):
|
| 99 |
super().__init__(config)
|
| 100 |
+
if hasattr(super(), "post_init"):
|
| 101 |
+
super().post_init()
|
| 102 |
|
| 103 |
RADIOArgs = namedtuple("RADIOArgs", config.args.keys())
|
| 104 |
args = RADIOArgs(**config.args)
|