Skip to content

Commit cf5f072

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent fefa8d1 commit cf5f072

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

monai/networks/blocks/text_embedding.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(
5555
self.spatial_dims = spatial_dims
5656
if spatial_dims not in (2, 3):
5757
raise ValueError("spatial dimension should be 2 or 3.")
58-
58+
5959
if self.encoding == 'rand_embedding':
6060
self.text_embedding = nn.Embedding(out_channels, hidden_size)
6161
elif self.encoding == 'clip_embedding':
@@ -64,7 +64,7 @@ def __init__(
6464
model_url = url_map["clip_encoding_univeral_model_31"]
6565
pretrain_state_dict = model_zoo.load_url(model_url)
6666
self.text_embedding.data = pretrain_state_dict.float()
67-
print('load word embedding: {}'.format(self.encoding))
67+
print(f'load word embedding: {self.encoding}')
6868
self.text_to_vision = nn.Linear(text_dim, hidden_size)
6969
else:
7070
raise Exception(f'{self.encoding} is not implemented, please add your own')

tests/test_text_encoding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_test_encoding_shape(self):
3333
print(text_encoding.shape)
3434
self.assertEqual(text_encoding.shape, (32,256,1,1,1))
3535

36-
# test random enbedding
36+
# test random enbedding
3737
text_encoder = TextEncoder(spatial_dims=3, out_channels=32, encoding="rand_embedding", pretrained=True).to(device)
3838
text_encoding = text_encoder()
3939
print(text_encoding.shape)

0 commit comments

Comments
 (0)