Downloads · 30 days
0
philschmid/flan-t5-xxl-samsum-peft
flan-t5-xxl-samsum-peft is a machine learning model from philschmid. 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 transformers. The card lists the license as apache-2.0.
Downloads · 30 days
0
Access
Public
Updated Mar 18, 2023
Repo size
75.6 MB
Likes
3
Public
Click a slice to open those files.
.bin75.6 MB · 97%
From the Hugging Face model README
samsumPEFT tuned FLAN-T5 XXL model.
This model is a fine-tuned version of philschmid/flan-t5-xxl-sharded-fp16 on the samsum dataset. It achieves the following results on the evaluation set:
rogue1: 50.386161%
rouge2: 24.842412%
rougeL: 41.370130%
rougeLsum: 41.394230%
The model was trained using 🤗 PEFT. This repository only contains the fine-tuned adapter weights for LoRA and the configuration to load the model. Below you can find a snippet on how to run inference using the model. This will load the FLAN-T5-XXL from hugging face if not existing locally.
import torch
from peft import PeftModel, PeftConfig
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
# Load peft config for pre-trained checkpoint etc.
peft_model_id = "philschmid/flan-t5-xxl-samsum-peft"
config = PeftConfig.from_pretrained(peft_model_id)
# load base LLM model and tokenizer
model = AutoModelForSeq2SeqLM.from_pretrained(config.base_model_name_or_path, load_in_8bit=True, device_map={"":0})
tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
# Load the Lora model
model = PeftModel.from_pretrained(model, peft_model_id, device_map={"":0})
model.eval()
text = "test"
input_ids = tokenizer(text, return_tensors="pt", truncation=True).input_ids.cuda()
outputs = model.generate(input_ids=input_ids, max_new_tokens=10, do_sample=True, top_p=0.9)
print(tokenizer.batch_decode(outputs.detach().cpu().numpy(), skip_special_tokens=True)[0])
The following hyperparameters were used during training: