Upload folder using huggingface_hub
Browse files- README.md +12 -2
- example_notebook.ipynb +8 -186
- script.py +2 -2
README.md
CHANGED
|
@@ -1,4 +1,14 @@
|
|
| 1 |
-
#
|
| 2 |
|
| 3 |
-
This repo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
|
|
|
| 1 |
+
# Empty solution example for the S23DR competition
|
| 2 |
|
| 3 |
+
This repo provides a minimalistic example of a valid, but empty submission to S23DR competition.
|
| 4 |
+
We recommend you take a look at [this example](https://huggingface.co/usm3d/handcrafted_baseline_submission),
|
| 5 |
+
which implements some primitive algorithms and provides useful I/O and visualization functions.
|
| 6 |
+
|
| 7 |
+
This example seeks to simply provide minimal code which succeeds at reading the dataset and producing a solution (in this case two vertices at the origin and edge of zero length connecting them).
|
| 8 |
+
|
| 9 |
+
`script.py` - is the main file which is run by the competition space. It should produce `submission.parquet` as the result of the run. Please see the additional comments in the `script.py` file.
|
| 10 |
+
|
| 11 |
+
---
|
| 12 |
+
license: apache-2.0
|
| 13 |
+
---
|
| 14 |
|
example_notebook.ipynb
CHANGED
|
@@ -115,7 +115,7 @@
|
|
| 115 |
},
|
| 116 |
{
|
| 117 |
"cell_type": "code",
|
| 118 |
-
"execution_count":
|
| 119 |
"id": "U0J1w3kCZqMD",
|
| 120 |
"metadata": {
|
| 121 |
"colab": {
|
|
@@ -237,132 +237,7 @@
|
|
| 237 |
"id": "U0J1w3kCZqMD",
|
| 238 |
"outputId": "fd1c125d-9e41-4952-8f1e-367034c147d9"
|
| 239 |
},
|
| 240 |
-
"outputs": [
|
| 241 |
-
{
|
| 242 |
-
"name": "stderr",
|
| 243 |
-
"output_type": "stream",
|
| 244 |
-
"text": [
|
| 245 |
-
"/opt/homebrew/Caskroom/miniforge/base/envs/s23dr/lib/python3.10/site-packages/huggingface_hub/file_download.py:832: UserWarning: `local_dir_use_symlinks` parameter is deprecated and will be ignored. The process to download files to a local folder has been updated and do not rely on symlinks anymore. You only need to pass a destination folder as`local_dir`.\n",
|
| 246 |
-
"For more details, check out https://huggingface.co/docs/huggingface_hub/main/en/guides/download#download-files-to-local-folder.\n",
|
| 247 |
-
" warnings.warn(\n"
|
| 248 |
-
]
|
| 249 |
-
},
|
| 250 |
-
{
|
| 251 |
-
"data": {
|
| 252 |
-
"application/vnd.jupyter.widget-view+json": {
|
| 253 |
-
"model_id": "941299f6470d4029b5717803b8e0b50c",
|
| 254 |
-
"version_major": 2,
|
| 255 |
-
"version_minor": 0
|
| 256 |
-
},
|
| 257 |
-
"text/plain": [
|
| 258 |
-
"Fetching 4 files: 0%| | 0/4 [00:00<?, ?it/s]"
|
| 259 |
-
]
|
| 260 |
-
},
|
| 261 |
-
"metadata": {},
|
| 262 |
-
"output_type": "display_data"
|
| 263 |
-
},
|
| 264 |
-
{
|
| 265 |
-
"data": {
|
| 266 |
-
"application/vnd.jupyter.widget-view+json": {
|
| 267 |
-
"model_id": "5ad2be0a929a4b0db49a091b88491e50",
|
| 268 |
-
"version_major": 2,
|
| 269 |
-
"version_minor": 0
|
| 270 |
-
},
|
| 271 |
-
"text/plain": [
|
| 272 |
-
"example_notebook.ipynb: 0%| | 0.00/144k [00:00<?, ?B/s]"
|
| 273 |
-
]
|
| 274 |
-
},
|
| 275 |
-
"metadata": {},
|
| 276 |
-
"output_type": "display_data"
|
| 277 |
-
},
|
| 278 |
-
{
|
| 279 |
-
"data": {
|
| 280 |
-
"application/vnd.jupyter.widget-view+json": {
|
| 281 |
-
"model_id": "642e33b4324f4497a349dd595a78ee60",
|
| 282 |
-
"version_major": 2,
|
| 283 |
-
"version_minor": 0
|
| 284 |
-
},
|
| 285 |
-
"text/plain": [
|
| 286 |
-
"script.py: 0%| | 0.00/3.23k [00:00<?, ?B/s]"
|
| 287 |
-
]
|
| 288 |
-
},
|
| 289 |
-
"metadata": {},
|
| 290 |
-
"output_type": "display_data"
|
| 291 |
-
},
|
| 292 |
-
{
|
| 293 |
-
"name": "stdout",
|
| 294 |
-
"output_type": "stream",
|
| 295 |
-
"text": [
|
| 296 |
-
"/Users/jack/dev/S23DR/2025/empty_submission/upstream\n",
|
| 297 |
-
"https://huggingface.co/jacklangerman/my_cool_submission_2025\n"
|
| 298 |
-
]
|
| 299 |
-
},
|
| 300 |
-
{
|
| 301 |
-
"name": "stderr",
|
| 302 |
-
"output_type": "stream",
|
| 303 |
-
"text": [
|
| 304 |
-
"/opt/homebrew/Caskroom/miniforge/base/envs/s23dr/lib/python3.10/site-packages/huggingface_hub/hf_api.py:9234: UserWarning: Warnings while validating metadata in README.md:\n",
|
| 305 |
-
"- empty or missing yaml metadata in repo card\n",
|
| 306 |
-
" warnings.warn(f\"Warnings while validating metadata in README.md:\\n{message}\")\n"
|
| 307 |
-
]
|
| 308 |
-
},
|
| 309 |
-
{
|
| 310 |
-
"name": "stdout",
|
| 311 |
-
"output_type": "stream",
|
| 312 |
-
"text": [
|
| 313 |
-
"[CommitInfo(commit_url='https://huggingface.co/jacklangerman/my_cool_submission_2025/commit/0c0cd52c81512a8f5b6e8f93d00003a57d3f9a5a', commit_message='Upload folder using huggingface_hub', commit_description='', oid='0c0cd52c81512a8f5b6e8f93d00003a57d3f9a5a', pr_url=None, repo_url=RepoUrl('https://huggingface.co/jacklangerman/my_cool_submission_2025', endpoint='https://huggingface.co', repo_type='model', repo_id='jacklangerman/my_cool_submission_2025'), pr_revision=None, pr_num=None)]\n"
|
| 314 |
-
]
|
| 315 |
-
},
|
| 316 |
-
{
|
| 317 |
-
"data": {
|
| 318 |
-
"application/vnd.jupyter.widget-view+json": {
|
| 319 |
-
"model_id": "9c5340c0bbb947248ed4d259f59eaf81",
|
| 320 |
-
"version_major": 2,
|
| 321 |
-
"version_minor": 0
|
| 322 |
-
},
|
| 323 |
-
"text/plain": [
|
| 324 |
-
"Fetching 4 files: 0%| | 0/4 [00:00<?, ?it/s]"
|
| 325 |
-
]
|
| 326 |
-
},
|
| 327 |
-
"metadata": {},
|
| 328 |
-
"output_type": "display_data"
|
| 329 |
-
},
|
| 330 |
-
{
|
| 331 |
-
"data": {
|
| 332 |
-
"application/vnd.jupyter.widget-view+json": {
|
| 333 |
-
"model_id": "a40b792113ed4761b199a7a85a336569",
|
| 334 |
-
"version_major": 2,
|
| 335 |
-
"version_minor": 0
|
| 336 |
-
},
|
| 337 |
-
"text/plain": [
|
| 338 |
-
"example_notebook.ipynb: 0%| | 0.00/144k [00:00<?, ?B/s]"
|
| 339 |
-
]
|
| 340 |
-
},
|
| 341 |
-
"metadata": {},
|
| 342 |
-
"output_type": "display_data"
|
| 343 |
-
},
|
| 344 |
-
{
|
| 345 |
-
"data": {
|
| 346 |
-
"application/vnd.jupyter.widget-view+json": {
|
| 347 |
-
"model_id": "87b256c486b44db9a60f08ff54b31de3",
|
| 348 |
-
"version_major": 2,
|
| 349 |
-
"version_minor": 0
|
| 350 |
-
},
|
| 351 |
-
"text/plain": [
|
| 352 |
-
"script.py: 0%| | 0.00/3.23k [00:00<?, ?B/s]"
|
| 353 |
-
]
|
| 354 |
-
},
|
| 355 |
-
"metadata": {},
|
| 356 |
-
"output_type": "display_data"
|
| 357 |
-
},
|
| 358 |
-
{
|
| 359 |
-
"name": "stdout",
|
| 360 |
-
"output_type": "stream",
|
| 361 |
-
"text": [
|
| 362 |
-
"/Users/jack/dev/S23DR/2025/empty_submission/my_cool_submission_2025\n"
|
| 363 |
-
]
|
| 364 |
-
}
|
| 365 |
-
],
|
| 366 |
"source": [
|
| 367 |
"from huggingface_hub import HfApi\n",
|
| 368 |
"from pathlib import Path\n",
|
|
@@ -413,7 +288,7 @@
|
|
| 413 |
},
|
| 414 |
{
|
| 415 |
"cell_type": "code",
|
| 416 |
-
"execution_count":
|
| 417 |
"id": "NfxHRGClBYQE",
|
| 418 |
"metadata": {
|
| 419 |
"colab": {
|
|
@@ -422,23 +297,7 @@
|
|
| 422 |
"id": "NfxHRGClBYQE",
|
| 423 |
"outputId": "b1ef8073-2e4e-4303-ce24-fbd01d3ff910"
|
| 424 |
},
|
| 425 |
-
"outputs": [
|
| 426 |
-
{
|
| 427 |
-
"name": "stdout",
|
| 428 |
-
"output_type": "stream",
|
| 429 |
-
"text": [
|
| 430 |
-
"/Users/jack/dev/S23DR/2025/empty_submission/my_cool_submission_2025\n"
|
| 431 |
-
]
|
| 432 |
-
},
|
| 433 |
-
{
|
| 434 |
-
"name": "stderr",
|
| 435 |
-
"output_type": "stream",
|
| 436 |
-
"text": [
|
| 437 |
-
"/opt/homebrew/Caskroom/miniforge/base/envs/s23dr/lib/python3.10/site-packages/IPython/core/magics/osm.py:417: UserWarning: This is now an optional IPython functionality, setting dhist requires you to install the `pickleshare` library.\n",
|
| 438 |
-
" self.shell.db['dhist'] = compress_dhist(dhist)[-100:]\n"
|
| 439 |
-
]
|
| 440 |
-
}
|
| 441 |
-
],
|
| 442 |
"source": [
|
| 443 |
"# change directories into our submission folder\n",
|
| 444 |
"%cd $submission_name\n",
|
|
@@ -491,7 +350,7 @@
|
|
| 491 |
},
|
| 492 |
{
|
| 493 |
"cell_type": "code",
|
| 494 |
-
"execution_count":
|
| 495 |
"id": "4Y0eTe7M_vIJ",
|
| 496 |
"metadata": {
|
| 497 |
"colab": {
|
|
@@ -500,15 +359,7 @@
|
|
| 500 |
"id": "4Y0eTe7M_vIJ",
|
| 501 |
"outputId": "c77b0e72-c47e-4b3b-b724-dcce4b911d42"
|
| 502 |
},
|
| 503 |
-
"outputs": [
|
| 504 |
-
{
|
| 505 |
-
"name": "stdout",
|
| 506 |
-
"output_type": "stream",
|
| 507 |
-
"text": [
|
| 508 |
-
"[CommitInfo(commit_url='https://huggingface.co/jacklangerman/my_cool_submission_2025/commit/a32453a1cdb9bfb1a8094a762c428a9b282a254e', commit_message='Upload folder using huggingface_hub', commit_description='', oid='a32453a1cdb9bfb1a8094a762c428a9b282a254e', pr_url=None, repo_url=RepoUrl('https://huggingface.co/jacklangerman/my_cool_submission_2025', endpoint='https://huggingface.co', repo_type='model', repo_id='jacklangerman/my_cool_submission_2025'), pr_revision=None, pr_num=None)]\n"
|
| 509 |
-
]
|
| 510 |
-
}
|
| 511 |
-
],
|
| 512 |
"source": [
|
| 513 |
"# Upload our changes to the solution\n",
|
| 514 |
"operations = [\n",
|
|
@@ -533,7 +384,7 @@
|
|
| 533 |
},
|
| 534 |
{
|
| 535 |
"cell_type": "code",
|
| 536 |
-
"execution_count":
|
| 537 |
"id": "Rf59SEZ6Cp4U",
|
| 538 |
"metadata": {
|
| 539 |
"colab": {
|
|
@@ -543,36 +394,7 @@
|
|
| 543 |
"id": "Rf59SEZ6Cp4U",
|
| 544 |
"outputId": "8379d6fa-42ea-4c98-fe83-7023216b2ed6"
|
| 545 |
},
|
| 546 |
-
"outputs": [
|
| 547 |
-
{
|
| 548 |
-
"data": {
|
| 549 |
-
"text/markdown": [
|
| 550 |
-
"\n",
|
| 551 |
-
"1. Follow this link to the competition space for the [S23DR Challenge](https://huggingface.co/spaces/usm3d/S23DR2025)\n",
|
| 552 |
-
"<br>\n",
|
| 553 |
-
"2. Login to Hugging Face. <br>\n",
|
| 554 |
-
"<img src=\"https://huggingface.co/datasets/jacklangerman/hosted_images/resolve/main/submit_to_s23rd/login.png\" width=512>\n",
|
| 555 |
-
"<br>\n",
|
| 556 |
-
"\n",
|
| 557 |
-
"3. Click \"New submission\" <br>\n",
|
| 558 |
-
"<img src=\"https://huggingface.co/datasets/jacklangerman/hosted_images/resolve/main/submit_to_s23rd/click_new_submission.png\" width=512>\n",
|
| 559 |
-
"<br>\n",
|
| 560 |
-
"\n",
|
| 561 |
-
"4. Enter in the repo_id of your submission ([jacklangerman/my_cool_submission_2025](https://huggingface.co/jacklangerman/my_cool_submission_2025))<br>\n",
|
| 562 |
-
"<br>\n",
|
| 563 |
-
"<img src=\"https://huggingface.co/datasets/jacklangerman/hosted_images/resolve/main/submit_to_s23rd/name_and_desc.png\" width=512>\n",
|
| 564 |
-
"<br>\n",
|
| 565 |
-
"\n"
|
| 566 |
-
],
|
| 567 |
-
"text/plain": [
|
| 568 |
-
"<IPython.core.display.Markdown object>"
|
| 569 |
-
]
|
| 570 |
-
},
|
| 571 |
-
"execution_count": 6,
|
| 572 |
-
"metadata": {},
|
| 573 |
-
"output_type": "execute_result"
|
| 574 |
-
}
|
| 575 |
-
],
|
| 576 |
"source": [
|
| 577 |
"from IPython.display import Markdown as md\n",
|
| 578 |
"\n",
|
|
|
|
| 115 |
},
|
| 116 |
{
|
| 117 |
"cell_type": "code",
|
| 118 |
+
"execution_count": null,
|
| 119 |
"id": "U0J1w3kCZqMD",
|
| 120 |
"metadata": {
|
| 121 |
"colab": {
|
|
|
|
| 237 |
"id": "U0J1w3kCZqMD",
|
| 238 |
"outputId": "fd1c125d-9e41-4952-8f1e-367034c147d9"
|
| 239 |
},
|
| 240 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
"source": [
|
| 242 |
"from huggingface_hub import HfApi\n",
|
| 243 |
"from pathlib import Path\n",
|
|
|
|
| 288 |
},
|
| 289 |
{
|
| 290 |
"cell_type": "code",
|
| 291 |
+
"execution_count": null,
|
| 292 |
"id": "NfxHRGClBYQE",
|
| 293 |
"metadata": {
|
| 294 |
"colab": {
|
|
|
|
| 297 |
"id": "NfxHRGClBYQE",
|
| 298 |
"outputId": "b1ef8073-2e4e-4303-ce24-fbd01d3ff910"
|
| 299 |
},
|
| 300 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 301 |
"source": [
|
| 302 |
"# change directories into our submission folder\n",
|
| 303 |
"%cd $submission_name\n",
|
|
|
|
| 350 |
},
|
| 351 |
{
|
| 352 |
"cell_type": "code",
|
| 353 |
+
"execution_count": null,
|
| 354 |
"id": "4Y0eTe7M_vIJ",
|
| 355 |
"metadata": {
|
| 356 |
"colab": {
|
|
|
|
| 359 |
"id": "4Y0eTe7M_vIJ",
|
| 360 |
"outputId": "c77b0e72-c47e-4b3b-b724-dcce4b911d42"
|
| 361 |
},
|
| 362 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 363 |
"source": [
|
| 364 |
"# Upload our changes to the solution\n",
|
| 365 |
"operations = [\n",
|
|
|
|
| 384 |
},
|
| 385 |
{
|
| 386 |
"cell_type": "code",
|
| 387 |
+
"execution_count": null,
|
| 388 |
"id": "Rf59SEZ6Cp4U",
|
| 389 |
"metadata": {
|
| 390 |
"colab": {
|
|
|
|
| 394 |
"id": "Rf59SEZ6Cp4U",
|
| 395 |
"outputId": "8379d6fa-42ea-4c98-fe83-7023216b2ed6"
|
| 396 |
},
|
| 397 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 398 |
"source": [
|
| 399 |
"from IPython.display import Markdown as md\n",
|
| 400 |
"\n",
|
script.py
CHANGED
|
@@ -59,8 +59,8 @@ if __name__ == "__main__":
|
|
| 59 |
|
| 60 |
# dataset = load_dataset(params['dataset'], trust_remote_code=True, use_auth_token=params['token'])
|
| 61 |
data_files = {
|
| 62 |
-
"validation": [str(p) for p in [*data_path.rglob('*validation*.arrow')]+[*data_path.rglob('*
|
| 63 |
-
"test": [str(p) for p in [*data_path.rglob('*test*.arrow')]+[*data_path.rglob('*
|
| 64 |
}
|
| 65 |
print(data_files)
|
| 66 |
|
|
|
|
| 59 |
|
| 60 |
# dataset = load_dataset(params['dataset'], trust_remote_code=True, use_auth_token=params['token'])
|
| 61 |
data_files = {
|
| 62 |
+
"validation": [str(p) for p in [*data_path.rglob('*validation*.arrow')]+[*data_path.rglob('*public*/**/*.tar')]],
|
| 63 |
+
"test": [str(p) for p in [*data_path.rglob('*test*.arrow')]+[*data_path.rglob('*private*/**/*.tar')]],
|
| 64 |
}
|
| 65 |
print(data_files)
|
| 66 |
|