Views
No views yet
google/flan-t5-xl (3B), frozenq, k, v, o, wi_0, wi_1, wo
(35.4M trainable parameters, 1.23% of the model)| Model | ROUGE-1 | ROUGE-2 | ROUGE-L |
|---|---|---|---|
| bart-large (run 1) | 38.2 | 14.12 | 25.47 |
| flan-t5-xl (run 2, this model) | 37.99 | 14.05 | 25.56 |
1gen_kwargs = {"num_beams": 4,
2 "length_penalty": 0.8,
3 "min_length": 30,
4 "no_repeat_ngram_size": 3,
5 "max_new_tokens": 128}1from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2from peft import PeftModel
3
4PREFIX = "Summarize the key research highlights of the following scientific abstract: "
5tok = AutoTokenizer.from_pretrained("google/flan-t5-xl")
6base = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-xl", dtype="bfloat16")
7model = PeftModel.from_pretrained(base, "namra07/RKMVNLP-scihigh-task1-flan-t5-xl-run2").cuda().eval()
8
9inputs = tok(PREFIX + abstract, return_tensors="pt", truncation=True, max_length=512).to("cuda")
10out = model.generate(**inputs, **gen_kwargs)
11print(tok.decode(out[0], skip_special_tokens=True))