Update README.md
Browse files
README.md
CHANGED
@@ -25,8 +25,8 @@ Our work represents a significant advancement in the field of machine translatio
|
|
25 |
### On GPU
|
26 |
```python
|
27 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
28 |
-
tokenizer = AutoTokenizer.from_pretrained("minhtoan/t5-translate-lao
|
29 |
-
model = AutoModelForSeq2SeqLM.from_pretrained("minhtoan/t5-translate-lao
|
30 |
model.cuda()
|
31 |
src = "Tôi muốn mua một cuốn sách"
|
32 |
tokenized_text = tokenizer.encode(src, return_tensors="pt").cuda()
|
@@ -40,8 +40,8 @@ output
|
|
40 |
### On CPU
|
41 |
```python
|
42 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
43 |
-
tokenizer = AutoTokenizer.from_pretrained("minhtoan/t5-translate-lao
|
44 |
-
model = AutoModelForSeq2SeqLM.from_pretrained("minhtoan/t5-translate-lao
|
45 |
src = "Tôi muốn mua một cuốn sách"
|
46 |
input_ids = tokenizer(src, max_length=200, return_tensors="pt", padding="max_length", truncation=True).input_ids
|
47 |
outputs = model.generate(input_ids=input_ids, max_new_tokens=200)
|
|
|
25 |
### On GPU
|
26 |
```python
|
27 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
28 |
+
tokenizer = AutoTokenizer.from_pretrained("minhtoan/t5-translate-vietnamese-lao")
|
29 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("minhtoan/t5-translate-vietnamese-lao")
|
30 |
model.cuda()
|
31 |
src = "Tôi muốn mua một cuốn sách"
|
32 |
tokenized_text = tokenizer.encode(src, return_tensors="pt").cuda()
|
|
|
40 |
### On CPU
|
41 |
```python
|
42 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
43 |
+
tokenizer = AutoTokenizer.from_pretrained("minhtoan/t5-translate-vietnamese-lao")
|
44 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("minhtoan/t5-translate-vietnamese-lao")
|
45 |
src = "Tôi muốn mua một cuốn sách"
|
46 |
input_ids = tokenizer(src, max_length=200, return_tensors="pt", padding="max_length", truncation=True).input_ids
|
47 |
outputs = model.generate(input_ids=input_ids, max_new_tokens=200)
|