Transformers
Safetensors
bart
text2text-generation
kobart-summarization-diary
Generated from Trainer
Instructions to use jjae/summarization-diary with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jjae/summarization-diary with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("jjae/summarization-diary") model = AutoModelForSeq2SeqLM.from_pretrained("jjae/summarization-diary") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -61,10 +61,10 @@ The following hyperparameters were used during training:
|
|
| 61 |
|
| 62 |
### How to Get Started with the Model
|
| 63 |
Use the code below to get started with the model. You can adjust hyperparameters to fit on your data.
|
| 64 |
-
|
| 65 |
def diary_summary(text):
|
| 66 |
input_ids = tokenizer.encode(text, return_tensors = 'pt').to(device)
|
| 67 |
summary_text_ids = model.generate(input_ids = input_ids, bos_token_id = model.config.bos_token_id, eos_token_id = model.config.eos_token_id,
|
| 68 |
length_penalty = 2.0, max_length = 150, num_beams = 2)
|
| 69 |
return tokenizer.decode(summary_text_ids[0], skip_special_tokens = True)
|
| 70 |
-
|
|
|
|
| 61 |
|
| 62 |
### How to Get Started with the Model
|
| 63 |
Use the code below to get started with the model. You can adjust hyperparameters to fit on your data.
|
| 64 |
+
```python
|
| 65 |
def diary_summary(text):
|
| 66 |
input_ids = tokenizer.encode(text, return_tensors = 'pt').to(device)
|
| 67 |
summary_text_ids = model.generate(input_ids = input_ids, bos_token_id = model.config.bos_token_id, eos_token_id = model.config.eos_token_id,
|
| 68 |
length_penalty = 2.0, max_length = 150, num_beams = 2)
|
| 69 |
return tokenizer.decode(summary_text_ids[0], skip_special_tokens = True)
|
| 70 |
+
```
|