Spaces:
Runtime error
Runtime error
Merge branch 'main' of https://huggingface.co/spaces/joechou/test3 into main
Browse files- dataset.py +2 -2
dataset.py
CHANGED
@@ -8,7 +8,7 @@ import torch
|
|
8 |
from torch.functional import Tensor
|
9 |
from torch.nn.utils.rnn import pad_sequence
|
10 |
from torch.utils.data.dataloader import DataLoader
|
11 |
-
|
12 |
|
13 |
|
14 |
@dataclass
|
@@ -112,7 +112,7 @@ def from_processed(url: str, train=False):
|
|
112 |
|
113 |
def get_collate_fn(text_vocab_size: int, max_seq_length: int):
|
114 |
def collate_fn(examples: List[Example]) -> Batched:
|
115 |
-
from
|
116 |
|
117 |
title_token_ids = pad_sequence(
|
118 |
[
|
|
|
8 |
from torch.functional import Tensor
|
9 |
from torch.nn.utils.rnn import pad_sequence
|
10 |
from torch.utils.data.dataloader import DataLoader
|
11 |
+
import helpers
|
12 |
|
13 |
|
14 |
@dataclass
|
|
|
112 |
|
113 |
def get_collate_fn(text_vocab_size: int, max_seq_length: int):
|
114 |
def collate_fn(examples: List[Example]) -> Batched:
|
115 |
+
from vocab import BOS_ID, EOS_ID
|
116 |
|
117 |
title_token_ids = pad_sequence(
|
118 |
[
|