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:
@@ -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))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user