Image Classification
Transformers
Safetensors
English
custom_vit_nano
vit
nano
patch16
img224
custom_code
Instructions to use kd13/vit-nano-patch16-224 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kd13/vit-nano-patch16-224 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="kd13/vit-nano-patch16-224", trust_remote_code=True) pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoModelForImageClassification model = AutoModelForImageClassification.from_pretrained("kd13/vit-nano-patch16-224", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling_vit.py
Browse files- modeling_vit.py +1 -1
modeling_vit.py
CHANGED
|
@@ -134,7 +134,7 @@ class Block(nn.Module):
|
|
| 134 |
return x
|
| 135 |
|
| 136 |
class CustomViTNanoPreTrainedModel(PreTrainedModel):
|
| 137 |
-
config_class =
|
| 138 |
base_model_prefix = "custom_vit"
|
| 139 |
main_input_name = "pixel_values"
|
| 140 |
_no_split_modules = ["Block"]
|
|
|
|
| 134 |
return x
|
| 135 |
|
| 136 |
class CustomViTNanoPreTrainedModel(PreTrainedModel):
|
| 137 |
+
config_class = CustomViTNanoConfig
|
| 138 |
base_model_prefix = "custom_vit"
|
| 139 |
main_input_name = "pixel_values"
|
| 140 |
_no_split_modules = ["Block"]
|