Instructions to use facebook/sam3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/sam3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("mask-generation", model="facebook/sam3")# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("facebook/sam3") model = AutoModel.from_pretrained("facebook/sam3") - Notebooks
- Google Colab
- Kaggle
`mask-generation` pipeline tries to load missing `preprocessor_config.json`
#6
by Koddenbrock - opened
Issue
When using the SAM3 model through the Hugging Face mask-generation pipeline:
pipeline("mask-generation", model="facebook/sam3")
the pipeline fails on first load because it requests a file named preprocessor_config.json, which is not present in the facebook/sam3 repository.
Error
HEAD .../processor_config.json β 200 OK
HEAD .../preprocessor_config.json β 404 Not Found
Actual
Model load fails due to the pipeline unconditionally checking for preprocessor_config.json.
Reproduction Code
from transformers import pipeline
pipeline("mask-generation", model="facebook/sam3")
Hey @Koddenbrock ! Are you using the main branch of transformers? There's no transformers release which includes sam3, for now you'll have to use main.
We'll try to release a sam3-specific transformers release soon, as main is not very stable with transformers v5 approaching