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 (3)
122434568978910{
"_name_or_path": "./efficientnet/temp",
"architectures": [
"EfficientNetModelForImageClassification"
"EfficientNetModel"
],
"auto_map": {
"AutoConfig": "configuration_efficientnet.EfficientNetConfig",
"AutoModel": "modeling_efficientnet.EfficientNetModel",
"AutoModelForImageClassification": "modeling_efficientnet.EfficientNetModelForImageClassification"
"AutoModel": "modeling_efficientnet.EfficientNetModel"
},
"model_name": "efficientnet_b0",
"model_type": "efficientnet",33 unmodified lines34353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110241103104105106107108484910911011133 unmodified lines
self.model_name = model_name
self.pretrained = pretrained
# add attributes
# "batch_norm_eps": 0.001,
# "batch_norm_momentum": 0.99,
# "depth_coefficient": 3.1,
# "depth_divisor": 8,
# "depthwise_padding": [],
# "drop_connect_rate": 0.2,
# "dropout_rate": 0.5,
# "expand_ratios": [
# 1,
# 6,
# 6
# ],
# "hidden_act": "gelu",
# "hidden_dim": 2560,
# "id2label": { IMAGE NET DATASET
# "0": "LABEL_0",
# "1": "LABEL_1",
# "2": "LABEL_2",
# ...
# },
# "image_size": 600,
# "in_channels": [
# 32,
# 16,
# 24
# ],
# "initializer_range": 0.02,
# "kernel_sizes": [
# 3,
# 3,
# 5
# ],
# "label2id": {
# "LABEL_0": 0,
# "LABEL_1": 1,
# "LABEL_2": 2,
# ...
# },
# "model_type": "efficientnet",
# "num_block_repeats": [
# 1,
# 1,
# 2
# ],
# "num_channels": 3,
# "num_hidden_layers": 16,
# "out_channels": [
# 16,
# 24,
# 40
# ],
# "pooling_type": "mean",
# "squeeze_expansion_ratio": 0.25,
# "strides": [
# 1,
# 1,
# 2
# ],
# "width_coefficient": 2.0
# }
super().__init__(**kwargs)
class EfficientNetOnnxConfig(ViTOnnxConfig):
@property
def outputs(self) -> Dict[str, Dict[int, str]]:
common_outputs = super().outputs
if self.task == "image-classification":
common_outputs["logits"] = {0: "batch_size", 1: "num_classes"}
elif self.task == "feature-extraction":
common_outputs["last_hidden_state"] = {0: "batch_size", 1: "num_features", 2: "height", 3: "width"}
return common_outputs
12 unmodified lines131415161718198 unmodified lines2829303132333412 unmodified lines def __init__(self, config):
super().__init__(config)
self.config = config
self.model = create_model(config.model_name, pretrained = config.pretrained)
def forward(self, pixel_values):8 unmodified lines def __init__(self, config):
super().__init__(config)
self.config = config
self.model = create_model(config.model_name, pretrained = config.pretrained)
def forward(self, pixel_values, labels=None):config.json+2-4
configuration_efficientnet.py+62-3
modeling_efficientnet.py+2