Spaces:
Runtime error
Runtime error
File size: 1,283 Bytes
bb3e610 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
from huggingface_hub import hf_hub_download
import os
def download_required_files():
"""Initialize required files from Hugging Face Hub"""
try:
cache_dir = "assets/"
if not os.path.exists(os.path.join(cache_dir, "CLIP_EBC_nwpu_rmse_onnx.onnx")):
hf_hub_download(
repo_id="PIA-SPACE-LAB/CLIP_EBC_nwpu_rmse_onnx",
filename="CLIP_EBC_nwpu_rmse_onnx.onnx",
# cache_dir=cache_dir,
local_dir=cache_dir
)
print("Required files downloaded successfully")
except Exception as e:
print(f"Error downloading required files: {e}")
def download_required_files2():
"""Initialize required files from Hugging Face Hub"""
try:
cache_dir = "assets/"
if not os.path.exists(os.path.join(cache_dir, "CLIP_EBC_nwpu_rmse.pth")):
hf_hub_download(
repo_id="PIA-SPACE-LAB/CLIP_EBC_nwpu_rmse",
filename="CLIP_EBC_nwpu_rmse.pth",
# cache_dir=cache_dir,
local_dir=cache_dir
)
print("Required files downloaded successfully")
except Exception as e:
print(f"Error downloading required files: {e}")
download_required_files()
download_required_files2() |