EdinburghNLP/xsum
Viewer • Updated • 227k • 34.7k • 145
fine-tuned-bart-xsum is a fine-tuned version of the facebook/bart-large-xsum model specifically tailored for narrative text generation from given prompts. This model was trained on the xsum dataset, focusing on generating coherent and contextually appropriate text.
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device) input_text = "tell me joke with bbc" input_ids = tokenizer(input_text, return_tensors="pt").input_ids input_ids = input_ids.to(device)
output = model.generate(input_ids, max_length=50, num_beams=4, early_stopping=True)
generated_summary = tokenizer.decode(output[0], skip_special_tokens=True)
print(generated_summary)
To use this model for text generation:
Base model
facebook/bart-large-xsum