forked from facok/sd-webui-pe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.py
37 lines (25 loc) · 834 Bytes
/
install.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import logging
import launch
def install_deps() -> None:
"""install dependencies for the extension"""
if not launch.is_installed("torch"):
logging.warning(
"PyTorch is not found in your environment. "
"It's not likely the correct version if install automatically, "
"so you have to do it manually.",
)
if not launch.is_installed("transformers"):
launch.run_pip("install transformers")
if not launch.is_installed("SentencePiece"):
launch.run_pip("install SentencePiece")
if not launch.is_installed("yaml"):
launch.run_pip("install PyYAML")
def install() -> None:
install_deps()
try:
import launch
skip_install = launch.args.skip_install
except Exception:
skip_install = False
if not skip_install:
install()