fix doc example - AttributeError: type object 'RagModel' has no attribute 'from_question_encoder_generator_pretrained' (#15076)

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
Yih-Dar 2022-01-10 15:28:39 +01:00 committed by GitHub
parent b2c477fc6d
commit 533624c5a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -305,7 +305,7 @@ class RagPreTrainedModel(PreTrainedModel):
>>> from transformers import RagModel
>>> # initialize a RAG from two pretrained models.
>>> model = RagModel.from_question_encoder_generator_pretrained(
>>> model = RagModel.from_pretrained_question_encoder_generator(
... "facebook/dpr-question_encoder-single-nq-base", "t5-small"
... )
>>> # saving model after fine-tuning