Datasets:
Update README.md
Browse files
README.md
CHANGED
@@ -254,13 +254,28 @@ print(next(iter(dataset['train'])))
|
|
254 |
To download the dataset for offline use:
|
255 |
|
256 |
```python
|
|
|
|
|
257 |
from huggingface_hub import snapshot_download
|
258 |
|
259 |
-
local_dir =
|
|
|
|
|
|
|
260 |
repo_id="arsaporta/symile-m3",
|
261 |
repo_type="dataset",
|
262 |
-
local_dir=
|
263 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
264 |
)
|
265 |
```
|
266 |
|
|
|
254 |
To download the dataset for offline use:
|
255 |
|
256 |
```python
|
257 |
+
import os
|
258 |
+
from datasets import load_dataset
|
259 |
from huggingface_hub import snapshot_download
|
260 |
|
261 |
+
local_dir = "./symile-m3-5-xs" # where to save
|
262 |
+
|
263 |
+
# download parquet files
|
264 |
+
snapshot_download(
|
265 |
repo_id="arsaporta/symile-m3",
|
266 |
repo_type="dataset",
|
267 |
+
local_dir=local_dir,
|
268 |
+
allow_patterns=["symile-m3-5-xs/*"] # which configuration to download
|
269 |
+
)
|
270 |
+
|
271 |
+
# load the downloaded parquet files
|
272 |
+
dataset = load_dataset(
|
273 |
+
"parquet",
|
274 |
+
data_files={
|
275 |
+
"train": os.path.join(data_dir, "train-*.parquet"),
|
276 |
+
"validation": os.path.join(data_dir, "val-*.parquet"),
|
277 |
+
"test": os.path.join(data_dir, "test-*.parquet")
|
278 |
+
}
|
279 |
)
|
280 |
```
|
281 |
|