LMartinezEXEX commited on
Commit
0fbc7e6
1 Parent(s): e603b20

Minimal code refractor of connector classes

Browse files
Files changed (1) hide show
  1. modules/module_connection.py +4 -6
modules/module_connection.py CHANGED
@@ -44,9 +44,8 @@ class WordExplorerConnector(Connector):
44
  **kwargs
45
  ) -> None:
46
 
47
- if 'embedding' in kwargs:
48
- embedding = kwargs.get('embedding')
49
- else:
50
  raise KeyError
51
 
52
  self.word_explorer = WordExplorer(
@@ -115,9 +114,8 @@ class BiasWordExplorerConnector(Connector):
115
  **kwargs
116
  ) -> None:
117
 
118
- if 'embedding' in kwargs:
119
- embedding = kwargs.get('embedding')
120
- else:
121
  raise KeyError
122
 
123
  self.bias_word_explorer_2_spaces = WEBiasExplorer2Spaces(
 
44
  **kwargs
45
  ) -> None:
46
 
47
+ embedding = kwargs.get('embedding', None)
48
+ if embedding is None:
 
49
  raise KeyError
50
 
51
  self.word_explorer = WordExplorer(
 
114
  **kwargs
115
  ) -> None:
116
 
117
+ embedding = kwargs.get('embedding', None)
118
+ if embedding is None:
 
119
  raise KeyError
120
 
121
  self.bias_word_explorer_2_spaces = WEBiasExplorer2Spaces(