Update README.md
Browse files
README.md
CHANGED
@@ -77,12 +77,12 @@ article_en = "The head of the United Nations says there is no military solution
|
|
77 |
model = MBartForConditionalGeneration.from_pretrained("SnypzZz/Llama2-13b-Language-translate")
|
78 |
tokenizer = MBart50TokenizerFast.from_pretrained("SnypzZz/Llama2-13b-Language-translate", src_lang="en_XX")
|
79 |
|
80 |
-
model_inputs = tokenizer(article_en, return_tensors="
|
81 |
|
82 |
# translate from English to Hindi
|
83 |
generated_tokens = model.generate(
|
84 |
**model_inputs,
|
85 |
-
forced_bos_token_id=tokenizer.lang_code_to_id["
|
86 |
)
|
87 |
tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
|
88 |
# => 'संयुक्त राष्ट्र के नेता कहते हैं कि सीरिया में कोई सैन्य समाधान नहीं है'
|
|
|
77 |
model = MBartForConditionalGeneration.from_pretrained("SnypzZz/Llama2-13b-Language-translate")
|
78 |
tokenizer = MBart50TokenizerFast.from_pretrained("SnypzZz/Llama2-13b-Language-translate", src_lang="en_XX")
|
79 |
|
80 |
+
model_inputs = tokenizer(article_en, return_tensors="de")
|
81 |
|
82 |
# translate from English to Hindi
|
83 |
generated_tokens = model.generate(
|
84 |
**model_inputs,
|
85 |
+
forced_bos_token_id=tokenizer.lang_code_to_id["de_DE"]
|
86 |
)
|
87 |
tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
|
88 |
# => 'संयुक्त राष्ट्र के नेता कहते हैं कि सीरिया में कोई सैन्य समाधान नहीं है'
|