MRNH commited on
Commit
928b3e8
1 Parent(s): c0cf186

Update README.md

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