Having trouble using Bart for conditional generation

While trying to follow the example for conditional generation using BART I keep getting the following error:

`ImportError Traceback (most recent call last)
in
----> 1 from transformers.modeling_bart import BartTokenizer, BartForConditionalGeneration, BartConfig
2
3 # see examples/summarization/bart/run_eval.py for a longer example
4 model = BartForConditionalGeneration.from_pretrained(‘facebook/bart-large-cnn’)
5 tokenizer = BartTokenizer.from_pretrained(‘facebook/bart-large-cnn’)

~/anaconda3/envs/pytorch-hack/lib/python3.8/site-packages/transformers/modeling_bart.py in
28 from .activations import ACT2FN
29 from .configuration_bart import BartConfig
—> 30 from .file_utils import (
31 add_code_sample_docstrings,
32 add_end_docstrings,

ImportError: cannot import name ‘add_code_sample_docstrings’ from ‘transformers.file_utils’ (/Users/ribhu/anaconda3/envs/pytorch-hack/lib/python3.8/site-packages/transformers/file_utils.py)`

I was unable to find any references to such a problem. Also, I installed the library directly from this repo to make sure I used the updated version. Really feeling lost and would appreciate some help.

Hi can you again check if you are using correct transformers version, add_code_sample_docstrings is available in master here

Yes I removed it and reinstalled from source as well. I am using v3.0.2

I am now getting this error instead:

ImportError: cannot import name ‘BartTokenizer’ from ‘transformers.modeling_bart’

Let me know if you need other information. Thanks

UPDATE: Nevermind I changed the import statement to

from transformers import BartTokenizer, BartForConditionalGeneration, BartConfig

after reinstalling this somehow worked