aboutsummaryrefslogtreecommitdiffstats
path: root/modules/xlmr.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-05-21 14:37:09 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-05-21 14:37:09 +0000
commit1f3182924ba8e70d0e0fc3ed270782f324376ba3 (patch)
tree27a9e5167e5b981dfe56f5084ea8e1e8743f3fc0 /modules/xlmr.py
parent89f9faa63388756314e8a1d96cf86bf5e0663045 (diff)
parentfdaf0147b6d2a5f599464bb7c65817ef5832eff1 (diff)
downloadstable-diffusion-webui-gfx803-1f3182924ba8e70d0e0fc3ed270782f324376ba3.tar.gz
stable-diffusion-webui-gfx803-1f3182924ba8e70d0e0fc3ed270782f324376ba3.tar.bz2
stable-diffusion-webui-gfx803-1f3182924ba8e70d0e0fc3ed270782f324376ba3.zip
Merge branch 'dev' into release_candidate
Diffstat (limited to 'modules/xlmr.py')
-rw-r--r--modules/xlmr.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/xlmr.py b/modules/xlmr.py
index beab3fdf..a407a3ca 100644
--- a/modules/xlmr.py
+++ b/modules/xlmr.py
@@ -1,4 +1,4 @@
-from transformers import BertPreTrainedModel,BertModel,BertConfig
+from transformers import BertPreTrainedModel, BertConfig
import torch.nn as nn
import torch
from transformers.models.xlm_roberta.configuration_xlm_roberta import XLMRobertaConfig
@@ -28,7 +28,7 @@ class BertSeriesModelWithTransformation(BertPreTrainedModel):
config_class = BertSeriesConfig
def __init__(self, config=None, **kargs):
- # modify initialization for autoloading
+ # modify initialization for autoloading
if config is None:
config = XLMRobertaConfig()
config.attention_probs_dropout_prob= 0.1
@@ -74,7 +74,7 @@ class BertSeriesModelWithTransformation(BertPreTrainedModel):
text["attention_mask"] = torch.tensor(
text['attention_mask']).to(device)
features = self(**text)
- return features['projection_state']
+ return features['projection_state']
def forward(
self,
@@ -134,4 +134,4 @@ class BertSeriesModelWithTransformation(BertPreTrainedModel):
class RobertaSeriesModelWithTransformation(BertSeriesModelWithTransformation):
base_model_prefix = 'roberta'
- config_class= RobertaSeriesConfig \ No newline at end of file
+ config_class= RobertaSeriesConfig