From 0dfdafcd164496b2ea032dacdc7dfc06e41694b4 Mon Sep 17 00:00:00 2001 From: yxf Date: Tue, 24 Jun 2025 11:55:04 +0800 Subject: [PATCH] fix: handle case for empty filename in size computation --- gpustack/utils/hub.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gpustack/utils/hub.py b/gpustack/utils/hub.py index 4e2581f..32b7db6 100644 --- a/gpustack/utils/hub.py +++ b/gpustack/utils/hub.py @@ -49,6 +49,9 @@ def calculate_file_size( selected_files = [] extra_files = [] + if not filename: + return sum(f.size for f in files if getattr(f, 'size', None) is not None) + for sibling in files: if sibling.size is None: continue