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