Spaces:
Running
Running
fixed gdown link
Browse files
train.py
CHANGED
@@ -11,16 +11,16 @@ import time
|
|
11 |
import modules.model as model
|
12 |
|
13 |
# Download model if not available
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
|
23 |
-
|
24 |
|
25 |
# Set device
|
26 |
if torch.backends.mps.is_available():
|
|
|
11 |
import modules.model as model
|
12 |
|
13 |
# Download model if not available
|
14 |
+
if os.path.exists('celeba/') == False:
|
15 |
+
url = 'https://drive.google.com/file/d/13vkq4tFCPE8O78KTj84HHM6kBnYkt8gP/view?usp=sharing'
|
16 |
+
output = 'download.zip'
|
17 |
+
gdown.download(url, output, fuzzy=True)
|
18 |
|
19 |
+
with zipfile.ZipFile(output, 'r') as zip_ref:
|
20 |
+
zip_ref.extractall()
|
21 |
|
22 |
+
os.remove(output)
|
23 |
+
shutil.rmtree('__MACOSX')
|
24 |
|
25 |
# Set device
|
26 |
if torch.backends.mps.is_available():
|