Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle exception when loading cache file in test_inference.py #5802

Merged
merged 4 commits into from
Jul 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
tjruwase marked this conversation as resolved.
Show resolved Hide resolved
print(f"Error loading cache file {cache_file_path}: {e}")

current_time = time.time()

Expand Down
Loading