Instructions to use Saving-Willy/template_classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Saving-Willy/template_classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="Saving-Willy/template_classifier") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Saving-Willy/template_classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| from transformers import PreTrainedModel | |
| from .configuration_cetacean_classifier import TemplateClassifierConfig | |
| from .model import TemplateClassifier | |
| class TemplateClassifierModelForImageClassification(PreTrainedModel): | |
| config_class = TemplateClassifierConfig | |
| def __init__(self, config): | |
| super().__init__(config) | |
| self.model = TemplateClassifier(config=config.to_dict()) | |
| self.model.eval() | |
| def forward(self, model_input): | |
| predictions = self.model(model_input) | |
| return {"predictions": predictions} | |