소스 검색

fix delete

gaotingquan 1 년 전
부모
커밋
83eee741e7
2개의 변경된 파일2개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 3
      paddlex/inference/components/transforms/image/common.py
  2. 1 3
      paddlex/inference/components/transforms/ts/common.py

+ 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)