torchtext - content-disposition Error - download_from_url

Viewed 143

I am trying to download the dataset using torchtext and getting the following error

from torchtext.utils import download_from_url, extract_archive
from torchtext.datasets.text_classification import URLS
download_from_url(URLS["AG_NEWS"])

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/torchtext/utils.py", line 122, in download_from_url
    return _process_response(response, root, filename)
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/torchtext/utils.py", line 66, in _process_response
    d = r.headers['content-disposition']
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/requests/structures.py", line 54, in __getitem__
    return self._store[key.lower()][1]
KeyError: 'content-disposition'

I am using torchtext 0.7.0 and the same error is getting replicated in the latest version as well. Can someone help ?

0 Answers
Related