Ver Fonte

no gpu if vram < 2GB

Michael Yang há 1 ano atrás
pai
commit
811c3d1900
1 ficheiros alterados com 5 adições e 0 exclusões
  1. 5 0
      llm/llama.go

+ 5 - 0
llm/llama.go

@@ -215,6 +215,11 @@ func CheckVRAM() (int64, error) {
 		free += vram
 	}
 
+	if free*1024*1024 < 2*1000*1000*1000 {
+		log.Printf("less than 2 GB VRAM available, falling back to CPU only")
+		free = 0
+	}
+
 	return free, nil
 }