예제 #1
0
 def put(self, *path_args, **path_kwargs):
     mclass = self.args.pop('class', self.get_opt('class'))
     self.set_opt('class', mclass)
     params = self.get_opt('params', {})
     if mclass:
         # parse the params as the signature dictates
         for param in signature(
                 search_modelclass(mclass)).parameters & self.args.keys():
             value = self.args.pop(param)
             params[param] = value
     # Since model params are changing, remove the model on disk
     self.model = None
     safe_rmtree(self.model_path, gramexdata=False)
     self.set_opt('params', params)
     for opt in TRANSFORMS.keys() & self.args.keys():
         val = self.args.pop(opt)
         self.set_opt(opt, val)
     self.config_store.flush()
예제 #2
0
 def _delete_model(self):
     safe_rmtree(self.model_path, gramexdata=False)
     self.config_store.purge()