Spaces:
Runtime error
Runtime error
change weight file
Browse files33 unmodified lines3435363737383940101 unmodified lines14214314414514514614714914814915015215115215415315415515633 unmodified lines# configWEIGHTS = { "Flexible": os.path.join(WEIGHT_DIR, "250312_flexi.pth"), "Forest": os.path.join(WEIGHT_DIR, "230103_randresize_full.pth"), "Forest": os.path.join(WEIGHT_DIR, "250711_tropical_closed_canopy.pth"), "Urban": os.path.join(WEIGHT_DIR, "urban_trees_Cambridge_20230630.pth"),}
101 unmodified lines fname = os.path.basename(path) dest = os.path.join(WEIGHT_DIR, fname)
# optional: space check so we fail gracefully total, used, free = shutil.disk_usage("/data") need = os.path.getsize(path) if need > free: return f"❌ Not enough space: need {need/1024**2:.2f} MB, free {free/1024**2:.2f} MB." return f"Not enough space: need {need/1024**2:.2f} MB, free {free/1024**2:.2f} MB."
shutil.copy2(path, dest) return f"✅ Saved {fname} to {WEIGHT_DIR}" return f"Saved {fname} to {WEIGHT_DIR}" except Exception as e: return "❌ Upload failed:\n" + traceback.format_exc() return "Upload failed:\n" + traceback.format_exc()
def list_persistent():app.py+4-5