Upload folder using huggingface_hub
Browse files- README.md +12 -2
- example_notebook.ipynb +107 -26
- script.py +4 -1
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": {
|
@@ -250,7 +250,7 @@
|
|
250 |
{
|
251 |
"data": {
|
252 |
"application/vnd.jupyter.widget-view+json": {
|
253 |
-
"model_id": "
|
254 |
"version_major": 2,
|
255 |
"version_minor": 0
|
256 |
},
|
@@ -264,12 +264,12 @@
|
|
264 |
{
|
265 |
"data": {
|
266 |
"application/vnd.jupyter.widget-view+json": {
|
267 |
-
"model_id": "
|
268 |
"version_major": 2,
|
269 |
"version_minor": 0
|
270 |
},
|
271 |
"text/plain": [
|
272 |
-
"
|
273 |
]
|
274 |
},
|
275 |
"metadata": {},
|
@@ -278,26 +278,50 @@
|
|
278 |
{
|
279 |
"data": {
|
280 |
"application/vnd.jupyter.widget-view+json": {
|
281 |
-
"model_id": "
|
282 |
"version_major": 2,
|
283 |
"version_minor": 0
|
284 |
},
|
285 |
"text/plain": [
|
286 |
-
"
|
287 |
]
|
288 |
},
|
289 |
"metadata": {},
|
290 |
"output_type": "display_data"
|
291 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
292 |
{
|
293 |
"data": {
|
294 |
"application/vnd.jupyter.widget-view+json": {
|
295 |
-
"model_id": "
|
296 |
"version_major": 2,
|
297 |
"version_minor": 0
|
298 |
},
|
299 |
"text/plain": [
|
300 |
-
"
|
301 |
]
|
302 |
},
|
303 |
"metadata": {},
|
@@ -306,32 +330,36 @@
|
|
306 |
{
|
307 |
"data": {
|
308 |
"application/vnd.jupyter.widget-view+json": {
|
309 |
-
"model_id": "
|
310 |
"version_major": 2,
|
311 |
"version_minor": 0
|
312 |
},
|
313 |
"text/plain": [
|
314 |
-
"
|
315 |
]
|
316 |
},
|
317 |
"metadata": {},
|
318 |
"output_type": "display_data"
|
319 |
},
|
320 |
{
|
321 |
-
"
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
327 |
},
|
328 |
{
|
329 |
-
"name": "
|
330 |
"output_type": "stream",
|
331 |
"text": [
|
332 |
-
"/
|
333 |
-
"- empty or missing yaml metadata in repo card\n",
|
334 |
-
" warnings.warn(f\"Warnings while validating metadata in README.md:\\n{message}\")\n"
|
335 |
]
|
336 |
}
|
337 |
],
|
@@ -385,7 +413,7 @@
|
|
385 |
},
|
386 |
{
|
387 |
"cell_type": "code",
|
388 |
-
"execution_count":
|
389 |
"id": "NfxHRGClBYQE",
|
390 |
"metadata": {
|
391 |
"colab": {
|
@@ -394,7 +422,23 @@
|
|
394 |
"id": "NfxHRGClBYQE",
|
395 |
"outputId": "b1ef8073-2e4e-4303-ce24-fbd01d3ff910"
|
396 |
},
|
397 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
398 |
"source": [
|
399 |
"# change directories into our submission folder\n",
|
400 |
"%cd $submission_name\n",
|
@@ -447,7 +491,7 @@
|
|
447 |
},
|
448 |
{
|
449 |
"cell_type": "code",
|
450 |
-
"execution_count":
|
451 |
"id": "4Y0eTe7M_vIJ",
|
452 |
"metadata": {
|
453 |
"colab": {
|
@@ -456,7 +500,15 @@
|
|
456 |
"id": "4Y0eTe7M_vIJ",
|
457 |
"outputId": "c77b0e72-c47e-4b3b-b724-dcce4b911d42"
|
458 |
},
|
459 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
460 |
"source": [
|
461 |
"# Upload our changes to the solution\n",
|
462 |
"operations = [\n",
|
@@ -481,7 +533,7 @@
|
|
481 |
},
|
482 |
{
|
483 |
"cell_type": "code",
|
484 |
-
"execution_count":
|
485 |
"id": "Rf59SEZ6Cp4U",
|
486 |
"metadata": {
|
487 |
"colab": {
|
@@ -491,7 +543,36 @@
|
|
491 |
"id": "Rf59SEZ6Cp4U",
|
492 |
"outputId": "8379d6fa-42ea-4c98-fe83-7023216b2ed6"
|
493 |
},
|
494 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
495 |
"source": [
|
496 |
"from IPython.display import Markdown as md\n",
|
497 |
"\n",
|
|
|
115 |
},
|
116 |
{
|
117 |
"cell_type": "code",
|
118 |
+
"execution_count": 3,
|
119 |
"id": "U0J1w3kCZqMD",
|
120 |
"metadata": {
|
121 |
"colab": {
|
|
|
250 |
{
|
251 |
"data": {
|
252 |
"application/vnd.jupyter.widget-view+json": {
|
253 |
+
"model_id": "941299f6470d4029b5717803b8e0b50c",
|
254 |
"version_major": 2,
|
255 |
"version_minor": 0
|
256 |
},
|
|
|
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": {},
|
|
|
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": {},
|
|
|
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 |
],
|
|
|
413 |
},
|
414 |
{
|
415 |
"cell_type": "code",
|
416 |
+
"execution_count": 4,
|
417 |
"id": "NfxHRGClBYQE",
|
418 |
"metadata": {
|
419 |
"colab": {
|
|
|
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 |
},
|
492 |
{
|
493 |
"cell_type": "code",
|
494 |
+
"execution_count": 5,
|
495 |
"id": "4Y0eTe7M_vIJ",
|
496 |
"metadata": {
|
497 |
"colab": {
|
|
|
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 |
},
|
534 |
{
|
535 |
"cell_type": "code",
|
536 |
+
"execution_count": 6,
|
537 |
"id": "Rf59SEZ6Cp4U",
|
538 |
"metadata": {
|
539 |
"colab": {
|
|
|
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",
|
script.py
CHANGED
@@ -40,8 +40,10 @@ if __name__ == "__main__":
|
|
40 |
print(params)
|
41 |
import os
|
42 |
|
43 |
-
print('pwd:'
|
|
|
44 |
print(os.system('ls -lahtr'))
|
|
|
45 |
print(os.system('ls -lahtr /tmp/data/'))
|
46 |
|
47 |
|
@@ -53,6 +55,7 @@ if __name__ == "__main__":
|
|
53 |
else:
|
54 |
data_path = data_path_local
|
55 |
|
|
|
56 |
print([str(p) for p in data_path.rglob('*validation*.arrow')])
|
57 |
|
58 |
# dataset = load_dataset(params['dataset'], trust_remote_code=True, use_auth_token=params['token'])
|
|
|
40 |
print(params)
|
41 |
import os
|
42 |
|
43 |
+
print('pwd:')
|
44 |
+
os.system('pwd')
|
45 |
print(os.system('ls -lahtr'))
|
46 |
+
print('/tmp/data/')
|
47 |
print(os.system('ls -lahtr /tmp/data/'))
|
48 |
|
49 |
|
|
|
55 |
else:
|
56 |
data_path = data_path_local
|
57 |
|
58 |
+
print(data_path)
|
59 |
print([str(p) for p in data_path.rglob('*validation*.arrow')])
|
60 |
|
61 |
# dataset = load_dataset(params['dataset'], trust_remote_code=True, use_auth_token=params['token'])
|