MCPcopy Create free account
hub / github.com/FusionBrainLab/SONAR-LLM / TinyStoriesTextDataset

Class TinyStoriesTextDataset

sonar_encoding.py:33–45  ·  view source on GitHub ↗

Simple dataset returning a single text (TinyStory) per index.

Source from the content-addressed store, hash-verified

31
32
33class TinyStoriesTextDataset(Dataset):
34 """
35 Simple dataset returning a single text (TinyStory) per index.
36 """
37 def __init__(self, text_list):
38 super().__init__()
39 self.texts = text_list
40
41 def __len__(self):
42 return len(self.texts)
43
44 def __getitem__(self, idx):
45 return self.texts[idx]
46
47
48def collate_and_encode(batch_texts, sonar_model):

Callers 1

ddp_mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected