Downloads · 30 days
7
6% of all-time downloads
juliensimon/flan-t5-large-billsum-qlora
flan-t5-large-billsum-qlora is a summarization model from juliensimon. Use it when you need a shorter version of a longer text. It is set up for peft.
A Flan-T5 Large model fine-tuned with QLoRA (8-bit quantization) for summarizing US Congressional bills using the BillSum dataset.
Downloads · 30 days
7
6% of all-time downloads
All-time downloads
127
Public
Repo size
19.8 MB
Likes
0
Public
Click a slice to open those files.
.bin19 MB · 85%
From the Hugging Face model README
A Flan-T5 Large model fine-tuned with QLoRA (8-bit quantization) for summarizing US Congressional bills using the BillSum dataset.
Video walkthrough: Parameter-efficient fine-tuning with QLoRA and Hugging Face
| Detail | Value |
|---|---|
| Base model | google/flan-t5-large |
| Task | Text summarization |
| Dataset | BillSum (US Congressional bills) |
| Method | QLoRA with 8-bit quantization (bitsandbytes) |
| Framework | PEFT 0.5.0 |
| Parameter | Value |
|---|---|
quant_method | bitsandbytes |
load_in_8bit | True |
llm_int8_threshold | 6.0 |
from peft import PeftModel
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
base_model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-large", load_in_8bit=True)
model = PeftModel.from_pretrained(base_model, "juliensimon/flan-t5-large-billsum-qlora")
tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-large")
text = "Summarize: " + bill_text
inputs = tokenizer(text, return_tensors="pt", max_length=512, truncation=True)
outputs = model.generate(**inputs, max_new_tokens=150)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))