Download scripts/setup_from_hf.sh from Gowtham25/hc-mts-training-data: direct link, hf CLI and curl.
- Browser
- Download file 3.44 kB
-
https://huggingface.co/datasets/Gowtham25/hc-mts-training-data/resolve/main/scripts/setup_from_hf.sh
- Command line
-
hf download hf://datasets/Gowtham25/hc-mts-training-data/scripts/setup_from_hf.sh
-
curl -L -o setup_from_hf.sh https://huggingface.co/datasets/Gowtham25/hc-mts-training-data/resolve/main/scripts/setup_from_hf.sh
3.44 kB
| # Pull HC-MTS checkpoints and training manifests from Hugging Face. | |
| # Usage: | |
| # export HF_TOKEN=hf_... # read-only or write token | |
| # bash scripts/setup_from_hf.sh | |
| set -euo pipefail | |
| ROOT="$(cd "$(dirname "$0")/.." && pwd)" | |
| cd "$ROOT" | |
| MODEL_REPO="${HC_MTS_MODEL_REPO:-Gowtham25/hc-mts-models}" | |
| DATA_REPO="${HC_MTS_DATA_REPO:-Gowtham25/hc-mts-training-data}" | |
| if ! command -v hf >/dev/null 2>&1; then | |
| echo "Install Hugging Face CLI: uv pip install --python .venv/bin/python huggingface_hub" | |
| exit 1 | |
| fi | |
| mkdir -p runs/s2_convnext runs/s2_l15_natural runs/s2_l15_texture runs/s0_att_resunet \ | |
| runs/s0_clinical_ft runs/s2_no_finding runs/s2_not_skin runs/s2_site models/face data/manifests data/downloads | |
| echo "Downloading production checkpoints from ${MODEL_REPO}..." | |
| hf download "$MODEL_REPO" \ | |
| l1/s2_convnext/best.pt \ | |
| l15/s2_l15_natural/best.pt \ | |
| l15/s2_l15_texture/best.pt \ | |
| seg/s0_att_resunet/best.pt \ | |
| seg/s0_clinical_ft/best.pt \ | |
| gate/s2_no_finding/best.pt \ | |
| gate/s2_not_skin/best.pt \ | |
| site/s2_site/best.pt \ | |
| face_guard/resnet18.onnx \ | |
| face_guard/face_detection_yunet_2023mar.onnx \ | |
| export/inference_config.json \ | |
| --local-dir "$ROOT/.hf_models_cache" | |
| install -D "$ROOT/.hf_models_cache/l1/s2_convnext/best.pt" "$ROOT/runs/s2_convnext/best.pt" | |
| install -D "$ROOT/.hf_models_cache/l15/s2_l15_natural/best.pt" "$ROOT/runs/s2_l15_natural/best.pt" | |
| if [[ -f "$ROOT/.hf_models_cache/l15/s2_l15_texture/best.pt" ]]; then | |
| install -D "$ROOT/.hf_models_cache/l15/s2_l15_texture/best.pt" "$ROOT/runs/s2_l15_texture/best.pt" | |
| fi | |
| install -D "$ROOT/.hf_models_cache/seg/s0_att_resunet/best.pt" "$ROOT/runs/s0_att_resunet/best.pt" | |
| if [[ -f "$ROOT/.hf_models_cache/seg/s0_clinical_ft/best.pt" ]]; then | |
| install -D "$ROOT/.hf_models_cache/seg/s0_clinical_ft/best.pt" "$ROOT/runs/s0_clinical_ft/best.pt" | |
| fi | |
| if [[ -f "$ROOT/.hf_models_cache/gate/s2_no_finding/best.pt" ]]; then | |
| install -D "$ROOT/.hf_models_cache/gate/s2_no_finding/best.pt" "$ROOT/runs/s2_no_finding/best.pt" | |
| fi | |
| if [[ -f "$ROOT/.hf_models_cache/gate/s2_not_skin/best.pt" ]]; then | |
| install -D "$ROOT/.hf_models_cache/gate/s2_not_skin/best.pt" "$ROOT/runs/s2_not_skin/best.pt" | |
| fi | |
| if [[ -f "$ROOT/.hf_models_cache/site/s2_site/best.pt" ]]; then | |
| install -D "$ROOT/.hf_models_cache/site/s2_site/best.pt" "$ROOT/runs/s2_site/best.pt" | |
| fi | |
| install -D "$ROOT/.hf_models_cache/face_guard/resnet18.onnx" "$ROOT/models/face/resnet18.onnx" | |
| install -D "$ROOT/.hf_models_cache/face_guard/face_detection_yunet_2023mar.onnx" \ | |
| "$ROOT/models/face/face_detection_yunet_2023mar.onnx" | |
| echo "Downloading manifests and SD-198 bundle from ${DATA_REPO}..." | |
| # Full dataset snapshot (manifests + metrics + SD-198); partial filenames skip tree dirs on newer hf CLI. | |
| hf download "$DATA_REPO" \ | |
| --repo-type dataset \ | |
| --local-dir "$ROOT/.hf_data_cache" | |
| rsync -a "$ROOT/.hf_data_cache/manifests/" "$ROOT/data/manifests/" | |
| install -D "$ROOT/.hf_data_cache/DATASETS.md" "$ROOT/DATASETS.md" | |
| mkdir -p "$ROOT/data/raw/sd198" | |
| if [[ -f "$ROOT/.hf_data_cache/sources/sd-198.zip" ]]; then | |
| unzip -qo "$ROOT/.hf_data_cache/sources/sd-198.zip" -d "$ROOT/data/raw/sd198" | |
| fi | |
| echo "Done. Next:" | |
| echo " python3 -m venv .venv && uv pip install --python .venv/bin/python -r requirements-train.txt -r requirements-serve.txt" | |
| echo " bash scripts/download_all.sh # optional: full raw corpus on NVMe" | |
| echo " PYTHONPATH=$ROOT .venv/bin/python -u -m hc_mts.engine.serve" | |