Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaOfOcean committed Sep 4, 2024
1 parent 5964410 commit 2461db6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/en/programming.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,16 @@ class PromptDataset(Dataset):
"""
def __init__(self, data):
self.data = data

def __len__(self):
return len(self.data)

def __getitem__(self, idx):
return {"query": self.data[idx]}

def collate_fn(self, samples):
batched_data = {}
for sample_key, sample_value in samples.items():
batched_data[sample_key] = torch.stack(sample_value)
return batched_data
```
```

0 comments on commit 2461db6

Please sign in to comment.