Run this model with HF Jobs
Run Thastp/efficientnet_b0 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/Thastp/efficientnet_b0. 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/Thastp/efficientnet_b0 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 Thastp/efficientnet_b0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Thastp/efficientnet_b0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="Thastp/efficientnet_b0", trust_remote_code=True) pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("Thastp/efficientnet_b0", trust_remote_code=True) model = AutoModelForImageClassification.from_pretrained("Thastp/efficientnet_b0", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload model
Browse filesFiles changed (2)
123456789101112{"_name_or_path": "./efficientnet/temp","architectures": ["EfficientNetModelForImageClassification"],"auto_map": {"AutoConfig": "configuration_efficientnet.EfficientNetConfig","AutoModel": "modeling_efficientnet.EfficientNetModel","AutoModelForImageClassification": "modeling_efficientnet.EfficientNetModelForImageClassification"},"model_name": "efficientnet_b0","model_type": "efficientnet",12345678910{"architectures": ["EfficientNetModel"],"auto_map": {"AutoConfig": "configuration_efficientnet.EfficientNetConfig","AutoModel": "modeling_efficientnet.EfficientNetModel"},"model_name": "efficientnet_b0","model_type": "efficientnet",
1 unmodified line2345677 unmodified lines151617181920217 unmodified lines29303132333435361 unmodified linefrom functools import partialfrom transformers import PreTrainedModelfrom timm import create_modelfrom configuration_efficientnet import EfficientNetConfig7 unmodified linesself.model = create_model(config.model_name, pretrained = config.pretrained)def forward(self, pixel_values):return self.model.forward_features(pixel_values)class EfficientNetModelForImageClassification(PreTrainedModel):config_class = EfficientNetConfig7 unmodified lineslogits = self.model(pixel_values)if labels is not None:loss = nn.CrossEntropyLoss(logits, labels)return {"loss": loss, "logits": logits}return logits__all__ = ["EfficientNetModel",1 unmodified line23456787 unmodified lines161718192021222324257 unmodified lines333435363738394041421 unmodified linefrom functools import partialfrom transformers import PreTrainedModelfrom transformers.modeling_outputs import BaseModelOutputWithPoolingAndNoAttention, ImageClassifierOutputWithNoAttentionfrom timm import create_modelfrom configuration_efficientnet import EfficientNetConfig7 unmodified linesself.model = create_model(config.model_name, pretrained = config.pretrained)def forward(self, pixel_values):last_hidden_state = self.model.forward_features(pixel_values)return BaseModelOutputWithPoolingAndNoAttention(last_hidden_state = last_hidden_state)class EfficientNetModelForImageClassification(PreTrainedModel):config_class = EfficientNetConfig7 unmodified lineslogits = self.model(pixel_values)if labels is not None:loss = nn.CrossEntropyLoss(logits, labels)return ImageClassifierOutputWithNoAttention(loss = loss,logits = logits)__all__ = ["EfficientNetModel",
config.json+2-4
modeling_efficientnet.py+9-3