Skip to content

Commit

Permalink
fix: handle exception when loading cache file in test_inference.py (#…
Browse files Browse the repository at this point in the history
…5802)

This PR is to fix CI failures such as
https://github.com/microsoft/DeepSpeed/actions/runs/10085903860/job/27887546470#step:8:3616
cc @tjruwase

Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.com>
  • Loading branch information
HeyangQin and loadams authored Jul 29, 2024
1 parent afe1b9e commit 58241b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/unit/inference/test_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ def _hf_model_list() -> List[ModelInfo]:
model_data = {"cache_time": 0, "model_list": []}
if os.path.isfile(cache_file_path):
with open(cache_file_path, 'rb') as f:
model_data = pickle.load(f)
try:
model_data = pickle.load(f)
except Exception as e:
print(f"Error loading cache file {cache_file_path}: {e}")

current_time = time.time()

Expand Down

0 comments on commit 58241b1

Please sign in to comment.