alistairewj / bert-deid

deidentify patient notes using pre-trained BERT
12 stars 2 forks source link

Issue with model download #17

Open jxmorris12 opened 2 years ago

jxmorris12 commented 2 years ago

Tried downloading the model today and ran into the following error:


❯  bert_deid  --model_dir ./bert_deid_model download
08/29/2022 15:16:50 - INFO - bert_deid.download -   Beginning download of model files to ./bert_deid_model
08/29/2022 15:16:50 - INFO - bert_deid.download -   Downloading bert-deid/bert-i2b2-2014/added_tokens.json to ./bert_deid_model/added_tokens.json
Traceback (most recent call last):
  File "/home/jxm3/.conda/envs/bert-deid/lib/python3.9/site-packages/google/cloud/storage/client.py", line 1151, in download_blob_to_file
    blob_or_uri._do_download(
  File "/home/jxm3/.conda/envs/bert-deid/lib/python3.9/site-packages/google/cloud/storage/blob.py", line 989, in _do_download
    response = download.consume(transport, timeout=timeout)
  File "/home/jxm3/.conda/envs/bert-deid/lib/python3.9/site-packages/google/resumable_media/requests/download.py", line 214, in consume
    return _request_helpers.wait_and_retry(
  File "/home/jxm3/.conda/envs/bert-deid/lib/python3.9/site-packages/google/resumable_media/requests/_request_helpers.py", line 148, in wait_and_retry
    response = func()
  File "/home/jxm3/.conda/envs/bert-deid/lib/python3.9/site-packages/google/resumable_media/requests/download.py", line 207, in retriable_request
    self._process_response(result)
  File "/home/jxm3/.conda/envs/bert-deid/lib/python3.9/site-packages/google/resumable_media/_download.py", line 188, in _process_response
    _helpers.require_status_code(
  File "/home/jxm3/.conda/envs/bert-deid/lib/python3.9/site-packages/google/resumable_media/_helpers.py", line 105, in require_status_code
    raise common.InvalidResponse(
google.resumable_media.common.InvalidResponse: ('Request failed with status code', 403, 'Expected one of', <HTTPStatus.OK: 200>, <HTTPStatus.PARTIAL_CONTENT: 206>)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jxm3/.conda/envs/bert-deid/bin/bert_deid", line 33, in <module>
    sys.exit(load_entry_point('bert-deid', 'console_scripts', 'bert_deid')())
  File "/home/jxm3/research/deidentification/bert-deid/bert_deid/__main__.py", line 131, in main
    download(args)
  File "/home/jxm3/research/deidentification/bert-deid/bert_deid/__main__.py", line 121, in download
    download_model(args.model_dir)
  File "/home/jxm3/research/deidentification/bert-deid/bert_deid/download.py", line 41, in download_model
    download_blob(bucket_name, f'bert-i2b2-2014/{fn}', f'{model_dir}/{fn}')
  File "/home/jxm3/research/deidentification/bert-deid/bert_deid/download.py", line 20, in download_blob
    blob.download_to_filename(destination_file_name)
  File "/home/jxm3/.conda/envs/bert-deid/lib/python3.9/site-packages/google/cloud/storage/blob.py", line 1270, in download_to_filename
    client.download_blob_to_file(
  File "/home/jxm3/.conda/envs/bert-deid/lib/python3.9/site-packages/google/cloud/storage/client.py", line 1164, in download_blob_to_file
    _raise_from_invalid_response(exc)
  File "/home/jxm3/.conda/envs/bert-deid/lib/python3.9/site-packages/google/cloud/storage/blob.py", line 4457, in _raise_from_invalid_response
    raise exceptions.from_http_status(response.status_code, message, response=response)
google.api_core.exceptions.Forbidden: 403 GET https://storage.googleapis.com/download/storage/v1/b/bert-deid/o/bert-i2b2-2014%2Fadded_tokens.json?alt=media: The account for bucket &quot;bert-deid&quot; has not enabled billing.: ('Request failed with status code', 403, 'Expected one of', <HTTPStatus.OK: 200>, <HTTPStatus.PARTIAL_CONTENT: 206>)
unnir commented 1 year ago

what about the huggingface hub: https://huggingface.co/obi/deid_bert_i2b2?

jxmorris12 commented 1 year ago

@unnir -- that's very useful, but it's not the model from this paper. The repository for the model you linked to is here: https://github.com/obi-ml-public/ehr_deidentification