File size: 5,972 Bytes
76c9646 e27b13b b9ff038 e27b13b b9ff038 4f9c3ea 76c9646 |
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "97b75243-8761-4ad8-a5f6-7e5d1ac6f8f3",
"metadata": {},
"outputs": [],
"source": [
"from huggingface_hub import HfApi\n",
"\n",
"api = HfApi()\n",
"\n",
"# Upload all the content from the local folder to your remote Space.\n",
"# By default, files are uploaded at the root of the repo\n",
"def upload():\n",
" api.upload_folder(\n",
"\n",
" folder_path=r\"/workspace/axolotl/relora-out-v2\",\n",
"\n",
" repo_id=\"nRuaif/HH2-Kimiko\",\n",
"\n",
" repo_type=\"model\",\n",
"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8f4fe9f8-96a6-42d6-bb0b-88f161d83e5d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Uploading...\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9d088087e216404399529670c7847308",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"model-00001-of-00003.safetensors: 0%| | 0.00/9.95G [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Uploading...\n",
"Uploading...\n",
"Uploading...\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1902bf3cebf944e296d78883dd996924",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"adapter_model.bin: 0%| | 0.00/125M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8020b25bc6664811a8d6d2e3788cc2d1",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Upload 8 LFS files: 0%| | 0/8 [00:00<?, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e837c78519654acaa0640a3a26987fcd",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"model-00002-of-00003.safetensors: 0%| | 0.00/9.90G [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0d53854de6274fc5855c55e576eb6faf",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"model-00001-of-00003.safetensors: 0%| | 0.00/9.95G [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "39e127c84d1e464da49de4432894f8dc",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"adapter_model.bin: 0%| | 0.00/125M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "919dde8498694171b3ec71fe7b99c651",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"optimizer.pt: 0%| | 0.00/63.3M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "5488c3f630d84ad08661e531f99ba100",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"model-00003-of-00003.safetensors: 0%| | 0.00/6.18G [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d514a8c3f7fe41a9b399da4c340d2e22",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"rng_state.pth: 0%| | 0.00/14.6k [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c0eb017f5d2841c58c6f9e7c937cb7bc",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"scheduler.pt: 0%| | 0.00/189M [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Uploading...\n"
]
}
],
"source": [
"import time\n",
"\n",
" \n",
"\n",
"while True:\n",
" print(\"Uploading...\")\n",
" \n",
" try:\n",
" upload() \n",
" except:\n",
" time.sleep(1) \n",
" time.sleep(600) # Sleep for 10 minutes (600 seconds)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "62fd431d-f1d9-4847-b376-ff77dfd24387",
"metadata": {},
"outputs": [],
"source": [
"!export HF_HUB_ENABLE_HF_TRANSFER=1"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "93af2bcb-e2e9-481d-aa55-4d9bbe0b0d0d",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|