Spaces:
Sleeping
Sleeping
GVAmaresh
commited on
Commit
·
0376d10
1
Parent(s):
2c526e8
dev: check working
Browse files
app.py
CHANGED
|
@@ -181,11 +181,34 @@ try:
|
|
| 181 |
except Exception as e:
|
| 182 |
print(f"Error downloading file: {e}")
|
| 183 |
|
|
|
|
|
|
|
| 184 |
#-----------------------------------------------------------------------------------------
|
| 185 |
|
| 186 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
file_path = os.path.join(output_dir, output_file)
|
| 188 |
|
|
|
|
| 189 |
if os.path.exists(file_path):
|
| 190 |
print(f"The file '{output_file}' exists at '{file_path}'.")
|
| 191 |
else:
|
|
|
|
| 181 |
except Exception as e:
|
| 182 |
print(f"Error downloading file: {e}")
|
| 183 |
|
| 184 |
+
output_file = "file.h5"
|
| 185 |
+
file_path = os.path.join(output_dir, output_file)
|
| 186 |
#-----------------------------------------------------------------------------------------
|
| 187 |
|
| 188 |
+
import os
|
| 189 |
+
import gdown
|
| 190 |
+
|
| 191 |
+
file_id = "1wIaycDFGTF3e0PpAHKk-GLnxk4cMehOU"
|
| 192 |
+
output_dir = "./downloads"
|
| 193 |
+
output_file = "file2.h5"
|
| 194 |
+
|
| 195 |
+
if not os.path.exists(output_dir):
|
| 196 |
+
os.makedirs(output_dir)
|
| 197 |
+
|
| 198 |
+
output_path = os.path.join(output_dir, output_file)
|
| 199 |
+
|
| 200 |
+
url = f"https://drive.google.com/uc?id={file_id}"
|
| 201 |
+
|
| 202 |
+
try:
|
| 203 |
+
gdown.download(url, output_path, quiet=False)
|
| 204 |
+
print(f"File downloaded successfully to: {output_path}")
|
| 205 |
+
except Exception as e:
|
| 206 |
+
print(f"Error downloading file: {e}")
|
| 207 |
+
|
| 208 |
+
output_file = "file2.h5"
|
| 209 |
file_path = os.path.join(output_dir, output_file)
|
| 210 |
|
| 211 |
+
|
| 212 |
if os.path.exists(file_path):
|
| 213 |
print(f"The file '{output_file}' exists at '{file_path}'.")
|
| 214 |
else:
|