mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-18 06:10:43 -07:00
Enhance model caching checks and progress tracking for downloads
- Updated caching methods in MLX, PyTorch, and backend to ensure models are fully downloaded before being marked as cached. - Improved progress tracking to filter out non-download progress and provide accurate feedback during model downloads. - Enhanced HFProgressTracker to skip non-byte progress bars and ensure meaningful progress reporting. - Refactored progress initialization to provide immediate feedback while fetching metadata from HuggingFace. - Added error handling and logging for better debugging during cache checks and download processes.
This commit is contained in:
@@ -89,7 +89,14 @@ class ProgressManager:
|
||||
import time
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
progress_pct = (current / total * 100) if total > 0 else 0
|
||||
# Calculate progress percentage, clamped to 0-100 range
|
||||
# This prevents crazy percentages from edge cases like:
|
||||
# - current > total temporarily during aggregation
|
||||
# - mixing file-count progress with byte-count progress
|
||||
if total > 0:
|
||||
progress_pct = min(100.0, max(0.0, (current / total * 100)))
|
||||
else:
|
||||
progress_pct = 0
|
||||
|
||||
progress_data = {
|
||||
"model_name": model_name,
|
||||
|
||||
Reference in New Issue
Block a user