deeplotx 0.4.10__tar.gz → 0.4.11__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.10 → deeplotx-0.4.11}/PKG-INFO +1 -1
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/encoder/bert_encoder.py +2 -1
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/encoder/longformer_encoder.py +2 -1
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx.egg-info/PKG-INFO +1 -1
- {deeplotx-0.4.10 → deeplotx-0.4.11}/pyproject.toml +1 -1
- {deeplotx-0.4.10 → deeplotx-0.4.11}/LICENSE +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/README.md +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/__init__.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/encoder/__init__.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/encoder/long_text_encoder.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/nn/__init__.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/nn/auto_regression.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/nn/base_neural_network.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/nn/linear_regression.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/nn/logistic_regression.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/nn/recursive_sequential.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/nn/softmax_regression.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/similarity/__init__.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/similarity/distribution.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/similarity/set.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/similarity/vector.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/trainer/__init__.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/trainer/base_trainer.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/trainer/text_binary_classification_trainer.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/util/__init__.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/util/hash.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx/util/read_file.py +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx.egg-info/SOURCES.txt +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx.egg-info/dependency_links.txt +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx.egg-info/requires.txt +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/deeplotx.egg-info/top_level.txt +0 -0
- {deeplotx-0.4.10 → deeplotx-0.4.11}/setup.cfg +0 -0
@@ -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
|
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
|
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,
|
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
|