Skip to content

Commit 29a4c46

Browse files
committed
Fixing --release option
1 parent cab3bbd commit 29a4c46

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

code2vec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def load_model_dynamically(config: Config) -> Code2VecModelBase:
2727
if config.SAVE_T2V is not None:
2828
model.save_word2vec_format(config.SAVE_T2V, VocabType.Target)
2929
config.log('Target word vectors saved in word2vec text format in: %s' % config.SAVE_T2V)
30-
if config.is_testing and not config.is_training:
30+
if (config.is_testing and not config.is_training) or config.RELEASE:
3131
eval_results = model.evaluate()
3232
if eval_results is not None:
3333
config.log(

model_base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def __init__(self, config: Config):
4141

4242
self._log_creating_model()
4343

44-
self._init_num_of_examples()
44+
if not config.RELEASE:
45+
self._init_num_of_examples()
4546
self._log_model_configuration()
4647
self.vocabs = Code2VecVocabs(config)
4748
self.vocabs.target_vocab.get_index_to_word_lookup_table() # just to initialize it (if not already initialized)
@@ -53,7 +54,7 @@ def _log_creating_model(self):
5354
self.log('')
5455
self.log('---------------------------------------------------------------------')
5556
self.log('---------------------------------------------------------------------')
56-
self.log('---------------------- Creating word2vec model ----------------------')
57+
self.log('---------------------- Creating code2vec model ----------------------')
5758
self.log('---------------------------------------------------------------------')
5859
self.log('---------------------------------------------------------------------')
5960

0 commit comments

Comments
 (0)