RoshanAdhithya/autotrain-data-finalbartmodel
Preview • Updated • 11
How to use RoshanAdhithya/bart-final-image-captioning with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "summarization" 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("summarization", model="RoshanAdhithya/bart-final-image-captioning") # Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("RoshanAdhithya/bart-final-image-captioning")
model = AutoModelForSeq2SeqLM.from_pretrained("RoshanAdhithya/bart-final-image-captioning")# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("RoshanAdhithya/bart-final-image-captioning")
model = AutoModelForSeq2SeqLM.from_pretrained("RoshanAdhithya/bart-final-image-captioning")You can use cURL to access this model:
$ curl -X POST -H "Authorization: Bearer YOUR_HUGGINGFACE_API_KEY" -H "Content-Type: application/json" -d '{"inputs": "I love AutoTrain"}' https://api-inference.huggingface.co/RoshanAdhithya/autotrain-finalbartmodel-51879122579
# Use a pipeline as a high-level helper # Warning: Pipeline type "summarization" 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("summarization", model="RoshanAdhithya/bart-final-image-captioning")