vit-cifar10
This is a Vision Transformer model trained on the CIFAR-10 dataset.
Model description
The model architecture is defined in model.py. The configuration is in config.json.
How to use
To use this model, you'll need to have model.py in your working directory.
from huggingface_hub import hf_hub_download
import torch
from model import VisionTransformer
import json
# Your repository ID
repo_id = "heissanjay/vit-cifar10"
# Download model files
config_path = hf_hub_download(repo_id=repo_id, filename="config.json")
model_path = hf_hub_download(repo_id=repo_id, filename="pytorch_model.bin")
# You also need to download model.py or have it locally
# hf_hub_download(repo_id=repo_id, filename="model.py")
# Load config
with open(config_path) as f:
config = json.load(f)
# Instantiate model
model = VisionTransformer(**config)
model.load_state_dict(torch.load(model_path))
# Now you can use the model for inference
- Downloads last month
- 2
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
๐
Ask for provider support