huseinzol05
commited on
Commit
•
f22668b
1
Parent(s):
ff69d8c
Update README.md
Browse files
README.md
CHANGED
@@ -22,5 +22,7 @@ model = T5ForConditionalGeneration.from_pretrained(
|
|
22 |
s = 'Hai, ada yang bisa saya bantu?'
|
23 |
input_ids = tokenizer.encode(f'terjemah ke Melayu: {s}', return_tensors = 'pt')
|
24 |
outputs = model.generate(input_ids, max_length = 100)
|
25 |
-
|
|
|
|
|
26 |
```
|
|
|
22 |
s = 'Hai, ada yang bisa saya bantu?'
|
23 |
input_ids = tokenizer.encode(f'terjemah ke Melayu: {s}', return_tensors = 'pt')
|
24 |
outputs = model.generate(input_ids, max_length = 100)
|
25 |
+
all_special_ids = [0, 1, 2]
|
26 |
+
outputs = [i for i in outputs[0] if i not in all_special_ids]
|
27 |
+
print(tokenizer.decode(outputs, spaces_between_special_tokens = False))
|
28 |
```
|