Unverified Commit 74837171 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

fix doc example - AssertionError: has to be configured as a decoder. (#15124)


Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent 6950ccec
...@@ -1471,7 +1471,6 @@ class ProphetNetDecoder(ProphetNetPreTrainedModel): ...@@ -1471,7 +1471,6 @@ class ProphetNetDecoder(ProphetNetPreTrainedModel):
>>> tokenizer = ProphetNetTokenizer.from_pretrained("microsoft/prophetnet-large-uncased") >>> tokenizer = ProphetNetTokenizer.from_pretrained("microsoft/prophetnet-large-uncased")
>>> model = ProphetNetDecoder.from_pretrained("microsoft/prophetnet-large-uncased", add_cross_attention=False) >>> model = ProphetNetDecoder.from_pretrained("microsoft/prophetnet-large-uncased", add_cross_attention=False)
>>> assert model.config.is_decoder, f"{model.__class__} has to be configured as a decoder."
>>> inputs = tokenizer("Hello, my dog is cute", return_tensors="pt") >>> inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
>>> outputs = model(**inputs) >>> 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