1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-15 00:36:55 +08:00

rm recorder temp file

This commit is contained in:
Dong Zhou
2021-11-01 09:29:44 +00:00
parent e54b019ee2
commit d929d4bb21

View File

@@ -1,6 +1,7 @@
# Copyright (c) Microsoft Corporation. # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License. # Licensed under the MIT License.
import os
from qlib.utils.serial import Serializable from qlib.utils.serial import Serializable
import mlflow, logging import mlflow, logging
import shutil, os, pickle, tempfile, codecs, pickle import shutil, os, pickle, tempfile, codecs, pickle
@@ -333,7 +334,9 @@ class MLflowRecorder(Recorder):
try: try:
path = self.client.download_artifacts(self.id, name) path = self.client.download_artifacts(self.id, name)
with Path(path).open("rb") as f: with Path(path).open("rb") as f:
return pickle.load(f) data = pickle.load(f)
os.remove(path)
return data
except Exception as e: except Exception as e:
raise LoadObjectError(message=str(e)) raise LoadObjectError(message=str(e))