Instructions to use amaye15/aimv2-large-patch14-native-image-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amaye15/aimv2-large-patch14-native-image-classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="amaye15/aimv2-large-patch14-native-image-classification", trust_remote_code=True) pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoProcessor, AutoModelForImageClassification processor = AutoProcessor.from_pretrained("amaye15/aimv2-large-patch14-native-image-classification", trust_remote_code=True) model = AutoModelForImageClassification.from_pretrained("amaye15/aimv2-large-patch14-native-image-classification", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling_aimv2.py
Browse files- modeling_aimv2.py +3 -4
modeling_aimv2.py
CHANGED
|
@@ -222,7 +222,7 @@ class AIMv2Model(AIMv2PretrainedModel):
|
|
| 222 |
hidden_states=hidden_states,
|
| 223 |
)
|
| 224 |
|
| 225 |
-
|
| 226 |
class AIMv2ForImageClassification(AIMv2PretrainedModel):
|
| 227 |
def __init__(self, config: AIMv2Config):
|
| 228 |
super().__init__(config)
|
|
@@ -310,9 +310,8 @@ class AIMv2ForImageClassification(AIMv2PretrainedModel):
|
|
| 310 |
hidden_states=outputs.hidden_states,
|
| 311 |
# attentions=outputs.attentions,
|
| 312 |
)
|
| 313 |
-
'''
|
| 314 |
-
|
| 315 |
|
|
|
|
| 316 |
class AIMv2ForImageClassification(AIMv2PretrainedModel):
|
| 317 |
def __init__(self, config: AIMv2Config):
|
| 318 |
print("Initializing AIMv2ForImageClassification")
|
|
@@ -390,5 +389,5 @@ class AIMv2ForImageClassification(AIMv2PretrainedModel):
|
|
| 390 |
loss=loss,
|
| 391 |
logits=logits,
|
| 392 |
hidden_states=outputs.hidden_states,
|
| 393 |
-
)
|
| 394 |
|
|
|
|
| 222 |
hidden_states=hidden_states,
|
| 223 |
)
|
| 224 |
|
| 225 |
+
|
| 226 |
class AIMv2ForImageClassification(AIMv2PretrainedModel):
|
| 227 |
def __init__(self, config: AIMv2Config):
|
| 228 |
super().__init__(config)
|
|
|
|
| 310 |
hidden_states=outputs.hidden_states,
|
| 311 |
# attentions=outputs.attentions,
|
| 312 |
)
|
|
|
|
|
|
|
| 313 |
|
| 314 |
+
'''
|
| 315 |
class AIMv2ForImageClassification(AIMv2PretrainedModel):
|
| 316 |
def __init__(self, config: AIMv2Config):
|
| 317 |
print("Initializing AIMv2ForImageClassification")
|
|
|
|
| 389 |
loss=loss,
|
| 390 |
logits=logits,
|
| 391 |
hidden_states=outputs.hidden_states,
|
| 392 |
+
)'''
|
| 393 |
|