Run this model with HF Jobs
Run nvidia/mit-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/nvidia/mit-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/nvidia/mit-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 nvidia/mit-b0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/mit-b0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="nvidia/mit-b0") 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("nvidia/mit-b0") model = AutoModelForImageClassification.from_pretrained("nvidia/mit-b0", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Example of loading pretrained model from local directory only
I am trying to containerize and fine-tune SegFormer model so I want to load the pre-trained from local folder only but this code SegformerForSemanticSegmentation.from_pretrained( pretrained_model_name_or_path=PATH, local_files_only=True, num_labels=num_classes, ) give me error huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '/home/ellen/pretrained/mit-b0'. Use 'repo_type' argument if needed.
Found the solution, the PATH should be the absolute path os.path.join(os.path.dirname(__file__), RELATIVE_FOLDER_PATH)