Missing vocab files at url in Biomegatron tutorial notebooks
State: closed | Pull request: no
Labels: name: bug

**Describe the bug**
Following the biomegatron fix in [#1558](https://github.com/NVIDIA/NeMo/pull/1558).
Getting the following new error while running the Biomegatron tutorial notebooks.
Error line : model_ner = nemo_nlp.models.TokenClassificationModel(cfg=config.model, trainer=trainer)

Output Error:
[NeMo I 2020-12-21 03:39:23 megatron_utils:235] Downloading from https://api.ngc.nvidia.com/v2/models/nvidia/biomegatron345mcased/versions/0/files/vocab.txt
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
<ipython-input-25-4645443f78bc> in <module>()
----> 1 model_ner = nemo_nlp.models.TokenClassificationModel(cfg=config.model, trainer=trainer)

12 frames
/usr/local/lib/python3.6/dist-packages/nemo/collections/nlp/models/token_classification/token_classification_model.py in __init__(self, cfg, trainer)
     66                 raise ValueError(f'{cfg.label_ids} not found.')
     67 
---> 68         self.setup_tokenizer(cfg.tokenizer)
     69         self.class_weights = None
     70         super().__init__(cfg=cfg, trainer=trainer)

/usr/local/lib/python3.6/dist-packages/nemo/collections/nlp/models/nlp_model.py in setup_tokenizer(self, cfg)
    112             vocab_file=vocab_file,
    113             special_tokens=OmegaConf.to_container(cfg.special_tokens) if cfg.special_tokens else None,
--> 114             tokenizer_model=self.register_artifact(config_path='tokenizer.tokenizer_model', src=cfg.tokenizer_model),
    115         )
    116         self.tokenizer = tokenizer

/usr/local/lib/python3.6/dist-packages/nemo/collections/nlp/modules/common/tokenizer_utils.py in get_tokenizer(tokenizer_name, tokenizer_model, vocab_file, special_tokens, use_fast)
     60         if vocab_file is None:
     61             vocab_file = nemo.collections.nlp.modules.common.megatron.megatron_utils.get_megatron_vocab_file(
---> 62                 tokenizer_name
     63             )
     64         tokenizer_name = get_megatron_tokenizer(tokenizer_name)

/usr/local/lib/python3.6/dist-packages/nemo/collections/nlp/modules/common/megatron/megatron_utils.py in get_megatron_vocab_file(pretrained_model_name)
    197 
    198     path = os.path.join(MEGATRON_CACHE, pretrained_model_name + "_vocab")
**--> 199     path = _download(path, url)**
    200     return path
    201 

/usr/local/lib/python3.6/dist-packages/nemo/collections/nlp/modules/common/megatron/megatron_utils.py in _download(path, url)
    234                 os.makedirs(MEGATRON_CACHE, exist_ok=True)
    235                 logging.info(f"Downloading from {url}")
--> 236                 wget.download(url, path)
    237             # wait until the master process downloads the file and writes it to the cache dir
    238             if torch.distributed.is_initialized():

/usr/local/lib/python3.6/dist-packages/wget.py in download(url, out, bar)
    524     else:
    525         binurl = url
--> 526     (tmpfile, headers) = ulib.urlretrieve(binurl, tmpfile, callback)
    527     filename = detect_filename(url, out, headers)
    528     if outdir:

/usr/lib/python3.6/urllib/request.py in urlretrieve(url, filename, reporthook, data)
    246     url_type, path = splittype(url)
    247 
--> 248     with contextlib.closing(urlopen(url, data)) as fp:
    249         headers = fp.info()
    250 

/usr/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
    221     else:
    222         opener = _opener
--> 223     return opener.open(url, data, timeout)
    224 
    225 def install_opener(opener):

/usr/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout)
    530         for processor in self.process_response.get(protocol, []):
    531             meth = getattr(processor, meth_name)
--> 532             response = meth(req, response)
    533 
    534         return response

/usr/lib/python3.6/urllib/request.py in http_response(self, request, response)
    640         if not (200 <= code < 300):
    641             response = self.parent.error(
--> 642                 'http', request, response, code, msg, hdrs)
    643 
    644         return response

/usr/lib/python3.6/urllib/request.py in error(self, proto, *args)
    568         if http_err:
    569             args = (dict, 'default', 'http_error_default') + orig_args
--> 570             return self._call_chain(*args)
    571 
    572 # XXX probably also want an abstract factory that knows when it makes

/usr/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
    502         for handler in handlers:
    503             func = getattr(handler, meth_name)
--> 504             result = func(*args)
    505             if result is not None:
    506                 return result

/usr/lib/python3.6/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
    648 class HTTPDefaultErrorHandler(BaseHandler):
    649     def http_error_default(self, req, fp, code, msg, hdrs):
--> 650         raise HTTPError(req.full_url, code, msg, hdrs, fp)
    651 
    652 class HTTPRedirectHandler(BaseHandler):

HTTPError: HTTP Error 500: 


Vocab file missing at the specified url of megatron_utils.py.

**Steps/Code to reproduce bug**

I am running the Token_Classification-BioMegatron.ipynb notebook on Google Colab using gpu without any change in the code.


**Expected behavior**

The code cell to successfully pull the vocab file and the notebook to run without error.

**Environment overview (please complete the following information)**

 - Environment location: Google Colab (GPU enabled)

**Environment details**

- Python version - 3.6.9

I am also running into the same issue while running the tutorial notebooks.

<img width="1075" alt="Screen Shot 2021-01-02 at 1 05 30 PM" src="https://user-images.githubusercontent.com/7240751/103463568-5b779d00-4cfb-11eb-8626-bb36d32e1373.png">


I was able to get this working by adding these two lines:
```
config.model.tokenizer.tokenizer_name = PRETRAINED_BERT_MODEL
config.trainer.accelerator = 'null'
```

@ericharper Thanks, that works.