Browse Source

[MNT] update model container remove env method

tags/v0.3.2
bxdd 2 years ago
parent
commit
1f46eb1358
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      learnware/client/container.py

+ 6
- 1
learnware/client/container.py View File

@@ -61,8 +61,13 @@ class ModelEnvContainer(BaseModel):

def remove_env(self):
if self.conda_env is not None:
conda_env = self.conda_env
self.conda_env = None
remove_enviroment(self.conda_env)
try:
remove_enviroment(self.conda_env)
except Exception as err:
self.conda_env = conda_env
raise err

def run_model_with_script(self, method, **kargs):
with tempfile.TemporaryDirectory(prefix="learnware_") as tempdir:


Loading…
Cancel
Save