Upgraded the hardware management

This commit is contained in:
Saifeddine ALOUI
2024-01-04 03:57:42 +01:00
parent e868dc09cf
commit ac7afbb5a6
16 changed files with 403 additions and 452 deletions

View File

@ -4,24 +4,40 @@
<h1 class="text-4xl font-bold mb-4">LOLLMS installation tool</h1>
<p class="text-left">
Welcome to the installer of lollms. Here you can select your install profile.<br>
Let's start by selecting the install mode.<br><br>
Let's start by selecting the hardware.<br><br>
</p>
<div class="flex flex-col gap-2">
<label class="flex items-center">
<input type="radio" value="cuda" v-model="selectedOption" class="mr-2">
Use NVIDIA GPU with CUDA
</label>
<label class="flex items-center">
<input type="radio" value="rocm" v-model="selectedOption" class="mr-2">
Use AMD GPU with ROCm
<input type="radio" value="cpu-noavx" v-model="selectedOption" class="mr-2">
Use CPU without AVX (for old CPUs)
</label>
<label class="flex items-center">
<input type="radio" value="cpu" v-model="selectedOption" class="mr-2">
Use CPU (no GPU)
Use CPU with AVX support (new CPUs)
</label>
<label class="flex items-center">
<input type="radio" value="metal" v-model="selectedOption" class="mr-2">
Use Metal (for Apple Silicon like M1 and M2)
<input type="radio" value="nvidia" v-model="selectedOption" class="mr-2">
Use NVIDIA GPU without tensorcore (for old GPUs)
</label>
<label class="flex items-center">
<input type="radio" value="nvidia-tensorcores" v-model="selectedOption" class="mr-2">
Use NVIDIA GPU with tensorcore (new GPUs)
</label>
<label class="flex items-center">
<input type="radio" value="amd-noavx" v-model="selectedOption" class="mr-2">
Use AMD GPU with no avx
</label>
<label class="flex items-center">
<input type="radio" value="amd" v-model="selectedOption" class="mr-2">
Use AMD GPU
</label>
<label class="flex items-center">
<input type="radio" value="apple-intel" v-model="selectedOption" class="mr-2">
Apple with intel CPU
</label>
<label class="flex items-center">
<input type="radio" value="apple-silicon" v-model="selectedOption" class="mr-2">
Apple silicon (M1, M2 M3)
</label>
</div>
<button @click="install" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 mt-4 rounded">

View File

@ -61,7 +61,7 @@ lollms_app = LollmsApplication(
load_binding=False,
load_model=False,
load_voice_service=False,
load
load_sd_service=False,
socketio=sio)
# Serve the index.html file for all routes
@ -91,39 +91,59 @@ def start_installing(data: InstallProperties):
Returns:
- A dictionary with a "message" key indicating the success of the installation.
"""
# Install mode (cpu, cpu-noavx, nvidia-tensorcores, nvidia, amd-noavx, amd, apple-intel, apple-silicon)
if data.mode=="cpu":
config.enable_gpu=False
config.hardware_mode="cpu"
try:
lollms_app.ShowBlockingMessage("Installing pytorch for CPU")
reinstall_pytorch_with_cpu()
lollms_app.ShowBlockingMessage("Setting hardware configuration to CPU")
config.save_config()
lollms_app.HideBlockingMessage()
except:
lollms_app.HideBlockingMessage()
elif data.mode=="cuda":
config.enable_gpu=True
if data.mode=="cpu-noavx":
config.hardware_mode="cpu-noavx"
try:
lollms_app.ShowBlockingMessage("Setting hardware configuration to CPU with no avx support")
config.save_config()
lollms_app.HideBlockingMessage()
except:
lollms_app.HideBlockingMessage()
elif data.mode=="nvidia":
config.hardware_mode="nvidia"
try:
lollms_app.ShowBlockingMessage("Installing pytorch for nVidia GPU (cuda)")
reinstall_pytorch_with_cuda()
config.save_config()
lollms_app.HideBlockingMessage()
except:
lollms_app.HideBlockingMessage()
elif data.mode=="rocm":
config.enable_gpu=True
elif data.mode=="nvidia-tensorcores":
config.hardware_mode="nvidia-tensorcores"
try:
lollms_app.ShowBlockingMessage("Installing pytorch for nVidia GPU (cuda)")
config.save_config()
lollms_app.HideBlockingMessage()
except:
lollms_app.HideBlockingMessage()
elif data.mode=="amd":
config.hardware_mode="amd"
try:
lollms_app.ShowBlockingMessage("Installing pytorch for AMD GPU (rocm)")
reinstall_pytorch_with_rocm()
config.save_config()
lollms_app.HideBlockingMessage()
except:
lollms_app.HideBlockingMessage()
elif data.mode=="metal":
elif data.mode=="apple-silicon":
config.hardware_mode="apple-silicon"
try:
lollms_app.ShowBlockingMessage("Installing pytorch for Apple Silicon (Metal)")
config.save_config()
lollms_app.HideBlockingMessage()
except:
lollms_app.HideBlockingMessage()
elif data.mode=="apple-intel":
config.hardware_mode="apple-intel"
try:
lollms_app.ShowBlockingMessage("Installing pytorch for Apple Silicon (Metal)")
config.enable_gpu=False
reinstall_pytorch_with_cpu()
config.save_config()
lollms_app.HideBlockingMessage()
except: