Fix offload detection with CPU only envs

This commit is contained in:
Disty0
2025-08-16 16:12:43 +03:00
parent 8af64b1e10
commit 6597a9111f
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -89,6 +89,8 @@ devices.device = devices.get_optimal_device()
mem_stat = memory_stats()
cpu_memory = round(mem_stat['ram']['total'] if "ram" in mem_stat else 0)
gpu_memory = round(mem_stat['gpu']['total'] if "gpu" in mem_stat else 0)
if gpu_memory == 0:
gpu_memory = cpu_memory
native = backend == Backend.DIFFUSERS
if not files_cache.do_cache_folders:
log.warning('File cache disabled: ')