Refactor launcher to be object-oriented (#63)
* Import of annoy library uses failed_import mechanism.
This commit is contained in:
1 parent
3fd433ffab
commit
2804a7c24f
2 files changed
+417
-355
No files matched your search
@@ -18,7 +18,12 @@ import os
|
||||
import pickle
|
||||
|
||||
import numpy as np
|
||||
from annoy import AnnoyIndex
|
||||
try:
|
||||
import annoy
|
||||
from annoy import AnnoyIndex
|
||||
except ImportError:
|
||||
from rl_coach.logger import failed_imports
|
||||
failed_imports.append("annoy")
|
||||
|
||||
|
||||
class AnnoyDictionary(object):
|
||||
@@ -283,4 +288,4 @@ def load_dnd(model_dir):
|
||||
|
||||
DND.dicts[a].index.build(50)
|
||||
|
||||
return DND
|
||||
return DND
|
||||
Reference in new issue
Block a user