akbarazimifar commited on
Commit
6abc449
·
verified ·
1 Parent(s): 469d50d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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
- if not os.path.exists(os.path.join(directory, "best_model.pth")):
 
 
38
  print(f"|> Downloading model: {directory}")
39
  download_url(model[3] + model[1], directory, "best_model.pth")
40
- if not os.path.exists(os.path.join(directory, "config.json")):
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