Skip to content

Commit

Permalink
add parameter check to custom_embedding layer
Browse files Browse the repository at this point in the history
  • Loading branch information
BrikerMan committed Feb 21, 2019
1 parent dec5b01 commit 9d0fb59
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kashgari/embeddings/embeddings.py
Expand Up @@ -333,6 +333,8 @@ def __init__(self,
:param embedding_size: embedding vector size, only need to set when using a CustomEmbedding
:param kwargs: kwargs to pass to the method, func: `BaseEmbedding.build`
"""
if sequence_length is None or embedding_size is None:
raise ValueError('Must set sequence_length and sequence_length when using the CustomEmbedding layer')
super(CustomEmbedding, self).__init__(name_or_path, sequence_length, embedding_size, **kwargs)

def build(self, **kwargs):
Expand Down

0 comments on commit 9d0fb59

Please sign in to comment.