File size: 927 Bytes
64ac96d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python3
"""Example: Stream samples from a remote HF dataset."""
from datasets import load_dataset

REPO = "skyzhou06/StreamingOmniDatasets"
CONFIG = "LiveAVCommentary"

print(f"Streaming {REPO}/{CONFIG} train split...")
try:
    ds = load_dataset(REPO, CONFIG, split="train", streaming=True)
    for i, sample in enumerate(ds.take(3)):
        print(f"\n--- Sample {i+1} ---")
        print(f"  id: {sample.get('id')}")
        print(f"  dataset: {sample.get('dataset')}")
        timeline = sample.get("timeline", [])
        print(f"  timeline chunks: {len(timeline)}")
        if timeline:
            controls = [t.get("control") for t in timeline[:5]]
            print(f"  first 5 controls: {controls}")
except Exception as e:
    print(f"\nConfig-based loading failed: {e}")
    print("\nTry loading with parquet fallback:")
    print("  See examples/load_streaming_omni_dataset.py for fallback example")