gracefully recover from failed model load

This commit is contained in:
Lincoln Stein 2022-10-13 12:27:04 -04:00
parent 1c102c71fc
commit 916f5bfbb2

View File

@ -72,7 +72,8 @@ class ModelCache(object):
self.models[model_name]['hash'] = hash
except Exception as e:
print(f'** model {model_name} could not be loaded: {str(e)}')
return {}
print(f'** restoring {self.current_model}')
return self.get_model(self.current_model)
self.current_model = model_name
self._push_newest_model(model_name)