Spaces:
Runtime error
Runtime error
Daniel Verdu
commited on
Commit
•
3ab8e0f
1
Parent(s):
be5401f
merged changes
Browse files- app_utils.py +0 -17
app_utils.py
CHANGED
@@ -106,17 +106,6 @@ def clean_all(files):
|
|
106 |
clean_me(me)
|
107 |
|
108 |
|
109 |
-
<<<<<<< HEAD
|
110 |
-
def get_model_bin(url, output_path):
|
111 |
-
# print('Getting model dir: ', output_path)
|
112 |
-
if not os.path.exists(output_path):
|
113 |
-
print('Downloading model')
|
114 |
-
|
115 |
-
# Check if folder exists
|
116 |
-
output_folder = output_path.replace('\\','/').split('/')[0]
|
117 |
-
if not os.path.exists(output_folder):
|
118 |
-
os.makedirs(output_folder, exist_ok=True)
|
119 |
-
=======
|
120 |
def create_directory(path):
|
121 |
os.makedirs(os.path.dirname(path), exist_ok=True)
|
122 |
|
@@ -125,18 +114,12 @@ def get_model_bin(url, output_path):
|
|
125 |
# print('Getting model dir: ', output_path)
|
126 |
if not os.path.exists(output_path):
|
127 |
create_directory(output_path)
|
128 |
-
>>>>>>> 878ecf212e9f3f2f6e923e3bfff6ec899dc40143
|
129 |
|
130 |
urllib.request.urlretrieve(url, output_path)
|
131 |
|
132 |
# cmd = "wget -O %s %s" % (output_path, url)
|
133 |
# print(cmd)
|
134 |
# os.system(cmd)
|
135 |
-
<<<<<<< HEAD
|
136 |
-
else:
|
137 |
-
print('Model exists')
|
138 |
-
=======
|
139 |
-
>>>>>>> 878ecf212e9f3f2f6e923e3bfff6ec899dc40143
|
140 |
|
141 |
return output_path
|
142 |
|
|
|
106 |
clean_me(me)
|
107 |
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
def create_directory(path):
|
110 |
os.makedirs(os.path.dirname(path), exist_ok=True)
|
111 |
|
|
|
114 |
# print('Getting model dir: ', output_path)
|
115 |
if not os.path.exists(output_path):
|
116 |
create_directory(output_path)
|
|
|
117 |
|
118 |
urllib.request.urlretrieve(url, output_path)
|
119 |
|
120 |
# cmd = "wget -O %s %s" % (output_path, url)
|
121 |
# print(cmd)
|
122 |
# os.system(cmd)
|
|
|
|
|
|
|
|
|
|
|
123 |
|
124 |
return output_path
|
125 |
|