Image-to-Text
Transformers
PyTorch
Safetensors
vision-encoder-decoder
image-text-to-text
vision
nougat
Instructions to use facebook/nougat-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/nougat-base with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("image-to-text", model="facebook/nougat-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("facebook/nougat-base") model = AutoModelForMultimodalLM.from_pretrained("facebook/nougat-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit History
-
add handler.py for HF Dedicated Inference
Verified signatureThis PR adds a [Inference Handler](https://huggingface.co/docs/inference-endpoints/guides/custom_handler) to this model. This is required for using it in a HuggingFace Dedicated Endpoint, since this product does not has a Image-To-Text task available out-of-the-box. The handler implements the inference as described in the (model docs)[https://huggingface.co/docs/transformers/model_doc/nougat] but with the StoppingCriteria implemented on the notebook example.fc62d33