deeplotx 0.4.7__tar.gz → 0.4.8__tar.gz
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.
- {deeplotx-0.4.7 → deeplotx-0.4.8}/PKG-INFO +1 -1
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/encoder/long_text_encoder.py +3 -3
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx.egg-info/PKG-INFO +1 -1
- {deeplotx-0.4.7 → deeplotx-0.4.8}/pyproject.toml +1 -1
- {deeplotx-0.4.7 → deeplotx-0.4.8}/LICENSE +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/README.md +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/__init__.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/encoder/__init__.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/encoder/bert_encoder.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/encoder/longformer_encoder.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/nn/__init__.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/nn/auto_regression.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/nn/base_neural_network.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/nn/linear_regression.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/nn/logistic_regression.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/nn/recursive_sequential.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/nn/softmax_regression.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/similarity/__init__.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/similarity/distribution.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/similarity/set.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/similarity/vector.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/trainer/__init__.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/trainer/base_trainer.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/trainer/text_binary_classification_trainer.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/util/__init__.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/util/hash.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx/util/read_file.py +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx.egg-info/SOURCES.txt +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx.egg-info/dependency_links.txt +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx.egg-info/requires.txt +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/deeplotx.egg-info/top_level.txt +0 -0
- {deeplotx-0.4.7 → deeplotx-0.4.8}/setup.cfg +0 -0
@@ -28,8 +28,8 @@ class LongTextEncoder(BertEncoder):
|
|
28
28
|
def postprocess(tensors: list[torch.Tensor], _flatten: bool) -> torch.Tensor:
|
29
29
|
if not _flatten:
|
30
30
|
return torch.stack(tensors, dim=0).squeeze()
|
31
|
-
_fin_emb_tensor = torch.tensor([], dtype=
|
32
|
-
for _emb in
|
31
|
+
_fin_emb_tensor = torch.tensor([], dtype=tensors[0].dtype)
|
32
|
+
for _emb in tensors:
|
33
33
|
_fin_emb_tensor = torch.cat((_fin_emb_tensor.detach().clone(), _emb.detach().clone()), dim=-1)
|
34
34
|
return _fin_emb_tensor.squeeze()
|
35
35
|
|
@@ -55,7 +55,7 @@ class LongTextEncoder(BertEncoder):
|
|
55
55
|
for i in range(num_chunks):
|
56
56
|
_tmp_left = max(i * self._chunk_size - self._overlapping, 0)
|
57
57
|
_tmp_right = (i + 1) * self._chunk_size + self._overlapping
|
58
|
-
chunks.append((i, torch.tensor([_text_to_input_ids[_tmp_left: _tmp_right]], dtype=torch.
|
58
|
+
chunks.append((i, torch.tensor([_text_to_input_ids[_tmp_left: _tmp_right]], dtype=torch.int),
|
59
59
|
torch.tensor([_text_to_input_ids_att_mask[_tmp_left: _tmp_right]], dtype=torch.int)))
|
60
60
|
with ThreadPoolExecutor(max_workers=min(num_chunks + 1, 3)) as executor:
|
61
61
|
embeddings = list(executor.map(self.__chunk_embedding, chunks))
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|