Upload folder using huggingface_hub
Browse files
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 |
|
script.py
CHANGED
@@ -44,46 +44,66 @@ if __name__ == "__main__":
|
|
44 |
os.system('pwd')
|
45 |
print(os.system('ls -lahtr'))
|
46 |
print('/tmp/data/')
|
47 |
-
print(os.system('ls -
|
|
|
|
|
48 |
|
49 |
|
50 |
data_path_test_server = Path('/tmp/data')
|
51 |
data_path_local = Path().home() / '.cache/huggingface/datasets/usm3d___hoho25k_test_x/'
|
52 |
|
53 |
if data_path_test_server.exists():
|
54 |
-
data_path = data_path_test_server
|
55 |
TEST_ENV = True
|
56 |
else:
|
57 |
-
data_path = data_path_local
|
58 |
TEST_ENV = False
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
print(data_path)
|
62 |
|
63 |
# dataset = load_dataset(params['dataset'], trust_remote_code=True, use_auth_token=params['token'])
|
|
|
|
|
|
|
|
|
64 |
data_files = {
|
65 |
-
"validation": [str(p) for p in
|
66 |
-
"test": [str(p) for p in
|
67 |
}
|
68 |
print(data_files)
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
|
88 |
|
89 |
print(dataset, flush=True)
|
|
|
44 |
os.system('pwd')
|
45 |
print(os.system('ls -lahtr'))
|
46 |
print('/tmp/data/')
|
47 |
+
print(os.system('ls -lahtr /tmp/data/'))
|
48 |
+
print('/tmp/data/data')
|
49 |
+
print(os.system('ls -lahtrR /tmp/data/data'))
|
50 |
|
51 |
|
52 |
data_path_test_server = Path('/tmp/data')
|
53 |
data_path_local = Path().home() / '.cache/huggingface/datasets/usm3d___hoho25k_test_x/'
|
54 |
|
55 |
if data_path_test_server.exists():
|
56 |
+
# data_path = data_path_test_server
|
57 |
TEST_ENV = True
|
58 |
else:
|
59 |
+
# data_path = data_path_local
|
60 |
TEST_ENV = False
|
61 |
+
from huggingface_hub import snapshot_download
|
62 |
+
_ = snapshot_download(
|
63 |
+
repo_id=params['dataset'],
|
64 |
+
local_dir="/tmp/data",
|
65 |
+
# token=params.token,
|
66 |
+
repo_type="dataset",
|
67 |
+
)
|
68 |
+
data_path = data_path_test_server
|
69 |
+
|
70 |
|
71 |
print(data_path)
|
72 |
|
73 |
# dataset = load_dataset(params['dataset'], trust_remote_code=True, use_auth_token=params['token'])
|
74 |
+
# data_files = {
|
75 |
+
# "validation": [str(p) for p in [*data_path.rglob('*validation*.arrow')]+[*data_path.rglob('*public*/**/*.tar')]],
|
76 |
+
# "test": [str(p) for p in [*data_path.rglob('*test*.arrow')]+[*data_path.rglob('*private*/**/*.tar')]],
|
77 |
+
# }
|
78 |
data_files = {
|
79 |
+
"validation": [str(p) for p in data_path.rglob('*public*/**/*.tar')],
|
80 |
+
"test": [str(p) for p in data_path.rglob('*private*/**/*.tar')],
|
81 |
}
|
82 |
print(data_files)
|
83 |
+
dataset = load_dataset(
|
84 |
+
params['dataset'],
|
85 |
+
data_files=data_files,
|
86 |
+
trust_remote_code=True,
|
87 |
+
# streaming=True
|
88 |
+
)
|
89 |
|
90 |
+
# if TEST_ENV:
|
91 |
+
# dataset = load_dataset(
|
92 |
+
# "webdataset",
|
93 |
+
# data_files=data_files,
|
94 |
+
# trust_remote_code=True,
|
95 |
+
# # streaming=True
|
96 |
+
# )
|
97 |
+
print('load with webdataset')
|
98 |
+
# else:
|
99 |
+
|
100 |
+
# dataset = load_dataset(
|
101 |
+
# "arrow",
|
102 |
+
# data_files=data_files,
|
103 |
+
# trust_remote_code=True,
|
104 |
+
# # streaming=True
|
105 |
+
# )
|
106 |
+
# print('load with arrow')
|
107 |
|
108 |
|
109 |
print(dataset, flush=True)
|