rxnn 0.1.72__py3-none-any.whl → 0.1.73__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
rxnn/training/dataset.py
CHANGED
@@ -32,11 +32,13 @@ class BaseDataset(Dataset):
|
|
32
32
|
def __len__(self):
|
33
33
|
return len(self.texts if not self.is_pre_tokenized else self.inputs)
|
34
34
|
|
35
|
-
def get_tokenized_text(self, idx: int):
|
35
|
+
def get_tokenized_text(self, idx: int, txt: str = None):
|
36
36
|
if self.is_pre_tokenized:
|
37
37
|
return self.inputs[idx]
|
38
38
|
else:
|
39
|
-
if
|
39
|
+
if txt:
|
40
|
+
text = txt
|
41
|
+
elif isinstance(self.texts, list):
|
40
42
|
text = self.texts[idx]
|
41
43
|
else:
|
42
44
|
text = self.texts[idx][self.hf_field]
|
@@ -94,7 +96,8 @@ class BaseDataset(Dataset):
|
|
94
96
|
del self.texts
|
95
97
|
self.texts = None
|
96
98
|
for index in range(num_texts):
|
97
|
-
|
99
|
+
item = txts.pop() if isinstance(txts, list) else txts.pop()[self.hf_field]
|
100
|
+
self.inputs.append(self.get_tokenized_text(index, txt=item))
|
98
101
|
if verbose and index % log_interval == 0:
|
99
102
|
print(f'Processed {index + 1}/{num_texts}')
|
100
103
|
self.is_pre_tokenized = True
|
@@ -12,7 +12,7 @@ rxnn/training/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
rxnn/training/base.py,sha256=xPMA2Bg9-oUZvSZg67ls2p7Gk9pZ9IHUiIJwUzSe2K8,11766
|
13
13
|
rxnn/training/bml.py,sha256=S1ZaXTybzeJH7uVFamCr4TPl2bLyZ5xmn_lSsjThTiM,19162
|
14
14
|
rxnn/training/callbacks.py,sha256=_YfMKY_eFdc-tubhO9nYH2PXDZDQwlSI74FVOoCXpQg,22108
|
15
|
-
rxnn/training/dataset.py,sha256=
|
15
|
+
rxnn/training/dataset.py,sha256=Vak29XMVGOnu7okim_6Lo0E9Jz95U-scOPi-5d8alHg,12477
|
16
16
|
rxnn/training/scheduler.py,sha256=ow6oALzWjWQmHSpcJEjv6tg4g4CDMvr73TypxfcefMc,712
|
17
17
|
rxnn/training/tokenizer.py,sha256=umaLByMBx_NMrQElA45HLm9gkuzyKWDTFaKVd-CjXl0,8344
|
18
18
|
rxnn/transformers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -25,7 +25,7 @@ rxnn/transformers/moe.py,sha256=j6jEx6Ip0zttlUZKKn82azxo95lkLZs-H2GLSMD88hY,5859
|
|
25
25
|
rxnn/transformers/positional.py,sha256=2l38RS0Dini3f6Z3LUHr3XwWzg1UK7fO2C6wazWDAYU,4292
|
26
26
|
rxnn/transformers/sampler.py,sha256=poWBpxg1iuK5gEJtxHkk5VVfS9V48hs2Olqdhy_Gw8c,6548
|
27
27
|
rxnn/utils.py,sha256=d5U8i5ukovgDyqiycc2AoxObTz_eF_bgo2MKvdtJ98s,467
|
28
|
-
rxnn-0.1.
|
29
|
-
rxnn-0.1.
|
30
|
-
rxnn-0.1.
|
31
|
-
rxnn-0.1.
|
28
|
+
rxnn-0.1.73.dist-info/LICENSE,sha256=C8coDFIUYuOcke4JLPwTqahQUCyXyGq6WOaigOkx8tY,11275
|
29
|
+
rxnn-0.1.73.dist-info/METADATA,sha256=lo-8t4WHBKlvoBFoEzqebdCdZUWhheLsPu-v-pW8CIU,16579
|
30
|
+
rxnn-0.1.73.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
31
|
+
rxnn-0.1.73.dist-info/RECORD,,
|
File without changes
|
File without changes
|