deeplotx 0.4.10__py3-none-any.whl → 0.4.11__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.
@@ -16,7 +16,8 @@ logger = logging.getLogger('deeplotx.embedding')
16
16
  class BertEncoder(nn.Module):
17
17
  def __init__(self, model_name_or_path: str = DEFAULT_BERT, device: str | None = None):
18
18
  super().__init__()
19
- self.device = device if device is not None else torch.device('cuda' if torch.cuda.is_available() else 'cpu')
19
+ self.device = torch.device(device) if device is not None \
20
+ else torch.device('cuda' if torch.cuda.is_available() else 'cpu')
20
21
  self.tokenizer = BertTokenizer.from_pretrained(pretrained_model_name_or_path=model_name_or_path,
21
22
  cache_dir=CACHE_PATH, _from_auto=True)
22
23
  self.bert = BertModel.from_pretrained(pretrained_model_name_or_path=model_name_or_path,
@@ -15,7 +15,8 @@ logger = logging.getLogger('deeplotx.embedding')
15
15
  class LongformerEncoder(nn.Module):
16
16
  def __init__(self, model_name_or_path: str = DEFAULT_LONGFORMER, device: str | None = None):
17
17
  super().__init__()
18
- self.device = device if device is not None else torch.device('cuda' if torch.cuda.is_available() else 'cpu')
18
+ self.device = torch.device(device) if device is not None \
19
+ else torch.device('cuda' if torch.cuda.is_available() else 'cpu')
19
20
  self.tokenizer = LongformerTokenizer.from_pretrained(pretrained_model_name_or_path=model_name_or_path,
20
21
  cache_dir=CACHE_PATH, _from_auto=True)
21
22
  self.bert = LongformerModel.from_pretrained(pretrained_model_name_or_path=model_name_or_path,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deeplotx
3
- Version: 0.4.10
3
+ Version: 0.4.11
4
4
  Summary: Easy-2-use long text NLP toolkit.
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -1,8 +1,8 @@
1
1
  deeplotx/__init__.py,sha256=wMN_AI14V-0BPbQghYpvd2y7eUGfhr7jKTTuur-5Upg,1002
2
2
  deeplotx/encoder/__init__.py,sha256=EM-xrTsHoGaiiFpj-iFAxilMHXC_sQKWYrcq1qCnI3U,138
3
- deeplotx/encoder/bert_encoder.py,sha256=VCmYsBSqB9bRL_ge4bYssyx-Xy4oR0-DE1cMTuTn1tU,2412
3
+ deeplotx/encoder/bert_encoder.py,sha256=IZsmkcmK6ulwTS4zubljW5uvq2r1Ik03nYG6jqcgQL8,2441
4
4
  deeplotx/encoder/long_text_encoder.py,sha256=7On6NuaINDZLqgb3HsSJBEzbWXNZPh_MXAvO5KY471k,3313
5
- deeplotx/encoder/longformer_encoder.py,sha256=J8Si8Ta0bh7Vo7YsV0XdC7jGrvIt54GKcHr_pq2qHbI,1857
5
+ deeplotx/encoder/longformer_encoder.py,sha256=vsDIiS9kLzvAalDnCGfTuAd2gfqDBgKUqPj6tPgF-BM,1886
6
6
  deeplotx/nn/__init__.py,sha256=oQ-vYXyuaGelfCOs2im_gZXAiiBlCCVXh1uw9yjvRMs,253
7
7
  deeplotx/nn/auto_regression.py,sha256=o82C9TREZbhGdj2knSVGTXhjJne0LGEqc7BllByJJWE,449
8
8
  deeplotx/nn/base_neural_network.py,sha256=xWKG4FX6Jzdlrfc1HOW1aO9uh0Af3D-dB5Jl7eCxsAk,1635
@@ -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.10.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
24
- deeplotx-0.4.10.dist-info/METADATA,sha256=2x4T_toVpNHl8eXdLmHwKjjjvOPEsTB2qVg3pvyLltA,6285
25
- deeplotx-0.4.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
- deeplotx-0.4.10.dist-info/top_level.txt,sha256=hKg4pVDXZ-WWxkRfJFczRIll1Sv7VyfKCmzHLXbuh1U,9
27
- deeplotx-0.4.10.dist-info/RECORD,,
23
+ deeplotx-0.4.11.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
24
+ deeplotx-0.4.11.dist-info/METADATA,sha256=klv-VdFTBgvSfm6KkqmjEtxXvCe_HO3E2ccoQG02Uxw,6285
25
+ deeplotx-0.4.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
26
+ deeplotx-0.4.11.dist-info/top_level.txt,sha256=hKg4pVDXZ-WWxkRfJFczRIll1Sv7VyfKCmzHLXbuh1U,9
27
+ deeplotx-0.4.11.dist-info/RECORD,,