gaotingquan il y a 1 an
Parent
commit
83eee741e7

+ 1 - 3
paddlex/inference/components/transforms/image/common.py

@@ -91,9 +91,7 @@ class ReadImage(_BaseRead):
     def apply(self, img):
         """apply"""
         if isinstance(img, np.ndarray):
-            with temp_file_manager.temp_file_context(
-                delete=True, suffix=".png"
-            ) as temp_file:
+            with temp_file_manager.temp_file_context(suffix=".png") as temp_file:
                 img_path = Path(temp_file.name)
                 self._writer.write(img_path, img)
                 yield [

+ 1 - 3
paddlex/inference/components/transforms/ts/common.py

@@ -59,9 +59,7 @@ class ReadTS(_BaseRead):
 
     def apply(self, ts):
         if isinstance(ts, pd.DataFrame):
-            with temp_file_manager.temp_file_context(
-                delete=True, suffix=".csv"
-            ) as temp_file:
+            with temp_file_manager.temp_file_context(suffix=".csv") as temp_file:
                 input_path = Path(temp_file.name)
                 ts_path = input_path.as_posix()
                 self._writer.write(ts_path, ts)