Issue 1:
for both groups of tests, the import would be

from transformers.testing_utils import slow

Motivation: I was about to rewrite the @slow decorator today and felt that this was cleaner.

Any objections? @julien-c @LysandreJik @thomwolf @sgugger @patrickvonplaten @mfuntowicz

@anyoneelseimforgetting

Issue 2:
Environment info

Environment info

transformers version: 4.4.2

Platform:

Python version: 3.7.6

PyTorch version (GPU?): torch 1.5.0

Tensorflow version (GPU?):

Using GPU in script?: no ( I just mentionned the number of gpu in a shell script and launch (ex . #SBATCH --partition=gpu_p2; #SBATCH --qos=qos_gpu-dev ; #SBATCH --cpus-per-task=3 )

Using distributed or parallel set-up in script?: no

Who can help

albert, bert, xlm: @LysandreJik

Library:

tokenizers: @LysandreJik

pipelines: @LysandreJik

Documentation: @sgugger

Model I am using (FlauBERT):

The problem arises when downloading the model from transformers library:

the official example scripts: (I did not change much , pretty close to the original)

def get_flaubert_layer(texte):

modelname ='flaubert-small-cased'

flaubert, log = FlaubertModel.from_pretrained(modelname, output_loading_info=True)
flaubert_tokenizer = FlaubertTokenizer.from_pretrained(modelname, do_lowercase=False)
tokenized = texte.apply((lambda x: flaubert_tokenizer.encode(x, add_special_tokens=True)))
max_len = 0
for i in tokenized.values:
if len(i) > max_len:
max_len = len(i)
padded = np.array([i + [0] * (max_len - len(i)) for i in tokenized.values])
token_ids = torch.tensor(padded)
with torch.no_grad():
last_layer = flaubert(token_ids)[0][:,0,:].numpy()

return last_layer, modelname

### What I added to the code
def read_file(filename):

sentences = pd.read_excel(filename, sheet_name= 0)
data_id = sentences.identifiant
print("Total phrases: ", len(data_id))
data = sentences.verbatim
data_label = sentences.etiquette
classes = sentences['etiquette'].unique()
len_classes = len(classes)
return data_id, data, data_label, len_classes

def cross_validation_prediction(id_, texte, ylabels, file_, len_classes):

features, modelname = get_flaubert_layer(texte)

The tasks I am working on is:

my own task or dataset: I just want to use the model of FlauBert to producve vectors for my dataset that's all

To reproduce

Steps to reproduce the behavior:

get the requirements (librairies mentionned above)

Final part of the script to reproduce it :

filename = 'test'
fil = filename + ".xlsx"
os.chdir('/linkhome/rech/genlig01/umg16uw/Test_CLASS_avec_FlauBert/corpus')
print("File preprocessing: " , fil)
id_, texte_, ylabels_, len_classes_ = read_file(fil)
cross_validation_prediction(id_, texte_, ylabels_, filename, len_classes_)

stack trace error :

Loading pytorch-gpu/py3/1.5.0
Loading requirement: cuda/10.1.2 nccl/2.5.6-2-cuda cudnn/10.1-v7.5.1.10
gcc/8.2.0 intel-compilers/19.0.4 openmpi/4.0.1-cuda
Traceback (most recent call last):
File "test.py", line 227, in <module>
cross_validation_prediction(id_, texte_, ylabels_, filename, len_classes_)
File "test.py", line 107, in cross_validation_prediction
features, modelname = get_flaubert_layer(texte)
File "test.py", line 56, in get_flaubert_layer
flaubert, log = FlaubertModel.from_pretrained(modelname, output_loading_info=True)
File "/gpfslocalsup/pub/anaconda-py3/2020.02/envs/pytorch-gpu-1.5.0/lib/python3.7/site-packages/transformers/modeling_utils.py", line 986, in from_pretrained
**kwargs,
File "/gpfslocalsup/pub/anaconda-py3/2020.02/envs/pytorch-gpu-1.5.0/lib/python3.7/site-packages/transformers/configuration_utils.py", line 386, in from_pretrained
config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
File "/gpfslocalsup/pub/anaconda-py3/2020.02/envs/pytorch-gpu-1.5.0/lib/python3.7/site-packages/transformers/configuration_utils.py", line 438, in get_config_dict
use_auth_token=use_auth_token,
File "/gpfslocalsup/pub/anaconda-py3/2020.02/envs/pytorch-gpu-1.5.0/lib/python3.7/site-packages/transformers/file_utils.py", line 1142, in cached_path
local_files_only=local_files_only,
File "/gpfslocalsup/pub/anaconda-py3/2020.02/envs/pytorch-gpu-1.5.0/lib/python3.7/site-packages/transformers/file_utils.py", line 1349, in get_from_cache
"Connection error, and we cannot find the requested files in the cached path."
ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on.
srun: error: jean-zay-ia808: task 0: Exited with exit code 1
srun: Terminating job step 841126.0

I expected the model to load and get the vectors in the appropriate varaible, instead Iget this error above.

I have internet and when trying to do it locally and not on the server with small sample it works but when I load a vritual env with the specific library I get this error;