Downloads · 30 days
20
6% of all-time downloads
MuntasirHossain/flan-t5-large-samsum-qlora
flan-t5-large-samsum-qlora is a machine learning model from MuntasirHossain. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
flan-t5-large-samsum-qlora is an LLM model adapter and a fine-tuned version of google/flan-t5-large on the samsum dataset containing dialoges. Parameter-efficient fine-tuning with QLoRA was employed to fine-tune the b…
Downloads · 30 days
20
6% of all-time downloads
All-time downloads
308
Public
Repo size
1.3 GB
Likes
0
Public
Click a slice to open those files.
.safetensors18.9 MB · 100%
From the Hugging Face model README
flan-t5-large-samsum-qlora is an LLM model adapter and a fine-tuned version of google/flan-t5-large on the samsum dataset containing dialoges. Parameter-efficient fine-tuning with QLoRA was employed to fine-tune the base model. The model is intended for generative summarization tasks and achieved the following scores on the test dataset:
Load the model:
from peft import PeftModel, PeftConfig
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, BitsAndBytesConfig
# Load the peft adapter model config
peft_model_id = 'MuntasirHossain/flan-t5-large-samsum-qlora'
peft_config = PeftConfig.from_pretrained(peft_model_id)
# load the base model and tokenizer
base_model = AutoModelForSeq2SeqLM.from_pretrained(peft_config.base_model_name_or_path, load_in_8bit=True, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(peft_config.base_model_name_or_path)
# Load the peft model
model = PeftModel.from_pretrained(base_model, peft_model_id, device_map="auto")
model.eval()
Example Inference:
# random sample text from the samsum test dataset
text = """
Emma: Hi, we're going with Peter to Amiens tomorrow.
Daniel: oh! Cool.
Emma: Wanna join?
Daniel: Sure, I'm fed up with Paris.
Emma: We're too. The noise, traffic etc. Would be nice to see some countrysides.
Daniel: I don't think Amiens is exactly countrysides though :P
Emma: Nope. Hahahah. But not a megalopolis either!
Daniel: Right! Let's do it!
Emma: But we should leave early. The days are shorter now.
Daniel: Yes, the stupid winter time.
Emma: Exactly!
Daniel: Where should we meet then?
Emma: Come to my place by 9am.
Daniel: oohhh. It means I have to get up before 7!
Emma: Yup. The early bird gets the worm (in Amiens).
Daniel: You sound like my grandmother.
Emma: HAHAHA. I'll even add: no parties tonight, no drinking dear Daniel
Daniel: I really hope Amiens is worth it!
"""
input = tokenizer(text, return_tensors="pt")
outputs = model.generate(input_ids=input["input_ids"].cuda(), max_new_tokens=40)
print("Summary: ", tokenizer.decode(outputs[0], skip_special_tokens=True))
Summary: Emma and Peter are going to Amiens tomorrow. Daniel will join them. They will meet at Emma's place by 9 am. They will not have any parties tonight.
The following hyperparameters were used during training: