Instructions to use hf-internal-testing/tiny-random-vit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hf-internal-testing/tiny-random-vit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="hf-internal-testing/tiny-random-vit") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("hf-internal-testing/tiny-random-vit") model = AutoModelForImageClassification.from_pretrained("hf-internal-testing/tiny-random-vit") - Inference
- Notebooks
- Google Colab
- Kaggle
Add free_dimension_overrides
#4
by captainspock - opened
Based on https://github.com/huggingface/transformers.js/blob/main/src/models.js#L239 , WebNN requires free_dimension_overrides to be set in config.json as a field within "transformers.js_config".
Based on https://github.com/huggingface/transformers.js/pull/1276 and further discussions, will prioritize some of the more popular models, and make automated PRs for models which ordinarily only support static shapes. Need to close this PR.