Skip to content

Commit

Permalink
Merge pull request #6 from CBICA/localdownload
Browse files Browse the repository at this point in the history
make model_folder invariant
  • Loading branch information
AlexanderGetka-cbica authored Sep 23, 2024
2 parents 81eb7d0 + 731dc5d commit ae1c992
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import argparse
import json
import os
from pathlib import Path
import shutil
import warnings

Expand Down Expand Up @@ -182,6 +183,7 @@ def main() -> None:
print(f"Renaming dic is saved to {datalist_file}")

model_folder = os.path.join(
Path(__file__).parent,
"nnunet_results",
"Dataset%s_Task%s_dlicv/nnUNetTrainer__nnUNetPlans__3d_fullres/"
% (args.d, args.d),
Expand All @@ -193,8 +195,8 @@ def main() -> None:
print("DLICV model not found, downloading...")

from huggingface_hub import snapshot_download

snapshot_download(repo_id="nichart/DLICV", local_dir=".")
local_src = Path(__file__).parent
snapshot_download(repo_id="nichart/DLICV", local_dir=local_src)
print("DLICV model has been successfully downloaded!")
else:
print("Loading the model...")
Expand Down

0 comments on commit ae1c992

Please sign in to comment.