Skip to content

Commit 6a53939

Browse files
committed
update error handling in evaluation/data_loader.py
1 parent 5954566 commit 6a53939

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

FlagEmbedding/abc/evaluation/data_loader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def _download_file(self, download_url: str, save_dir: str):
192192
try:
193193
subprocess.run(cmd, check=True)
194194
except subprocess.CalledProcessError as e:
195-
logger.error(f"Error code: {e.returncode}. Error message: {e.stderr}")
195+
logger.warning(e.output)
196196

197197
if not os.path.exists(save_path) or os.path.getsize(save_path) == 0:
198198
raise FileNotFoundError(f"Failed to download file from {download_url} to {save_path}")
@@ -217,7 +217,7 @@ def _download_gz_file(self, download_url: str, save_dir: str):
217217
try:
218218
subprocess.run(cmd, check=True)
219219
except subprocess.CalledProcessError as e:
220-
logger.error(f"Error code: {e.returncode}. Error message: {e.output}")
220+
logger.warning(e.output)
221221

222222
file_path = gz_file_path.replace(".gz", "")
223223
if not os.path.exists(file_path) or self._get_fpath_size(file_path) == 0:
@@ -236,7 +236,7 @@ def _download_zip_file(self, download_url: str, save_dir: str):
236236
try:
237237
subprocess.run(cmd, check=True)
238238
except subprocess.CalledProcessError as e:
239-
logger.error(f"Error code: {e.returncode}. Error message: {e.output}")
239+
logger.warning(e.output)
240240

241241
if not os.path.exists(file_path) or self._get_fpath_size(file_path) == 0:
242242
raise FileNotFoundError(f"Failed to unzip file {zip_file_path}")

0 commit comments

Comments
 (0)