MRNH commited on
Commit
3d37f1e
·
1 Parent(s): d347c39

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +8 -1
README.md CHANGED
@@ -24,4 +24,11 @@ To generate text using the model:
24
 
25
  tokenizer = MBart50TokenizerFast.from_pretrained("MRNH/mbart-german-grammar-corrector", src_lang="de_DE", tgt_lang="de_DE")
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["de_DE"])
 
 
 
 
 
 
 
 
24
 
25
  tokenizer = MBart50TokenizerFast.from_pretrained("MRNH/mbart-german-grammar-corrector", src_lang="de_DE", tgt_lang="de_DE")
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["de_DE"])
28
+
29
+
30
+ Training of the model is performed using the following loss computation based on the hidden state output h:
31
+
32
+ h.logits, h.loss = model(input_ids=input["input_ids"],
33
+ attention_mask=input["attention_mask"],
34
+ labels=input["labels"])