Update README.md
Browse files
README.md
CHANGED
@@ -17,13 +17,14 @@ To initialize the model:
|
|
17 |
|
18 |
from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
|
19 |
model = MBartForConditionalGeneration.from_pretrained("MRNH/mbart-russian-grammar-corrector")
|
20 |
-
|
21 |
-
|
22 |
-
To generate text using the model:
|
23 |
|
|
|
24 |
|
25 |
tokenizer = MBart50TokenizerFast.from_pretrained("MRNH/mbart-russian-grammar-corrector", src_lang="ru_RU", tgt_lang="ru_RU")
|
26 |
input = tokenizer("I was here yesterday to studying",text_target="I was here yesterday to study", return_tensors='pt')
|
|
|
|
|
|
|
27 |
output = model.generate(input["input_ids"],attention_mask=input["attention_mask"],forced_bos_token_id=tokenizer_it.lang_code_to_id["ru_RU"])
|
28 |
|
29 |
|
|
|
17 |
|
18 |
from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
|
19 |
model = MBartForConditionalGeneration.from_pretrained("MRNH/mbart-russian-grammar-corrector")
|
|
|
|
|
|
|
20 |
|
21 |
+
To use the tokenizer:
|
22 |
|
23 |
tokenizer = MBart50TokenizerFast.from_pretrained("MRNH/mbart-russian-grammar-corrector", src_lang="ru_RU", tgt_lang="ru_RU")
|
24 |
input = tokenizer("I was here yesterday to studying",text_target="I was here yesterday to study", return_tensors='pt')
|
25 |
+
|
26 |
+
To generate text using the model:
|
27 |
+
|
28 |
output = model.generate(input["input_ids"],attention_mask=input["attention_mask"],forced_bos_token_id=tokenizer_it.lang_code_to_id["ru_RU"])
|
29 |
|
30 |
|