abisee/cnn_dailymail
Viewer โข Updated โข 936k โข 75k โข 362
How to use VJ24/VJ_Bart_Large_CNN 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="VJ24/VJ_Bart_Large_CNN") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("VJ24/VJ_Bart_Large_CNN")
model = AutoModelForSeq2SeqLM.from_pretrained("VJ24/VJ_Bart_Large_CNN", device_map="auto")