Skip to content

Commit

Permalink
FIX
Browse files Browse the repository at this point in the history
  • Loading branch information
Dartvauder committed Oct 28, 2024
1 parent b83efd4 commit c616601
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
1 change: 1 addition & 0 deletions Install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ if "%INSTALL_TYPE%"=="CPU" (
)
echo INSTALL_TYPE=%INSTALL_TYPE%> "%CURRENT_DIR%install_config.txt"

pip install --no-deps WinTmp==1.1.0
pip install https://huggingface.co/madbuda/triton-windows-builds/resolve/main/triton-3.0.0-cp310-cp310-win_amd64.whl 2>> %ERROR_LOG%
pip install --no-build-isolation -e git+https://github.com/PanQiWei/AutoGPTQ.git#egg=auto_gptq@v0.7.1 2>> %ERROR_LOG%
pip install --no-build-isolation -e git+https://github.com/casper-hansen/AutoAWQ.git#egg=autoawq@v0.2.6 2>> %ERROR_LOG%
Expand Down
41 changes: 31 additions & 10 deletions LaunchFile/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@
import torchaudio
from audiocraft.data.audio import audio_write
import psutil
import GPUtil
import WinTmp
from pynvml import nvmlInit, nvmlDeviceGetHandleByIndex, nvmlDeviceGetTemperature, NVML_TEMPERATURE_GPU
from insightface.app import FaceAnalysis
from insightface.utils import face_align
Expand All @@ -71,6 +69,20 @@
from ThirdPartyRepository.taesd import taesd
import pandas as pd

GPUtil = None
if torch.cuda.is_available():
try:
import GPUtil
except ImportError:
GPUtil = None

WinTmp = None
if sys.platform in ['win32', 'win64']:
try:
import WinTmp
except ImportError:
WinTmp = None


def lazy_import(module_name, fromlist):
module = None
Expand Down Expand Up @@ -10471,18 +10483,27 @@ def get_system_info(progress=gr.Progress()):
progress(0.1, desc="Initializing system info retrieval")

progress(0.2, desc="Getting GPU information")
gpu = GPUtil.getGPUs()[0]
gpu_total_memory = f"{gpu.memoryTotal} MB"
gpu_used_memory = f"{gpu.memoryUsed} MB"
gpu_free_memory = f"{gpu.memoryFree} MB"
if torch.cuda.is_available():
gpu = GPUtil.getGPUs()[0]
gpu_total_memory = f"{gpu.memoryTotal} MB"
gpu_used_memory = f"{gpu.memoryUsed} MB"
gpu_free_memory = f"{gpu.memoryFree} MB"
else:
pass

progress(0.3, desc="Getting GPU temperature")
nvmlInit()
handle = nvmlDeviceGetHandleByIndex(0)
gpu_temp = nvmlDeviceGetTemperature(handle, NVML_TEMPERATURE_GPU)
if torch.cuda.is_available():
nvmlInit()
handle = nvmlDeviceGetHandleByIndex(0)
gpu_temp = nvmlDeviceGetTemperature(handle, NVML_TEMPERATURE_GPU)
else:
pass

progress(0.4, desc="Getting CPU temperature")
cpu_temp = (WinTmp.CPU_Temp())
if sys.platform == 'win32' or 'win64':
cpu_temp = (WinTmp.CPU_Temp())
else:
pass

progress(0.5, desc="Getting RAM information")
ram = psutil.virtual_memory()
Expand Down
2 changes: 0 additions & 2 deletions RequirementsFiles/requirements-СPU.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ gfpgan==1.3.8
gitdb==4.0.11
GitPython==3.1.43
google-pasta==0.2.0
GPUtil==1.4.0
gpytoolbox==0.3.2
gradio==5.4.0
gradio_client==1.4.2
Expand Down Expand Up @@ -305,7 +304,6 @@ wsproto==1.2.0
yapf==0.40.2
yarl==1.9.4
zipp==3.18.1
WinTmp==1.1.0
clr-loader==0.2.6
pythonnet==3.0.3
wmi==1.5.1
Expand Down
1 change: 0 additions & 1 deletion RequirementsFiles/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ wsproto==1.2.0
yapf==0.40.2
yarl==1.9.4
zipp==3.18.1
WinTmp==1.1.0
clr-loader==0.2.6
pythonnet==3.0.3
wmi==1.5.1
Expand Down
1 change: 1 addition & 0 deletions Update.bat
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ if "%INSTALL_TYPE%"=="CPU" (
pip install --no-deps -r "%CURRENT_DIR%RequirementsFiles\requirements-stable-diffusion-cpp.txt" 2>> %ERROR_LOG%
)

pip install --no-deps WinTmp==1.1.0
pip install https://huggingface.co/madbuda/triton-windows-builds/resolve/main/triton-3.0.0-cp310-cp310-win_amd64.whl 2>> %ERROR_LOG%
pip install --no-build-isolation -e git+https://github.com/PanQiWei/AutoGPTQ.git#egg=auto_gptq@v0.7.1 2>> %ERROR_LOG%
pip install --no-build-isolation -e git+https://github.com/casper-hansen/AutoAWQ.git#egg=autoawq@v0.2.6 2>> %ERROR_LOG%
Expand Down

0 comments on commit c616601

Please sign in to comment.