-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.py
40 lines (31 loc) · 1.3 KB
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# Download and build the data if it does not exist.
from parlai.core.build_data import DownloadableFile
import parlai.core.build_data as build_data
import os
RESOURCES = [
DownloadableFile(
'http://parl.ai/downloads/empatheticdialogues/empatheticdialogues.tar.gz',
'empatheticdialogues.tar.gz',
'56f234d77b7dd1f005fd365bb17769cfe346c3c84295b69bc069c8ccb83be03d',
)
]
def build(opt):
dpath = os.path.join('/home/tibon/Desktop/EmpatheticDialogues-main/empatheticdialogues', 'empatheticdialogues')
version = '1.0'
if not build_data.built(dpath, version_string=version):
print('[building data: ' + dpath + ']')
if build_data.built(dpath):
# An older version exists, so remove these outdated files.
build_data.remove_dir(dpath)
build_data.make_dir(dpath)
# Download the data.
for downloadable_file in RESOURCES:
downloadable_file.download_file(dpath)
# Mark the data as built.
build_data.mark_done(dpath, version_string=version)
return print("data has been built")
print("data has been built")