Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,13 +31,15 @@ modelInfo = [
|
|
31 |
|
32 |
# Download model files if not exist
|
33 |
for model in modelInfo:
|
34 |
-
directory = model[0]
|
35 |
if not os.path.exists(directory):
|
36 |
os.makedirs(directory)
|
37 |
-
|
|
|
|
|
38 |
print(f"|> Downloading model: {directory}")
|
39 |
download_url(model[3] + model[1], directory, "best_model.pth")
|
40 |
-
if not os.path.exists(
|
41 |
print(f"|> Downloading config: {directory}")
|
42 |
download_url(model[3] + model[2], directory, "config.json")
|
43 |
|
|
|
31 |
|
32 |
# Download model files if not exist
|
33 |
for model in modelInfo:
|
34 |
+
directory = model[0].replace(" ", "_")
|
35 |
if not os.path.exists(directory):
|
36 |
os.makedirs(directory)
|
37 |
+
model_path = os.path.join(directory, "best_model.pth")
|
38 |
+
config_path = os.path.join(directory, "config.json")
|
39 |
+
if not os.path.exists(model_path):
|
40 |
print(f"|> Downloading model: {directory}")
|
41 |
download_url(model[3] + model[1], directory, "best_model.pth")
|
42 |
+
if not os.path.exists(config_path):
|
43 |
print(f"|> Downloading config: {directory}")
|
44 |
download_url(model[3] + model[2], directory, "config.json")
|
45 |
|