Erva Ulusoy commited on
Commit
db2175e
·
1 Parent(s): 3a2340f

download data only when it does not exist

Browse files
Files changed (1) hide show
  1. run_prothgt_app.py +5 -2
run_prothgt_app.py CHANGED
@@ -137,8 +137,11 @@ def generate_prediction_df(protein_ids, model_paths, model_config_paths, go_cate
137
  file_id = "18u1o2sm8YjMo9joFw4Ilwvg0-rUU0PXK"
138
  output = "data/prothgt-kg.pt"
139
 
140
- url = f"https://drive.google.com/uc?id={file_id}"
141
- print(f"Downloading file from {url}...")
 
 
 
142
  try:
143
  gdown.download(url, output, quiet=False)
144
  print(f"File downloaded to {output}")
 
137
  file_id = "18u1o2sm8YjMo9joFw4Ilwvg0-rUU0PXK"
138
  output = "data/prothgt-kg.pt"
139
 
140
+ if not os.path.exists(output):
141
+ url = f"https://drive.google.com/uc?id={file_id}"
142
+ print(f"Downloading file from {url}...")
143
+ else:
144
+ print(f"File already exists at {output}")
145
  try:
146
  gdown.download(url, output, quiet=False)
147
  print(f"File downloaded to {output}")