Eagle / download_models.py
wayne-chi's picture
Update download_models.py
1ccf426 verified
raw
history blame
1.65 kB
import os
from huggingface_hub import hf_hub_download, snapshot_download
# Target directory for models
target_dir = "Models"
os.makedirs(target_dir, exist_ok=True)
# Download specific files (Folds 1–5) from willieseun/Eagle-Team-TabPFN
print("Downloading fold models from willieseun/Eagle-Team-TabPFN...")
for i in [2]:
file_name = f"Fold_{i}_best_model.tabpfn_fit"
model_path = hf_hub_download(
repo_id="willieseun/Eagle-Team-TabPFN",
filename=file_name,
local_dir=target_dir
)
print(f"Downloaded: {model_path}")
# Download full snapshot from wayne-chi/Eagle_Team
print("\nDownloading snapshot from wayne-chi/Eagle_Team...")
snapshot_download(
repo_id="wayne-chi/Eagle_Team",
revision="main", # Optional, default is "main"
local_dir=target_dir,
local_dir_use_symlinks=False
)
print("\n✅ All models downloaded successfully to:", target_dir)
import os
import shutil
# Paths
SOURCE_CSV = "fuel_properties.csv" # Path to your CSV in the repo or local dir
DEST_DIR = "/tmp/data"
DEST_CSV = os.path.join(DEST_DIR, "fuel_properties.csv")
# Create /tmp/data with full permissions for owner
os.makedirs(DEST_DIR, exist_ok=True)
os.chmod(DEST_DIR, 0o777) # rwx for everyone (adjust if you want stricter)
# Copy the CSV file
shutil.copy2(SOURCE_CSV, DEST_CSV)
# Make sure the file is writable by the app
os.chmod(DEST_CSV, 0o777) # rw for everyone
os.chmod('/app/.config/matplotlib',0o777)
os.chmod('/app',0o777)
os.environ["OMP_NUM_THREADS"] = str(os.cpu_count())
os.chmod("eagleblend.db", 0o777) # rw for everyone
print(f"Copied {SOURCE_CSV}{DEST_CSV} with write permissions")