File size: 1,321 Bytes
8813e41
 
446d936
ae6fa2d
 
 
 
 
 
8813e41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a03c4a7
8813e41
a03c4a7
 
 
 
 
 
 
 
 
 
 
9fa97d1
a03c4a7
 
 
9fa97d1
8813e41
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
license: mit
pipeline_tag: text-generation
datasets:
- EdinburghNLP/xsum
language:
- en
base_model:
- facebook/bart-large-xsum
---
# fine-tuned-bart-xsum

## Overview

**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.

## Model Details

- **Model Type:** facebook/bart-large-xsum
- **Training Dataset:** XSum (news summary dataset)
- **Training Process:** 
  - Optimized for efficiency with batch processing, mixed precision training, and dynamic padding.
  - Trained over 3 epochs with learning rate adjustments and evaluation every 500 steps.

## Usage
import torch

# Check if a GPU is available
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

# Move the model to the device
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)

# Generate summary
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: