mirror of https://github.com/bmaltais/kohya_ss
Improve pip module verification
parent
3be05253bb
commit
3595f3711c
|
|
@ -435,6 +435,13 @@ def installed(package, friendly: str = None):
|
|||
try:
|
||||
if friendly:
|
||||
pkgs = friendly.split()
|
||||
|
||||
# Exclude command-line options and URLs like "--index-url https://download.pytorch.org/whl/cu118"
|
||||
pkgs = [
|
||||
p
|
||||
for p in package.split()
|
||||
if not p.startswith('--') and "://" not in p # Exclude command-line options and URLs
|
||||
]
|
||||
else:
|
||||
pkgs = [
|
||||
p
|
||||
|
|
@ -503,7 +510,6 @@ def install(
|
|||
pip(f'install --upgrade {package}', ignore=ignore, show_stdout=show_stdout)
|
||||
|
||||
|
||||
|
||||
def process_requirements_line(line, show_stdout: bool = False):
|
||||
# Remove brackets and their contents from the line using regular expressions
|
||||
# e.g., diffusers[torch]==0.10.2 becomes diffusers==0.10.2
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ def main_menu(platform_requirements_file, show_stdout: bool = False, no_run_acce
|
|||
setup_common.check_python()
|
||||
|
||||
# Upgrade pip if needed
|
||||
setup_common.install('--upgrade pip')
|
||||
setup_common.install('pip')
|
||||
setup_common.install_requirements(platform_requirements_file, check_no_verify_flag=False, show_stdout=show_stdout)
|
||||
if not no_run_accelerate:
|
||||
setup_common.configure_accelerate(run_accelerate=False)
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ def main_menu(platform_requirements_file):
|
|||
setup_common.check_python()
|
||||
|
||||
# Upgrade pip if needed
|
||||
setup_common.install('--upgrade pip')
|
||||
setup_common.install('pip')
|
||||
setup_common.install_requirements(platform_requirements_file, check_no_verify_flag=False, show_stdout=True)
|
||||
configure_accelerate()
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ def install_kohya_ss_torch2():
|
|||
setup_common.update_submodule()
|
||||
|
||||
# Upgrade pip if needed
|
||||
setup_common.install("--upgrade pip")
|
||||
setup_common.install("pip")
|
||||
|
||||
setup_common.install_requirements(
|
||||
"requirements_windows_torch2.txt", check_no_verify_flag=False
|
||||
|
|
|
|||
Loading…
Reference in New Issue