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 |
+
```
|