Spaces:
Sleeping
Sleeping
Kevin Louis
commited on
Commit
·
3a23f8d
1
Parent(s):
ae93270
Create utility.py
Browse files- utility.py +10 -0
utility.py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from datasets import load_dataset
|
2 |
+
|
3 |
+
def load_from_hub_csv(path, data_file, token, csv_output_file):
|
4 |
+
|
5 |
+
dataset = load_dataset(path=path,
|
6 |
+
data_files=data_file,
|
7 |
+
token=token,)
|
8 |
+
|
9 |
+
for split, data in dataset.items():
|
10 |
+
data.to_csv(csv_output_file, index=None)
|