alirezamsh
commited on
Commit
·
c015035
1
Parent(s):
c7f0122
Update README.md
Browse files
README.md
CHANGED
@@ -162,14 +162,14 @@ tokenizer = SMALL100Tokenizer.from_pretrained("alirezamsh/small100")
|
|
162 |
# translate Hindi to French
|
163 |
tokenizer.tgt_lang = "fr"
|
164 |
encoded_hi = tokenizer(hi_text, return_tensors="pt")
|
165 |
-
generated_tokens = model.generate(**encoded_hi
|
166 |
tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
|
167 |
# => "La vie est comme une boîte de chocolat."
|
168 |
|
169 |
# translate Chinese to English
|
170 |
tokenizer.tgt_lang = "en"
|
171 |
encoded_zh = tokenizer(chinese_text, return_tensors="pt")
|
172 |
-
generated_tokens = model.generate(**encoded_zh
|
173 |
tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
|
174 |
# => "Life is like a box of chocolate."
|
175 |
```
|
|
|
162 |
# translate Hindi to French
|
163 |
tokenizer.tgt_lang = "fr"
|
164 |
encoded_hi = tokenizer(hi_text, return_tensors="pt")
|
165 |
+
generated_tokens = model.generate(**encoded_hi)
|
166 |
tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
|
167 |
# => "La vie est comme une boîte de chocolat."
|
168 |
|
169 |
# translate Chinese to English
|
170 |
tokenizer.tgt_lang = "en"
|
171 |
encoded_zh = tokenizer(chinese_text, return_tensors="pt")
|
172 |
+
generated_tokens = model.generate(**encoded_zh)
|
173 |
tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
|
174 |
# => "Life is like a box of chocolate."
|
175 |
```
|