in distilbertqatrain.py [0:0]
def get_data():
if not os.path.exists('data'):
os.mkdir('data')
url = 'https://rajpurkar.github.io/SQuAD-explorer/dataset/'
res = requests.get(f'{url}train-v2.0.json')
# loop through
for file in ['train-v2.0.json', 'dev-v2.0.json']:
# make the request to download data over HTTP
res = requests.get(f'{url}{file}')
# write to file
with open(f'./data/{file}', 'wb') as f:
for chunk in res.iter_content(chunk_size=4):
f.write(chunk)