Spaces:
Running on Zero
Running on Zero
fix: remove non-ASCII unicode characters from print calls in model_loader.py
Browse files18 unmodified lines192021222324252627282930313233343536373818 unmodified linesdef ensure_models_downloaded(base_dir: str = "."):"""Downloads all 8 production models from Hugging Face Hub on startup."""print("🚀 Verifying and downloading Agrovia AI models from Hub...")for rel_dir, filename in MODEL_MANIFEST:dest_dir = Path(base_dir) / rel_dirdest_dir.mkdir(parents=True, exist_ok=True)dest_path = dest_dir / filenameif not dest_path.exists() or dest_path.stat().st_size == 0:print(f" ↓ Downloading {filename} to {dest_dir}...")downloaded = hf_hub_download(repo_id=REPO_ID,filename=filename,local_dir=str(dest_dir),local_dir_use_symlinks=False)print(f" ✓ {filename} ready.")else:print(f" ✓ {filename} already cached ({dest_path.stat().st_size:,} bytes).")18 unmodified lines1920212223242526272829303132333435363738394018 unmodified linesdef ensure_models_downloaded(base_dir: str = "."):"""Downloads all 8 production models from Hugging Face Hub on startup."""print("Verifying and downloading Agrovia AI models from Hub...")for rel_dir, filename in MODEL_MANIFEST:dest_dir = Path(base_dir) / rel_dirdest_dir.mkdir(parents=True, exist_ok=True)dest_path = dest_dir / filenameif not dest_path.exists() or dest_path.stat().st_size == 0:print(f"Downloading {filename} to {dest_dir}...")try:downloaded = hf_hub_download(repo_id=REPO_ID,filename=filename,local_dir=str(dest_dir),)print(f"Model {filename} downloaded successfully.")except Exception as exc:print(f"Failed to download {filename}: {exc}")else:print(f"Model {filename} already present ({dest_path.stat().st_size:,} bytes).")
app/core/model_loader.py+12-10