1 Star 0 Fork 0

lengyanju8/Stable-Diffusion-WebUI-TensorRT

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
install.py 2.05 KB
一键复制 编辑 原始数据 按行查看 历史
Luca 提交于 2024-01-05 12:12 . v0.2.0 (#217)
import launch
import sys
from importlib_metadata import version
python = sys.executable
def install():
if launch.is_installed("tensorrt"):
if not version("tensorrt") == "9.0.1.post11.dev4":
launch.run(
["python", "-m", "pip", "uninstall", "-y", "tensorrt"],
"removing old version of tensorrt",
)
if not launch.is_installed("tensorrt"):
print("TensorRT is not installed! Installing...")
launch.run_pip(
"install nvidia-cudnn-cu11==8.9.4.25 --no-cache-dir", "nvidia-cudnn-cu11"
)
launch.run_pip(
"install --pre --extra-index-url https://pypi.nvidia.com tensorrt==9.0.1.post11.dev4 --no-cache-dir",
"tensorrt",
live=True,
)
launch.run(
["python", "-m", "pip", "uninstall", "-y", "nvidia-cudnn-cu11"],
"removing nvidia-cudnn-cu11",
)
if launch.is_installed("nvidia-cudnn-cu11"):
if version("nvidia-cudnn-cu11") == "8.9.4.25":
launch.run(
["python", "-m", "pip", "uninstall", "-y", "nvidia-cudnn-cu11"],
"removing nvidia-cudnn-cu11",
)
# Polygraphy
if not launch.is_installed("polygraphy"):
print("Polygraphy is not installed! Installing...")
launch.run_pip(
"install polygraphy --extra-index-url https://pypi.ngc.nvidia.com",
"polygraphy",
live=True,
)
# ONNX GS
if not launch.is_installed("onnx_graphsurgeon"):
print("GS is not installed! Installing...")
launch.run_pip("install protobuf==3.20.2", "protobuf", live=True)
launch.run_pip(
"install onnx-graphsurgeon --extra-index-url https://pypi.ngc.nvidia.com",
"onnx-graphsurgeon",
live=True,
)
# OPTIMUM
if not launch.is_installed("optimum"):
print("Optimum is not installed! Installing...")
launch.run_pip(
"install optimum",
"optimum",
live=True,
)
install()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lengyanju8/Stable-Diffusion-WebUI-TensorRT.git
git@gitee.com:lengyanju8/Stable-Diffusion-WebUI-TensorRT.git
lengyanju8
Stable-Diffusion-WebUI-TensorRT
Stable-Diffusion-WebUI-TensorRT
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385