1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-03 19:10:58 +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.
# Licensed under the MIT License.
import os
from qlib.utils.serial import Serializable
import mlflow, logging
import shutil, os, pickle, tempfile, codecs, pickle
@@ -333,7 +334,9 @@ class MLflowRecorder(Recorder):
try:
path = self.client.download_artifacts(self.id, name)
with Path(path).open("rb") as f:
return pickle.load(f)
data = pickle.load(f)
os.remove(path)
return data
except Exception as e:
raise LoadObjectError(message=str(e))