Upload gpu_train.sh with huggingface_hub
Browse files- gpu_train.sh +8 -7
gpu_train.sh
CHANGED
|
@@ -110,23 +110,24 @@ CUDA_VISIBLE_DEVICES=0 python3 lora_sft_train.py \
|
|
| 110 |
echo "============================================================"
|
| 111 |
echo " Training complete!"
|
| 112 |
echo " Adapter saved to: Base/out/sft/rag_mcp_lora/final/"
|
|
|
|
| 113 |
echo " To upload it to Hugging Face, run:"
|
| 114 |
-
echo " python3 upload_lora_to_hf.py --repo-id ASTERIZER/LUNA-100M --folder Base/out/sft/rag_mcp_lora
|
| 115 |
if [ "${UPLOAD_TO_HF:-0}" = "1" ]; then
|
| 116 |
echo " UPLOAD_TO_HF=1 detected. Uploading adapter to Hugging Face..."
|
| 117 |
if [ -f "upload_lora_to_hf.py" ]; then
|
| 118 |
python3 upload_lora_to_hf.py \
|
| 119 |
--repo-id ASTERIZER/LUNA-100M \
|
| 120 |
-
--folder Base/out/sft/rag_mcp_lora
|
| 121 |
-
--path-in-repo rag_mcp_lora
|
| 122 |
else
|
| 123 |
python3 -c "
|
| 124 |
import os
|
| 125 |
from pathlib import Path
|
| 126 |
from huggingface_hub import HfApi
|
| 127 |
|
| 128 |
-
folder = Path('Base/out/sft/rag_mcp_lora
|
| 129 |
-
required = [folder / 'adapter_model.pt', folder / 'adapter_bundle.pt']
|
| 130 |
missing = [str(path) for path in required if not path.exists()]
|
| 131 |
if missing:
|
| 132 |
raise FileNotFoundError('Missing expected adapter files: ' + ', '.join(missing))
|
|
@@ -137,9 +138,9 @@ api.upload_folder(
|
|
| 137 |
repo_id='ASTERIZER/LUNA-100M',
|
| 138 |
repo_type='model',
|
| 139 |
folder_path=str(folder),
|
| 140 |
-
path_in_repo='rag_mcp_lora
|
| 141 |
)
|
| 142 |
-
print('uploaded_lora url=https://huggingface.co/ASTERIZER/LUNA-100M/tree/main/rag_mcp_lora
|
| 143 |
"
|
| 144 |
fi
|
| 145 |
fi
|
|
|
|
| 110 |
echo "============================================================"
|
| 111 |
echo " Training complete!"
|
| 112 |
echo " Adapter saved to: Base/out/sft/rag_mcp_lora/final/"
|
| 113 |
+
echo " Full run folder : Base/out/sft/rag_mcp_lora/"
|
| 114 |
echo " To upload it to Hugging Face, run:"
|
| 115 |
+
echo " python3 upload_lora_to_hf.py --repo-id ASTERIZER/LUNA-100M --folder Base/out/sft/rag_mcp_lora --path-in-repo rag_mcp_lora"
|
| 116 |
if [ "${UPLOAD_TO_HF:-0}" = "1" ]; then
|
| 117 |
echo " UPLOAD_TO_HF=1 detected. Uploading adapter to Hugging Face..."
|
| 118 |
if [ -f "upload_lora_to_hf.py" ]; then
|
| 119 |
python3 upload_lora_to_hf.py \
|
| 120 |
--repo-id ASTERIZER/LUNA-100M \
|
| 121 |
+
--folder Base/out/sft/rag_mcp_lora \
|
| 122 |
+
--path-in-repo rag_mcp_lora
|
| 123 |
else
|
| 124 |
python3 -c "
|
| 125 |
import os
|
| 126 |
from pathlib import Path
|
| 127 |
from huggingface_hub import HfApi
|
| 128 |
|
| 129 |
+
folder = Path('Base/out/sft/rag_mcp_lora')
|
| 130 |
+
required = [folder / 'final' / 'adapter_model.pt', folder / 'final' / 'adapter_bundle.pt']
|
| 131 |
missing = [str(path) for path in required if not path.exists()]
|
| 132 |
if missing:
|
| 133 |
raise FileNotFoundError('Missing expected adapter files: ' + ', '.join(missing))
|
|
|
|
| 138 |
repo_id='ASTERIZER/LUNA-100M',
|
| 139 |
repo_type='model',
|
| 140 |
folder_path=str(folder),
|
| 141 |
+
path_in_repo='rag_mcp_lora',
|
| 142 |
)
|
| 143 |
+
print('uploaded_lora url=https://huggingface.co/ASTERIZER/LUNA-100M/tree/main/rag_mcp_lora')
|
| 144 |
"
|
| 145 |
fi
|
| 146 |
fi
|