Downloads · 30 days
0
SilverGrace-26/fastvit-jax-weights
fastvit-jax-weights is a image classification model from SilverGrace-26. Use it when you need a label for an image. It is set up for fastvit-jax-weights. The card lists the license as other.
This repository provides weight porting and inference utilities for using Apple FastViT models in JAX/Flax.
Downloads · 30 days
0
Access
Public
Updated Jan 25, 2026
Repo size
494 MB
Likes
0
Public
Click a slice to open those files.
Other482 MB · 97%
From the Hugging Face model README
This repository provides weight porting and inference utilities for using Apple FastViT models in JAX/Flax.
This is not a reimplementation of FastViT and code does not cocnern with training.
If ou just want the weights, you can load a specific model variant (e.g., fastvit_sa12) directly from Python without cloning the repository.
Install dependencies:
pip install huggingface_hub flax orbax-checkpoint
Load the Model:
import sys
from huggingface_hub import snapshot_download
# Download code and specific model weights (skips other checkpoints)
repo_path = snapshot_download(
repo_id="SilverGrace-26/fastvit-jax-weights",
allow_patterns=[
"flax_models/**", # Downloads the model architecture code
"weights/orbax/fastvit_sa12/**" # Downloads ONLY the sa12 weights
]
)
# Add the downloaded folder to python path so we can import the model
sys.path.append(repo_path)
#Now import your code as if it were local
from flax_models.fastvit import FastViT
The original model was trained on ImageNet-1K but I have used ImageNette to validate due to its small size. This does not affect our parity testing. Users may use dataset of their own choice.
If you want to use the provided code to test the provided weights (you will need git lfs to clone the repo):
Extract the dataset with tar -xzf imagenette-320-val
Use the command :
uv run python inference_test_random.py --model {model_name} --load-orbaxuv run python inference_test_real.py --model {model_name} --dataset-dir /path/to/your/validation_set/if_not_default --load-orbaxTo make this repository self-contained and easy to test, three files
under pytorch_models/ are copied verbatim from Apple’s official FastViT
repository, with minimal modifications (import paths only).
These files are required for:
Each vendored file:
LICENSE)All other files in this repository are original.
At a high level, the process is:
This ensures that the JAX model is functionally equivalent to the original PyTorch model.