HTTPSConnectionPool(host='s3.amazonaws.com', port=443): Max retries exceeded with url: /models.huggingface.co/bert/bert-base-uncased.tar.gz (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000002456AF21710>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond',))
I have been trying to executing  this code : 

import torch
from pytorch_pretrained_bert import BertTokenizer, BertModel, BertForMaskedLM

# Load pre-trained model tokenizer (vocabulary)
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')

# Tokenized input
text = "Who was Jim Henson ? Jim Henson was a puppeteer"
tokenized_text = tokenizer.tokenize(text)

# Mask a token that we will try to predict back with `BertForMaskedLM`
masked_index = 6
tokenized_text[masked_index] = '[MASK]'
assert tokenized_text == ['who', 'was', 'jim', 'henson', '?', 'jim', '[MASK]', 'was', 'a', 'puppet', '##eer']

# Convert token to vocabulary indices
indexed_tokens = tokenizer.convert_tokens_to_ids(tokenized_text)
# Define sentence A and B indices associated to 1st and 2nd sentences (see paper)
segments_ids = [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1]

# Convert inputs to PyTorch tensors
tokens_tensor = torch.tensor([indexed_tokens])
segments_tensors = torch.tensor([segments_ids])

# Load pre-trained model (weights)
model = BertModel.from_pretrained('bert-base-uncased')
model.eval()

This is the error that I am getting continuously :

 HTTPSConnectionPool(host='s3.amazonaws.com', port=443): Max retries exceeded with url: /models.huggingface.co/bert/bert-base-uncased.tar.gz (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000002456AF21710>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond',))

Can you help me with this please
Hi, you need a (stable) internet connection to download the weights. This operation is only done once as the weights are then cached on you drive.<|||||>Thankyou so much!<|||||>@laibamehnaz have you solved the problem? I have a similar problem.<|||||>Hi,
I am facing a similar issue, can anyone help with this? <|||||>解决方式 method：

import os
os.environ['NO_PROXY'] = 'huggingface.co' # 不走代理

or

import os
import requests
os.environ['NO_PROXY'] = 'huggingface.co' # 不走代理

or

import os
os.environ['NO_PROXY'] = 'XXXXX.com' # 不走代理，任何网址都可以
<|||||>

Thank you very much!

> 解决方式 method：
> 
> import os os.environ['NO_PROXY'] = 'huggingface.co' # 不走代理
> 
> or
> 
> import os import requests os.environ['NO_PROXY'] = 'huggingface.co' # 不走代理
> 
> or
> 
> import os os.environ['NO_PROXY'] = 'XXXXX.com' # 不走代理，任何网址都可以

