abisee/cnn_dailymail
Viewer • Updated • 936k • 240k • 345
How to use lityops/Abstractive-Style-Summarizer with PEFT:
from peft import PeftModel
from transformers import AutoModelForSeq2SeqLM
base_model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-base")
model = PeftModel.from_pretrained(base_model, "lityops/Abstractive-Style-Summarizer")How to use lityops/Abstractive-Style-Summarizer 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="lityops/Abstractive-Style-Summarizer") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("lityops/Abstractive-Style-Summarizer", dtype="auto")This model is a fine-tuned version of google/flan-t5-base using PEFT (LoRA). It is designed to generate abstractive summaries in three distinct styles: Harsh (concise), Balanced (standard), and Detailed (comprehensive).
The model interprets a prefixed prompt to determine the style of the summary.
The input text should be prefixed with the desired style:
Summarize {Style}: {Input Text}
Example: Summarize Harsh: The Walt Disney Co. announced...
The model was trained on a combined dataset of 12,000 samples, split into 80% Train, 10% Validation, and 10% Test.
| Style | Source Dataset | Size |
|---|---|---|
| Harsh | XSum | 4000 |
| Balanced | CNN/DailyMail | 4000 |
| Detailed | Multi-News | 4000 |
Evaluated on the held-out test set (1,200 samples) at Step 6000.
| Metric | Score |
|---|---|
| ROUGE-1 | 0.3925 |
| ROUGE-2 | 0.1608 |
| ROUGE-L | 0.2776 |
| Validation Loss | 0.7824 |