Skip to content

Commit

Permalink
base_model_path in conf
Browse files Browse the repository at this point in the history
  • Loading branch information
svebk committed Feb 6, 2020
1 parent f9c1895 commit 1326ee9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cufacesearch/cufacesearch/searcher/searcher_lopqhbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def init_searcher(self):
try:
# This can fail with a "retrieval incomplete: got only" ...
# Or can stall... why?
# Could we change that to download using an s3_storer?
download_file(os.path.join(self.base_model_path, self.build_model_str()),
self.build_model_str())
lopq_model = pickle.load(open(self.build_model_str(), 'rb'))
Expand All @@ -157,7 +158,7 @@ def init_searcher(self):
full_trace_error(log_msg.format(self.pp, self.build_model_str(), inst))
sys.stdout.flush()
else:
log_msg = "[{}: Warning] Could not retrieve pre-trained model as `` was not set."
log_msg = "[{}: Warning] Could not retrieve pre-trained model as `base_model_path` was not set."
print(log_msg.format(self.pp, self.build_model_str()))
else:
log_msg = "[{}: log] Skipped retrieving pre-trained model from s3 as requested."
Expand Down
1 change: 1 addition & 0 deletions setup/ConfGenerator/create_conf_searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
conf[search_prefix + 'lopq_M'] = int(os.environ['lopq_M'])
conf[search_prefix + 'lopq_subq'] = int(os.environ['lopq_subq'])
conf[search_prefix + 'reranking'] = bool(int(os.getenv('reranking', 1)))
conf[search_prefix + 'base_model_path'] = os.getenv('base_model_path', None)
conf[search_prefix + 'skip_get_sim_info'] = bool(int(os.getenv('skip_get_sim_info', 0)))
if conf[search_prefix + 'model_type'] == "lopq_pca":
conf[search_prefix + 'nb_train_pca'] = int(os.environ['nb_train_pca'])
Expand Down

0 comments on commit 1326ee9

Please sign in to comment.