Datasets:
Delete test_dataset.py
Browse files- test_dataset.py +0 -23
test_dataset.py
DELETED
|
@@ -1,23 +0,0 @@
|
|
| 1 |
-
from datasets import load_dataset
|
| 2 |
-
import os
|
| 3 |
-
|
| 4 |
-
# Point to the parquet file generated
|
| 5 |
-
dataset_path = os.path.join(os.path.dirname(__file__), "data/train-00000-of-00001.parquet")
|
| 6 |
-
|
| 7 |
-
if not os.path.exists(dataset_path):
|
| 8 |
-
print(f"Dataset file not found at {dataset_path}")
|
| 9 |
-
print("Please run convert_to_parquet.py first.")
|
| 10 |
-
exit(1)
|
| 11 |
-
|
| 12 |
-
print(f"Loading background dataset from {dataset_path}...")
|
| 13 |
-
ds = load_dataset("parquet", data_files={"train": dataset_path}, split="train")
|
| 14 |
-
|
| 15 |
-
print("\nDataset Info:")
|
| 16 |
-
print(ds)
|
| 17 |
-
|
| 18 |
-
print("\nFeatures:")
|
| 19 |
-
print(ds.features)
|
| 20 |
-
|
| 21 |
-
print("\nFirst Example:")
|
| 22 |
-
item = ds[0]
|
| 23 |
-
print(item)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|