kmfoda/booksum
Viewer • Updated • 12.5k • 2.41k • 80
How to use pszemraj/long-t5-tglobal-large-pubmed-3k-booksum-16384-WIP 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="pszemraj/long-t5-tglobal-large-pubmed-3k-booksum-16384-WIP") # Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("pszemraj/long-t5-tglobal-large-pubmed-3k-booksum-16384-WIP")
model = AutoModelForSeq2SeqLM.from_pretrained("pszemraj/long-t5-tglobal-large-pubmed-3k-booksum-16384-WIP", device_map="auto")# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("pszemraj/long-t5-tglobal-large-pubmed-3k-booksum-16384-WIP")
model = AutoModelForSeq2SeqLM.from_pretrained("pszemraj/long-t5-tglobal-large-pubmed-3k-booksum-16384-WIP", device_map="auto")NOTE: this is still a work-in-progress (WIP) and not completed/converged by any means, but sharing to maybe save some time for others :)
As I update this WIP checkpoint, I will post a note here.
base variantkmfoda/booksum for about 26 epochs
# 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="pszemraj/long-t5-tglobal-large-pubmed-3k-booksum-16384-WIP")