Unverified Commit 4a00613c authored by Lysandre Debut's avatar Lysandre Debut Committed by GitHub
Browse files

Fix RobertaForCausalLM docs (#7642)



* Fix RobertaForCausalLM docs

* Apply review suggestion
Co-authored-by: default avatarsgugger <sylvain.gugger@gmail,com>
Co-authored-by: default avatarsgugger <sylvain.gugger@gmail,com>
parent 55cb2ee6
......@@ -758,13 +758,13 @@ class RobertaForCausalLM(RobertaPreTrainedModel):
Example::
>>> from transformers import RobertaTokenizer, RobertaLMHeadModel, RobertaConfig
>>> from transformers import RobertaTokenizer, RobertaForCausalLM, RobertaConfig
>>> import torch
>>> tokenizer = RobertaTokenizer.from_pretrained('roberta-base')
>>> config = RobertaConfig.from_pretrained("roberta-base")
>>> config = RobertaConfig.from_pretrained("roberta-base", return_dict=True)
>>> config.is_decoder = True
>>> model = RobertaLMHeadModel.from_pretrained('roberta-base', config=config, return_dict=True)
>>> model = RobertaForCausalLM.from_pretrained('roberta-base', config=config)
>>> inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
>>> outputs = model(**inputs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment