update generation example
Browse files
README.md
CHANGED
@@ -16,8 +16,8 @@ tokenizer = AutoTokenizer.from_pretrained("a1noack/bart-large-gigaword")
|
|
16 |
- To achieve these results, generate text using the code below. `text_list` is a list of input text string.
|
17 |
```
|
18 |
input_ids_list = tokenizer(text_list, truncation=True, max_length=128,
|
19 |
-
|
20 |
output_ids_list = model.generate(input_ids_list, min_length=0)
|
21 |
outputs_list = tokenizer.batch_decode(output_ids_list, skip_special_tokens=True,
|
22 |
-
|
23 |
```
|
|
|
16 |
- To achieve these results, generate text using the code below. `text_list` is a list of input text string.
|
17 |
```
|
18 |
input_ids_list = tokenizer(text_list, truncation=True, max_length=128,
|
19 |
+
return_tensors='pt', padding=True)['input_ids']
|
20 |
output_ids_list = model.generate(input_ids_list, min_length=0)
|
21 |
outputs_list = tokenizer.batch_decode(output_ids_list, skip_special_tokens=True,
|
22 |
+
clean_up_tokenization_spaces=False)
|
23 |
```
|