mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-04-23 02:00:46 +00:00
upgraded
This commit is contained in:
parent
bffd5735c1
commit
67e0c7a587
6
app.py
6
app.py
@ -847,10 +847,16 @@ class LoLLMsWebUI(LoLLMsAPPI):
|
||||
|
||||
|
||||
def upgrade_to_gpu(self):
|
||||
ASCIIColors.yellow("Received command to upgrade to GPU")
|
||||
ASCIIColors.info("Installing cuda toolkit")
|
||||
res = subprocess.check_call(["conda", "install", "-c", "nvidia/label/cuda-11.7.0", "-c", "nvidia", "-c", "conda-forge", "cuda-toolkit", "ninja", "git", "--force-reinstall"])
|
||||
if res!=0:
|
||||
ASCIIColors.red("Couldn't install cuda toolkit")
|
||||
return jsonify({'status':False, "error": "Couldn't install cuda toolkit. Make sure you are running from conda environment"})
|
||||
ASCIIColors.green("Cuda toolkit installed successfully")
|
||||
ASCIIColors.green("Installing pytorch with cuda support")
|
||||
res = subprocess.check_call(["pip","install","--upgrade","torch==2.0.1+cu117", "torchvision", "torchaudio", "--index-url", "https://download.pytorch.org/whl/cu117"])
|
||||
ASCIIColors.green("PyTorch installed successfully")
|
||||
self.config.enable_gpu=True
|
||||
return jsonify({'status':res==0})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user