Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code:   DatasetGenerationCastError
Exception:    DatasetGenerationCastError
Message:      An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 6 new columns ({'action_dim', 'total_frames', 'chunks', 'actions', 'num_chunks', 'frame_shape'}) and 3 missing columns ({'action', 'action_encoded', 'frame'}).

This happened while the json dataset builder was generating data using

hf://datasets/nnsohamnn/runner-game-dataset/metadata.json (at revision 82ed15a2e5a00df9114147ae258a30795a8ad3f7), [/tmp/hf-datasets-cache/medium/datasets/99465579236788-config-parquet-and-info-nnsohamnn-runner-game-dat-7422fca1/hub/datasets--nnsohamnn--runner-game-dataset/snapshots/82ed15a2e5a00df9114147ae258a30795a8ad3f7/actions.jsonl (origin=hf://datasets/nnsohamnn/runner-game-dataset@82ed15a2e5a00df9114147ae258a30795a8ad3f7/actions.jsonl), /tmp/hf-datasets-cache/medium/datasets/99465579236788-config-parquet-and-info-nnsohamnn-runner-game-dat-7422fca1/hub/datasets--nnsohamnn--runner-game-dataset/snapshots/82ed15a2e5a00df9114147ae258a30795a8ad3f7/metadata.json (origin=hf://datasets/nnsohamnn/runner-game-dataset@82ed15a2e5a00df9114147ae258a30795a8ad3f7/metadata.json)]

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1887, in _prepare_split_single
                  writer.write_table(table)
                File "/usr/local/lib/python3.12/site-packages/datasets/arrow_writer.py", line 675, in write_table
                  pa_table = table_cast(pa_table, self._schema)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2272, in table_cast
                  return cast_table_to_schema(table, schema)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2218, in cast_table_to_schema
                  raise CastError(
              datasets.table.CastError: Couldn't cast
              total_frames: int64
              frame_shape: list<item: int64>
                child 0, item: int64
              action_dim: int64
              actions: list<item: string>
                child 0, item: string
              num_chunks: int64
              chunks: list<item: struct<file: string, num_frames: int64, shape: list<item: int64>>>
                child 0, item: struct<file: string, num_frames: int64, shape: list<item: int64>>
                    child 0, file: string
                    child 1, num_frames: int64
                    child 2, shape: list<item: int64>
                        child 0, item: int64
              to
              {'frame': Value('int64'), 'action': Value('string'), 'action_encoded': List(Value('int64'))}
              because column names don't match
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1347, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 980, in convert_to_parquet
                  builder.download_and_prepare(
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 884, in download_and_prepare
                  self._download_and_prepare(
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 947, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1736, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1889, in _prepare_split_single
                  raise DatasetGenerationCastError.from_cast_error(
              datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
              
              All the data files must have the same columns, but at some point there are 6 new columns ({'action_dim', 'total_frames', 'chunks', 'actions', 'num_chunks', 'frame_shape'}) and 3 missing columns ({'action', 'action_encoded', 'frame'}).
              
              This happened while the json dataset builder was generating data using
              
              hf://datasets/nnsohamnn/runner-game-dataset/metadata.json (at revision 82ed15a2e5a00df9114147ae258a30795a8ad3f7), [/tmp/hf-datasets-cache/medium/datasets/99465579236788-config-parquet-and-info-nnsohamnn-runner-game-dat-7422fca1/hub/datasets--nnsohamnn--runner-game-dataset/snapshots/82ed15a2e5a00df9114147ae258a30795a8ad3f7/actions.jsonl (origin=hf://datasets/nnsohamnn/runner-game-dataset@82ed15a2e5a00df9114147ae258a30795a8ad3f7/actions.jsonl), /tmp/hf-datasets-cache/medium/datasets/99465579236788-config-parquet-and-info-nnsohamnn-runner-game-dat-7422fca1/hub/datasets--nnsohamnn--runner-game-dataset/snapshots/82ed15a2e5a00df9114147ae258a30795a8ad3f7/metadata.json (origin=hf://datasets/nnsohamnn/runner-game-dataset@82ed15a2e5a00df9114147ae258a30795a8ad3f7/metadata.json)]
              
              Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

frame
int64
action
string
action_encoded
list
0
none
[ 0, 0, 1 ]
1
none
[ 0, 0, 1 ]
2
none
[ 0, 0, 1 ]
3
right
[ 0, 1, 0 ]
4
none
[ 0, 0, 1 ]
5
none
[ 0, 0, 1 ]
6
none
[ 0, 0, 1 ]
7
none
[ 0, 0, 1 ]
8
none
[ 0, 0, 1 ]
9
none
[ 0, 0, 1 ]
10
none
[ 0, 0, 1 ]
11
none
[ 0, 0, 1 ]
12
none
[ 0, 0, 1 ]
13
none
[ 0, 0, 1 ]
14
none
[ 0, 0, 1 ]
15
none
[ 0, 0, 1 ]
16
none
[ 0, 0, 1 ]
17
none
[ 0, 0, 1 ]
18
none
[ 0, 0, 1 ]
19
none
[ 0, 0, 1 ]
20
none
[ 0, 0, 1 ]
21
none
[ 0, 0, 1 ]
22
none
[ 0, 0, 1 ]
23
none
[ 0, 0, 1 ]
24
none
[ 0, 0, 1 ]
25
none
[ 0, 0, 1 ]
26
none
[ 0, 0, 1 ]
27
none
[ 0, 0, 1 ]
28
none
[ 0, 0, 1 ]
29
none
[ 0, 0, 1 ]
30
none
[ 0, 0, 1 ]
31
none
[ 0, 0, 1 ]
32
none
[ 0, 0, 1 ]
33
none
[ 0, 0, 1 ]
34
none
[ 0, 0, 1 ]
35
none
[ 0, 0, 1 ]
36
none
[ 0, 0, 1 ]
37
none
[ 0, 0, 1 ]
38
none
[ 0, 0, 1 ]
39
none
[ 0, 0, 1 ]
40
none
[ 0, 0, 1 ]
41
none
[ 0, 0, 1 ]
42
none
[ 0, 0, 1 ]
43
none
[ 0, 0, 1 ]
44
none
[ 0, 0, 1 ]
45
none
[ 0, 0, 1 ]
46
none
[ 0, 0, 1 ]
47
none
[ 0, 0, 1 ]
48
none
[ 0, 0, 1 ]
49
none
[ 0, 0, 1 ]
50
none
[ 0, 0, 1 ]
51
none
[ 0, 0, 1 ]
52
none
[ 0, 0, 1 ]
53
none
[ 0, 0, 1 ]
54
none
[ 0, 0, 1 ]
55
none
[ 0, 0, 1 ]
56
none
[ 0, 0, 1 ]
57
none
[ 0, 0, 1 ]
58
none
[ 0, 0, 1 ]
59
none
[ 0, 0, 1 ]
60
none
[ 0, 0, 1 ]
61
none
[ 0, 0, 1 ]
62
none
[ 0, 0, 1 ]
63
none
[ 0, 0, 1 ]
64
none
[ 0, 0, 1 ]
65
none
[ 0, 0, 1 ]
66
none
[ 0, 0, 1 ]
67
none
[ 0, 0, 1 ]
68
none
[ 0, 0, 1 ]
69
none
[ 0, 0, 1 ]
70
none
[ 0, 0, 1 ]
71
none
[ 0, 0, 1 ]
72
none
[ 0, 0, 1 ]
73
none
[ 0, 0, 1 ]
74
none
[ 0, 0, 1 ]
75
none
[ 0, 0, 1 ]
76
none
[ 0, 0, 1 ]
77
none
[ 0, 0, 1 ]
78
none
[ 0, 0, 1 ]
79
none
[ 0, 0, 1 ]
80
none
[ 0, 0, 1 ]
81
none
[ 0, 0, 1 ]
82
none
[ 0, 0, 1 ]
83
none
[ 0, 0, 1 ]
84
left
[ 1, 0, 0 ]
85
none
[ 0, 0, 1 ]
86
none
[ 0, 0, 1 ]
87
none
[ 0, 0, 1 ]
88
none
[ 0, 0, 1 ]
89
none
[ 0, 0, 1 ]
90
none
[ 0, 0, 1 ]
91
none
[ 0, 0, 1 ]
92
none
[ 0, 0, 1 ]
93
none
[ 0, 0, 1 ]
94
right
[ 0, 1, 0 ]
95
none
[ 0, 0, 1 ]
96
none
[ 0, 0, 1 ]
97
none
[ 0, 0, 1 ]
98
none
[ 0, 0, 1 ]
99
none
[ 0, 0, 1 ]
End of preview.

import numpy as np
import json
import os
from huggingface_hub import snapshot_download
from tqdm import tqdm

# ═══════════════════════════════════════════════════════════
#  CONFIG
# ═══════════════════════════════════════════════════════════

HF_REPO = "nnsohamnn/runner-game-dataset"  # ← Change this!
DOWNLOAD_DIR = "runner_dataset_merged"
OUTPUT_DIR = "runner_dataset"

# ═══════════════════════════════════════════════════════════
#  DOWNLOAD
# ═══════════════════════════════════════════════════════════

print("📥 Downloading from Hugging Face...")
snapshot_download(
    repo_id=HF_REPO,
    repo_type="dataset",
    local_dir=DOWNLOAD_DIR
)
print("✅ Download complete!")

# ═══════════════════════════════════════════════════════════
#  OPTION A: USE MERGED FILES DIRECTLY (RECOMMENDED)
# ═══════════════════════════════════════════════════════════

# You can use the merged files directly in training!
# This is actually MORE efficient than individual files.

# Example loading:
print("\n📊 Dataset info:")
with open(os.path.join(DOWNLOAD_DIR, "metadata.json"), 'r') as f:
    metadata = json.load(f)
    print(f"   Total frames: {metadata['total_frames']:,}")
    print(f"   Chunks: {metadata['num_chunks']}")
    print(f"   Actions: {metadata['actions']}")

# ═══════════════════════════════════════════════════════════
#  OPTION B: UNPACK TO INDIVIDUAL FILES (if needed)
# ═══════════════════════════════════════════════════════════

def unpack_dataset():
    """Unpack merged files back to individual files (optional)"""
    
    print("\n📦 Unpacking to individual files...")
    
    os.makedirs(os.path.join(OUTPUT_DIR, "frames"), exist_ok=True)
    os.makedirs(os.path.join(OUTPUT_DIR, "actions"), exist_ok=True)
    
    # Unpack frames
    chunk_files = sorted([f for f in os.listdir(DOWNLOAD_DIR) if f.startswith("frames_chunk")])
    
    frame_idx = 0
    for chunk_file in chunk_files:
        print(f"   Unpacking {chunk_file}...")
        data = np.load(os.path.join(DOWNLOAD_DIR, chunk_file))
        frames = data['frames']
        
        for i in tqdm(range(len(frames)), desc=f"   {chunk_file}"):
            np.save(
                os.path.join(OUTPUT_DIR, "frames", f"{frame_idx:06d}.npy"),
                frames[i]
            )
            frame_idx += 1
        
        data.close()
    
    # Unpack actions
    print("   Unpacking actions.jsonl...")
    with open(os.path.join(DOWNLOAD_DIR, "actions.jsonl"), 'r') as f:
        for idx, line in enumerate(tqdm(f, desc="   actions")):
            action_data = json.loads(line)
            with open(os.path.join(OUTPUT_DIR, "actions", f"{idx:06d}.json"), 'w') as out_f:
                json.dump(action_data, out_f)
    
    print(f"\n✅ Unpacked to {OUTPUT_DIR}/")

# Uncomment to unpack:
# unpack_dataset()
Downloads last month
2