deeplotx 0.4.7__py3-none-any.whl → 0.4.8__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.
@@ -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=torch.float32)
32
- for _emb in fin_embedding:
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.long),
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))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deeplotx
3
- Version: 0.4.7
3
+ Version: 0.4.8
4
4
  Summary: Easy-2-use long text NLP toolkit.
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -1,7 +1,7 @@
1
1
  deeplotx/__init__.py,sha256=wMN_AI14V-0BPbQghYpvd2y7eUGfhr7jKTTuur-5Upg,1002
2
2
  deeplotx/encoder/__init__.py,sha256=EM-xrTsHoGaiiFpj-iFAxilMHXC_sQKWYrcq1qCnI3U,138
3
3
  deeplotx/encoder/bert_encoder.py,sha256=6QY2pOvayWNz4w749JAGndvQ-jeKJgy3BalQl2JCkgk,1994
4
- deeplotx/encoder/long_text_encoder.py,sha256=KEld6LRHuUc2nP_t_KTVfb3F3TYkIieS4jSzkR0tEVs,3275
4
+ deeplotx/encoder/long_text_encoder.py,sha256=FP0ACiOaOCjK2buRSWqBs-peg3IWQKuIdP2S00LNvSs,3271
5
5
  deeplotx/encoder/longformer_encoder.py,sha256=4avKYsLN6TTpPoky8BQ0nIhQm8lVxMvvzqkrdKCWj3Q,1433
6
6
  deeplotx/nn/__init__.py,sha256=oQ-vYXyuaGelfCOs2im_gZXAiiBlCCVXh1uw9yjvRMs,253
7
7
  deeplotx/nn/auto_regression.py,sha256=o82C9TREZbhGdj2knSVGTXhjJne0LGEqc7BllByJJWE,449
@@ -20,8 +20,8 @@ deeplotx/trainer/text_binary_classification_trainer.py,sha256=5O-5dwVMCj5EDX9gjJ
20
20
  deeplotx/util/__init__.py,sha256=JxqAK_WOOHcYVSTHBT1-WuBwWrPEVDTV3titeVWvNUM,74
21
21
  deeplotx/util/hash.py,sha256=wwsC6kOQvbpuvwKsNQOARd78_wePmW9i3oaUuXRUnpc,352
22
22
  deeplotx/util/read_file.py,sha256=ptzouvEQeeW8KU5BrWNJlXw-vFXVrpS9SkAUxsu6A8A,612
23
- deeplotx-0.4.7.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
24
- deeplotx-0.4.7.dist-info/METADATA,sha256=oXBTSPd2wYHvbcM7A_-fTiln6CjxVkLQLF9nApv5B7g,1656
25
- deeplotx-0.4.7.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
26
- deeplotx-0.4.7.dist-info/top_level.txt,sha256=hKg4pVDXZ-WWxkRfJFczRIll1Sv7VyfKCmzHLXbuh1U,9
27
- deeplotx-0.4.7.dist-info/RECORD,,
23
+ deeplotx-0.4.8.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
24
+ deeplotx-0.4.8.dist-info/METADATA,sha256=KMyt-My-d5261MGBfC1_HsyqbJ_KVEvZ--kZNFq8B2A,1656
25
+ deeplotx-0.4.8.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
26
+ deeplotx-0.4.8.dist-info/top_level.txt,sha256=hKg4pVDXZ-WWxkRfJFczRIll1Sv7VyfKCmzHLXbuh1U,9
27
+ deeplotx-0.4.8.dist-info/RECORD,,