Skip to content

Commit

Permalink
Expose transformer hidden_size
Browse files Browse the repository at this point in the history
  • Loading branch information
Riccorl committed Feb 22, 2021
1 parent 5e85d24 commit 15542c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="transformer_embedder", # Replace with your own username
version="1.4.1",
version="1.4.2",
author="Riccardo Orlando",
author_email="orlandoricc@gmail.com",
description="Word level transformer based embeddings",
Expand Down
3 changes: 2 additions & 1 deletion transformer_embedder/embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def __init__(

@property
def hidden_size(self):
return self.transformer_model.config.hidden_size
multiplayer = 4 if self.output_layer == "concat" else 1
return self.transformer_model.config.hidden_size * multiplayer

def forward(
self,
Expand Down

0 comments on commit 15542c9

Please sign in to comment.