1
0
mirror of https://github.com/gryf/coach.git synced 2026-02-15 05:25:55 +01:00

Refactor launcher to be object-oriented (#63)

* Import of annoy library uses failed_import mechanism.
This commit is contained in:
Leo Dirac
2018-11-10 12:10:19 -08:00
committed by Gal Leibovich
parent 3fd433ffab
commit 2804a7c24f
2 changed files with 417 additions and 355 deletions

View File

@@ -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